[go: up one dir, main page]

Skip to content

Commit

Permalink
Compatibility with new ImGui
Browse files Browse the repository at this point in the history
  • Loading branch information
piernov committed Dec 13, 2020
1 parent 9834dc6 commit 3c1bd41
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ if(ENABLE_GLES2)
endif()

# workaround for OpenGL include for OpenGL2, need to be glad rather than gl itself
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/imgui/examples/imgui_impl_opengl2.cpp" input)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/imgui/backends/imgui_impl_opengl2.cpp" input)
string(REPLACE "OpenGL/gl.h" "glad/glad.h" input "${input}")
string(REPLACE "GL/gl.h" "glad/glad.h" input "${input}")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/imgui/examples/imgui_impl_opengl2.cpp" "${input}")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/imgui/backends/imgui_impl_opengl2.cpp" "${input}")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/imgui
${GLAD_INCLUDE_DIRS}
Expand All @@ -86,19 +86,20 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/imgui
set(SOURCES
imgui/imgui.cpp
imgui/imgui_draw.cpp
imgui/imgui_tables.cpp
imgui/imgui_widgets.cpp
imgui/misc/cpp/imgui_stdlib.cpp
imgui/examples/imgui_impl_sdl.cpp)
imgui/backends/imgui_impl_sdl.cpp)


if(ENABLE_GL1)
LIST(APPEND SOURCES
imgui/examples/imgui_impl_opengl2.cpp
imgui/backends/imgui_impl_opengl2.cpp
)
endif()
if(ENABLE_GL3)
LIST(APPEND SOURCES
imgui/examples/imgui_impl_opengl3.cpp
imgui/backends/imgui_impl_opengl3.cpp
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/openboardview/GUI/Preferences/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void Keyboard::render() {
auto colcount = 1 + (maxbindings != keybindings.keybindings.end() ? maxbindings->second.size() : 0) + 1;

if (ImGui::BeginTable("KeyBindings", colcount,
ImGuiTableFlags_SizingPolicyFixedX // size according to content
ImGuiTableFlags_ColumnsWidthFixed // size according to content
| ImGuiTableFlags_RowBg // alternating background colors
| ImGuiTableFlags_BordersH
| ImGuiTableFlags_BordersV)) {
Expand Down
2 changes: 1 addition & 1 deletion src/openboardview/Renderers/ImGuiRendererSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>

#include "imgui_impl_sdl.h"
#include "backends/imgui_impl_sdl.h"

ImGuiRendererSDL::ImGuiRendererSDL(SDL_Window *window) : window(window) {
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/openboardview/Renderers/ImGuiRendererSDLGL1.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ImGuiRendererSDLGL1.h"

#include "imgui_impl_opengl2.h"
#include "backends/imgui_impl_opengl2.h"

std::string ImGuiRendererSDLGL1::name() {
return "ImGuiRendererSDLGL1";
Expand Down
2 changes: 1 addition & 1 deletion src/openboardview/Renderers/ImGuiRendererSDLGL3.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ImGuiRendererSDLGL3.h"

#include "imgui_impl_opengl3.h"
#include "backends/imgui_impl_opengl3.h"

std::string ImGuiRendererSDLGL3::name() {
return "ImGuiRendererSDLGL3";
Expand Down

0 comments on commit 3c1bd41

Please sign in to comment.