فهرست منبع

Backends: SDL2: Fixed build for versions older than 2.0.14. (#7660)

ocornut 6 ماه پیش
والد
کامیت
b78cc37891
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      backends/imgui_impl_sdl2.cpp

+ 2 - 1
backends/imgui_impl_sdl2.cpp

@@ -116,6 +116,7 @@
 #define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE    0
 #define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE    0
 #endif
 #endif
 #define SDL_HAS_VULKAN                      SDL_VERSION_ATLEAST(2,0,6)
 #define SDL_HAS_VULKAN                      SDL_VERSION_ATLEAST(2,0,6)
+#define SDL_HAS_OPEN_URL                    SDL_VERSION_ATLEAST(2,0,14)
 #if SDL_HAS_VULKAN
 #if SDL_HAS_VULKAN
 #include <SDL_vulkan.h>
 #include <SDL_vulkan.h>
 #endif
 #endif
@@ -481,7 +482,7 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer, void
     platform_io.Platform_SetImeDataFn = ImGui_ImplSDL2_PlatformSetImeData;
     platform_io.Platform_SetImeDataFn = ImGui_ImplSDL2_PlatformSetImeData;
 #ifdef __EMSCRIPTEN__
 #ifdef __EMSCRIPTEN__
     platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplSDL2_EmscriptenOpenURL(url); return true; };
     platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplSDL2_EmscriptenOpenURL(url); return true; };
-#else
+#elif SDL_HAS_OPEN_URL
     platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { return SDL_OpenURL(url) == 0; };
     platform_io.Platform_OpenInShellFn = [](ImGuiContext*, const char* url) { return SDL_OpenURL(url) == 0; };
 #endif
 #endif