Skip to content

Commit

Permalink
CMake: rename him_has_metal / him_has_opengl
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Dec 20, 2023
1 parent e417f19 commit 33f2a3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/hello_imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,13 @@ endfunction()
###################################################################################################
# OpenGL Rendering backend: API = him_use_opengl3_backend
###################################################################################################
function(him_use_opengl3_backend target)
function(him_has_opengl3 target)
target_sources(${target} PRIVATE
${imgui_backends_dir}/imgui_impl_opengl3.h
${imgui_backends_dir}/imgui_impl_opengl3.cpp
)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_HAS_OPENGL)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_HAS_OPENGL3)
set(HELLOIMGUI_HAS_OPENGL ON CACHE BOOL "" FORCE)

if(ANDROID OR IOS)
Expand Down Expand Up @@ -326,7 +327,7 @@ endfunction()
###################################################################################################
# Metal Rendering backend: API = him_use_metal_backend
###################################################################################################
function(him_use_metal_backend target)
function(him_has_metal target)
target_sources(${target} PRIVATE
${imgui_backends_dir}/imgui_impl_metal.h
${imgui_backends_dir}/imgui_impl_metal.mm
Expand Down Expand Up @@ -535,25 +536,25 @@ function(him_main)
endif()

if (HELLOIMGUI_USE_SDL_OPENGL3)
him_use_opengl3_backend(${helloimgui_target})
him_has_opengl3(${helloimgui_target})
him_use_sdl2_backend(${helloimgui_target})
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_SDL_OPENGL3)
endif()

if (HELLOIMGUI_USE_GLFW_OPENGL3)
him_use_opengl3_backend(${helloimgui_target})
him_has_opengl3(${helloimgui_target})
him_use_glfw_backend(${helloimgui_target})
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_GLFW_OPENGL3)
endif()

if(HELLOIMGUI_USE_SDL_METAL)
him_use_metal_backend(${helloimgui_target})
him_has_metal(${helloimgui_target})
him_use_sdl2_backend(${helloimgui_target})
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_SDL_METAL)
endif()

if(HELLOIMGUI_USE_GLFW_METAL)
him_use_metal_backend(${helloimgui_target})
him_has_metal(${helloimgui_target})
him_use_glfw_backend(${helloimgui_target})
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_GLFW_METAL)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/hello_imgui/internal/backend_impls/runner_glfw3.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RunnerGlfw3 : public AbstractRunner
// Methods related to the Windowing backend (SDL, Glfw, ...)
//
void Impl_InitBackend() override;
void Impl_InitBackend_PostImGuiInit();
void Impl_InitBackend_PostImGuiInit() override;
void Impl_CreateWindow() override;
void Impl_PollEvents() override;
void Impl_NewFrame_Backend() override;
Expand Down

0 comments on commit 33f2a3e

Please sign in to comment.