mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
generator: detect IMGUI_HAS_DOCK and keep it in cimgui.h
This commit is contained in:
@@ -12,6 +12,12 @@ else()
|
||||
set(BAKENDS_FOLDER "../imgui/examples/")
|
||||
endif()
|
||||
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../imgui/imgui_tables.cpp)
|
||||
set(TABLES_SOURCE "../imgui/imgui_tables.cpp")
|
||||
else()
|
||||
set(TABLES_SOURCE "")
|
||||
endif()
|
||||
|
||||
include_directories(../imgui)
|
||||
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
|
||||
|
||||
@@ -20,7 +26,8 @@ set(IMGUI_SOURCES ../cimgui.cpp
|
||||
../imgui/imgui.cpp
|
||||
../imgui/imgui_draw.cpp
|
||||
../imgui/imgui_demo.cpp
|
||||
../imgui/imgui_widgets.cpp
|
||||
../imgui/imgui_widgets.cpp
|
||||
${TABLES_SOURCE}
|
||||
)
|
||||
|
||||
set(IMGUI_SOURCES_sdl)
|
||||
@@ -45,9 +52,9 @@ if(IMGUI_FREETYPE)
|
||||
endif(IMGUI_FREETYPE)
|
||||
|
||||
#opengl3
|
||||
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_opengl3.cpp ${BAKENDS_FOLDER}libs/gl3w/GL/gl3w.c)
|
||||
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_opengl3.cpp ../imgui/examples/libs/gl3w/GL/gl3w.c)
|
||||
list(APPEND IMGUI_SOURCES ./cimgui_extras.cpp)
|
||||
include_directories(${BAKENDS_FOLDER}libs/gl3w)
|
||||
include_directories(../imgui/examples/libs/gl3w)
|
||||
if(WIN32)
|
||||
list(APPEND IMGUI_LIBRARIES opengl32)
|
||||
else(WIN32)#Unix
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#define USE_DOCKING
|
||||
|
||||
SDL_Window *window = NULL;
|
||||
|
||||
@@ -78,7 +77,7 @@ int main(int argc, char* argv[])
|
||||
ImGuiIO* ioptr = igGetIO();
|
||||
ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
|
||||
//ioptr->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||
#ifdef USE_DOCKING
|
||||
#ifdef IMGUI_HAS_DOCK
|
||||
ioptr->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
|
||||
ioptr->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
|
||||
#endif
|
||||
@@ -167,7 +166,7 @@ int main(int argc, char* argv[])
|
||||
glClearColor(clearColor.x, clearColor.y, clearColor.z, clearColor.w);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
|
||||
#ifdef USE_DOCKING
|
||||
#ifdef IMGUI_HAS_DOCK
|
||||
if (ioptr->ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||
{
|
||||
SDL_Window* backup_current_window = SDL_GL_GetCurrentWindow();
|
||||
|
Reference in New Issue
Block a user