[OpenGL] Don't set display size to scissor box if its size is just 1 by 1

pull/109/head
jackun 4 years ago
parent ab9c9ea7ea
commit 053a07d83c
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -190,15 +190,18 @@ void imgui_render()
GLVec vp; glGetIntegerv (GL_VIEWPORT, vp.v);
GLVec sb; glGetIntegerv (GL_SCISSOR_BOX, sb.v);
if (vp != last_vp) {
bool invalid_scissor = (sb[2] == 1 && sb[3] == 1);
if (vp != last_vp || invalid_scissor) {
#ifndef NDEBUG
printf("viewport: %d %d %d %d\n", vp[0], vp[1], vp[2], vp[3]);
#endif
ImGui::GetIO().DisplaySize = ImVec2(vp[2], vp[3]);
}
if (sb != last_sb
|| last_vp == sb // openmw initial viewport size is the same (correct)
if (!invalid_scissor &&
(sb != last_sb
|| last_vp == sb) // openmw initial viewport size is the same (correct)
// at start as scissor box, so apply it instead
) {
#ifndef NDEBUG

Loading…
Cancel
Save