Skip to content

Commit

Permalink
CMake: review usages of HELLOIMGUI_HAS_OPENGL & HELLOIMGUI_USE_SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Dec 19, 2023
1 parent 0391540 commit ee0bcc6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/hello_imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ function (him_use_sdl2_backend target)
${imgui_backends_dir}/imgui_impl_sdl2.cpp
)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_SDL)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_SDL2)
endfunction()


Expand Down Expand Up @@ -452,6 +453,7 @@ function(him_use_glfw_backend target)
${imgui_backends_dir}/imgui_impl_glfw.cpp
)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_GLFW)
target_compile_definitions(${helloimgui_target} PUBLIC HELLOIMGUI_USE_GLFW3)
endfunction()

function(_him_fetch_glfw_if_needed)
Expand Down
4 changes: 2 additions & 2 deletions src/hello_imgui/hello_imgui.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#if defined(__ANDROID__) && defined(HELLOIMGUI_USE_SDL_OPENGL3)
#if defined(__ANDROID__) && defined(HELLOIMGUI_USE_SDL)
// We need to include SDL, so that it can instantiate its main function under Android
#include "SDL.h"
#endif
Expand All @@ -19,7 +19,7 @@
#include <cstddef>
#include <cstdint>

#ifdef HELLOIMGUI_USE_SDL_OPENGL3
#ifdef HELLOIMGUI_USE_SDL
#ifdef _WIN32
#ifndef HELLOIMGUI_WIN32_AUTO_WINMAIN
// Under Windows, we redefine WinMain ourselves
Expand Down
6 changes: 3 additions & 3 deletions src/hello_imgui/internal/hello_imgui_assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "hello_imgui/internal/whereami/whereami_cpp.h"


#ifdef HELLOIMGUI_USE_SDL_OPENGL3
#ifdef HELLOIMGUI_USE_SDL
#include "SDL_system.h"
#endif

Expand Down Expand Up @@ -256,7 +256,7 @@ bool AssetExists(const std::string& assetFilename)
}


#ifdef HELLOIMGUI_USE_SDL_OPENGL3
#ifdef HELLOIMGUI_USE_SDL

AssetFileData LoadAssetFileData(const char *assetPath)
{
Expand Down Expand Up @@ -343,7 +343,7 @@ void FreeAssetFileData(AssetFileData * assetFileData)
assetFileData = nullptr;
}

#endif // #ifdef HELLOIMGUI_USE_SDL_OPENGL3
#endif // #ifdef HELLOIMGUI_USE_SDL


} // namespace HelloImGui
2 changes: 1 addition & 1 deletion src/hello_imgui/internal/platform/ini_folder_locations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#include "hello_imgui/internal/platform/getAppleBundleResourcePath.h"
using namespace AppleIniFolderLocations;

#elif defined(__ANDROID__) && defined(HELLOIMGUI_USE_SDL_OPENGL3)
#elif defined(__ANDROID__) && defined(HELLOIMGUI_USE_SDL)
#include "SDL.h"

static std::string GetAppUserConfigFolder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace HelloImGui
test_io.ConfigVerboseLevelOnError = ImGuiTestVerboseLevel_Debug;
test_io.ConfigRunSpeed = ImGuiTestRunSpeed_Normal; // Default to slowest mode in this demo

#if defined(HELLOIMGUI_USE_SDL_OPENGL3) || defined(HELLOIMGUI_USE_GLFW_OPENGL3)
#ifdef HELLOIMGUI_HAS_OPENGL
test_io.ScreenCaptureFunc = HelloImGui::ImGuiApp_ImplGL_CaptureFramebuffer;
#endif
}
Expand Down

0 comments on commit ee0bcc6

Please sign in to comment.