@ -397,7 +397,7 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
return false ;
}
static bool ImGui_ImplSDL2_Init ( SDL_Window * window , SDL_Renderer * renderer )
static bool ImGui_ImplSDL2_Init ( SDL_Window * window , SDL_Renderer * renderer , void * sdl_gl_context )
{
ImGuiIO & io = ImGui : : GetIO ( ) ;
IMGUI_CHECKVERSION ( ) ;
@ -448,6 +448,7 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
// Set platform dependent data in viewport
// Our mouse update function expect PlatformHandle to be filled for the main viewport
ImGuiViewport * main_viewport = ImGui : : GetMainViewport ( ) ;
main_viewport - > PlatformHandle = ( void * ) window ;
main_viewport - > PlatformHandleRaw = nullptr ;
SDL_SysWMinfo info ;
SDL_VERSION ( & info . version ) ;
@ -481,13 +482,13 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
SDL_SetHint ( SDL_HINT_MOUSE_AUTO_CAPTURE , " 0 " ) ;
# endif
( void ) sdl_gl_context ; // Unused in 'master' branch.
return true ;
}
bool ImGui_ImplSDL2_InitForOpenGL ( SDL_Window * window , void * sdl_gl_context )
{
IM_UNUSED ( sdl_gl_context ) ; // Viewport branch will need this.
return ImGui_ImplSDL2_Init ( window , nullptr ) ;
return ImGui_ImplSDL2_Init ( window , nullptr , sdl_gl_context ) ;
}
bool ImGui_ImplSDL2_InitForVulkan ( SDL_Window * window )
@ -495,7 +496,7 @@ bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
# if !SDL_HAS_VULKAN
IM_ASSERT ( 0 & & " Unsupported " ) ;
# endif
return ImGui_ImplSDL2_Init ( window , nullptr ) ;
return ImGui_ImplSDL2_Init ( window , nullptr , nullptr ) ;
}
bool ImGui_ImplSDL2_InitForD3D ( SDL_Window * window )
@ -503,22 +504,22 @@ bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)
# if !defined(_WIN32)
IM_ASSERT ( 0 & & " Unsupported " ) ;
# endif
return ImGui_ImplSDL2_Init ( window , nullptr ) ;
return ImGui_ImplSDL2_Init ( window , nullptr , nullptr ) ;
}
bool ImGui_ImplSDL2_InitForMetal ( SDL_Window * window )
{
return ImGui_ImplSDL2_Init ( window , nullptr ) ;
return ImGui_ImplSDL2_Init ( window , nullptr , nullptr ) ;
}
bool ImGui_ImplSDL2_InitForSDLRenderer ( SDL_Window * window , SDL_Renderer * renderer )
{
return ImGui_ImplSDL2_Init ( window , renderer ) ;
return ImGui_ImplSDL2_Init ( window , renderer , nullptr ) ;
}
bool ImGui_ImplSDL2_InitForOther ( SDL_Window * window )
{
return ImGui_ImplSDL2_Init ( window , nullptr ) ;
return ImGui_ImplSDL2_Init ( window , nullptr , nullptr ) ;
}
static void ImGui_ImplSDL2_CloseGamepads ( ) ;