From 79dca9d5e6f127f6dd236ca7146f28b55550489f Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 19 Jan 2018 09:45:27 +0100 Subject: [PATCH] Examples: SDL+GL2: Renamed imgui_impl_sdl.* to imgui_impl_sdl_gl2.* for consistency and to emphasis on GL2-ness. --- examples/sdl_opengl2_example/build_win32.bat | 2 +- .../{imgui_impl_sdl.cpp => imgui_impl_sdl_gl2.cpp} | 6 +++--- .../{imgui_impl_sdl.h => imgui_impl_sdl_gl2.h} | 0 examples/sdl_opengl2_example/main.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename examples/sdl_opengl2_example/{imgui_impl_sdl.cpp => imgui_impl_sdl_gl2.cpp} (97%) rename examples/sdl_opengl2_example/{imgui_impl_sdl.h => imgui_impl_sdl_gl2.h} (100%) diff --git a/examples/sdl_opengl2_example/build_win32.bat b/examples/sdl_opengl2_example/build_win32.bat index 3cf81e60a..799561dec 100644 --- a/examples/sdl_opengl2_example/build_win32.bat +++ b/examples/sdl_opengl2_example/build_win32.bat @@ -1,3 +1,3 @@ @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. mkdir Debug -cl /nologo /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL_DIR%\include main.cpp imgui_impl_sdl.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/sdl_opengl2_example.exe /FoDebug/ /link /libpath:%SDL_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console +cl /nologo /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL_DIR%\include main.cpp imgui_impl_sdl_gl2.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /FeDebug/sdl_opengl2_example.exe /FoDebug/ /link /libpath:%SDL_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console diff --git a/examples/sdl_opengl2_example/imgui_impl_sdl.cpp b/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp similarity index 97% rename from examples/sdl_opengl2_example/imgui_impl_sdl.cpp rename to examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp index 263017dcb..154a6d238 100644 --- a/examples/sdl_opengl2_example/imgui_impl_sdl.cpp +++ b/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "imgui_impl_sdl.h" +#include "imgui_impl_sdl_gl2.h" // Data static double g_Time = 0.0f; @@ -30,7 +30,7 @@ static GLuint g_FontTexture = 0; // This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure) // Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly, in order to be able to run within any OpenGL engine that doesn't do so. // If text or lines are blurry when integrating ImGui in your engine: in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f) -void ImGui_ImplSdl_RenderDrawLists(ImDrawData* draw_data) +void ImGui_ImplSdlGL2_RenderDrawLists(ImDrawData* draw_data) { // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) ImGuiIO& io = ImGui::GetIO(); @@ -226,7 +226,7 @@ bool ImGui_ImplSdlGL2_Init(SDL_Window* window) io.KeyMap[ImGuiKey_Y] = SDLK_y; io.KeyMap[ImGuiKey_Z] = SDLK_z; - io.RenderDrawListsFn = ImGui_ImplSdl_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer. + io.RenderDrawListsFn = ImGui_ImplSdlGL2_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer. io.SetClipboardTextFn = ImGui_ImplSdl_SetClipboardText; io.GetClipboardTextFn = ImGui_ImplSdl_GetClipboardText; io.ClipboardUserData = NULL; diff --git a/examples/sdl_opengl2_example/imgui_impl_sdl.h b/examples/sdl_opengl2_example/imgui_impl_sdl_gl2.h similarity index 100% rename from examples/sdl_opengl2_example/imgui_impl_sdl.h rename to examples/sdl_opengl2_example/imgui_impl_sdl_gl2.h diff --git a/examples/sdl_opengl2_example/main.cpp b/examples/sdl_opengl2_example/main.cpp index 1396fcca0..21b567a83 100644 --- a/examples/sdl_opengl2_example/main.cpp +++ b/examples/sdl_opengl2_example/main.cpp @@ -7,7 +7,7 @@ // See imgui_impl_sdl.cpp for details. #include -#include "imgui_impl_sdl.h" +#include "imgui_impl_sdl_gl2.h" #include #include #include