Viewport, Platform: SDL: Makes the CreateViewport function restore current GL context so in theory it is free from side-effect. That said, it seems like there is a bug in SDL because our CreateViewport (currently in Render(), not for long) have affect a jerky side-effect if SDL_GL_MakeCurrent() is called before Render(). (#1542)

This commit is contained in:
omar
2018-03-15 19:25:23 +01:00
parent 8364d1ca6c
commit 2e1ac0f683
2 changed files with 15 additions and 6 deletions

View File

@ -125,11 +125,11 @@ int main(int, char**)
}
// Rendering
ImGui::Render();
SDL_GL_MakeCurrent(window, gl_context);
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
glClear(GL_COLOR_BUFFER_BIT);
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
ImGui::RenderAdditionalViewports();