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);
create_buffer(&shadow_depth_map_depth_buffer, GL_DEPTH_ATTACHMENT, SHADOW_RESOLUTION,
SHADOW_RESOLUTION, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_LINEAR, GL_REPEAT);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
...
glViewport(0, 0, SHADOW_RESOLUTION, SHADOW_RESOLUTION);
glBindFramebuffer(GL_FRAMEBUFFER, shadow_depth_map_framebuffer);
shadow_depth_shader.use();
glUniformMatrix4fv(shadow_depth_shader_light_space_uniform, 1, GL_FALSE, glm::value_ptr(light_space));
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);