# glViewport Problem

I am using glViewport() to render a 1024x1024 shadow depth buffer for a game that is using a 1000x600 game window. Under normal circumstances it works fine, however when I am running Bandicam to monitor the FPS of the game, it seems to crop the buffer by the ratio of the window's resolution to the buffer's resolution. All of the other buffers are unaffected and the shadow depth buffer is the only one that relies on glViewport() so I believe it has something to do with glViewport(). Any suggestions as to what might be going on are appreciated.

What the shadow depth map looks like normally:

What the shadow depth map looks like when Bandicam is running:

Some of the code related to the shadow depth buffer:

create_and_bind_framebuffer(&shadow_depth_map_framebuffer);
glDrawBuffer(GL_NONE);

...

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glDrawElementsInstanced(GL_TRIANGLES, static_cast<GLsizei>(m_mesh->indices.size()),
GL_UNSIGNED_INT, nullptr, static_cast<GLsizei>(m_instances));
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glBindVertexArray(NULL);
glUseProgram(NULL);

...

glViewport(0, 0, Window::get_size().x, Window::get_size().y);