From 8a61c0afeae9209c5a11ecfb50bbe4737e8edcbc Mon Sep 17 00:00:00 2001 From: Nick Gravelyn Date: Wed, 20 Jan 2016 06:11:28 -0800 Subject: [PATCH] Applying same fix to OpenGL 3 example. Fixing spaces/tabs. --- examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp | 5 ++++- examples/sdl_opengl_example/imgui_impl_sdl.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp index bf47a7a1..db76fb46 100644 --- a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp +++ b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp @@ -352,7 +352,10 @@ void ImGui_ImplSdlGL3_NewFrame() int w, h; SDL_GetWindowSize(g_Window, &w, &h); io.DisplaySize = ImVec2((float)w, (float)h); - io.DisplayFramebufferScale = ImVec2(1.0f, 1.0f); + + int glW, glH; + SDL_GL_GetDrawableSize(window, &glW, &glH); + io.DisplayFramebufferScale = ImVec2(glW / io.DisplaySize.x, glH / io.DisplaySize.y); // Setup time step Uint32 time = SDL_GetTicks(); diff --git a/examples/sdl_opengl_example/imgui_impl_sdl.cpp b/examples/sdl_opengl_example/imgui_impl_sdl.cpp index e222c806..47dac65b 100644 --- a/examples/sdl_opengl_example/imgui_impl_sdl.cpp +++ b/examples/sdl_opengl_example/imgui_impl_sdl.cpp @@ -240,9 +240,9 @@ void ImGui_ImplSdl_NewFrame(SDL_Window *window) SDL_GetWindowSize(window, &w, &h); io.DisplaySize = ImVec2((float)w, (float)h); - int glW, glH; - SDL_GL_GetDrawableSize(window, &glW, &glH); - io.DisplayFramebufferScale = ImVec2(glW / io.DisplaySize.x, glH / io.DisplaySize.y); + int glW, glH; + SDL_GL_GetDrawableSize(window, &glW, &glH); + io.DisplayFramebufferScale = ImVec2(glW / io.DisplaySize.x, glH / io.DisplaySize.y); // Setup time step Uint32 time = SDL_GetTicks();