imgui cleanup - still crashes on mod
This commit is contained in:
@@ -113,6 +113,7 @@ void Display::EndFrame()
|
|||||||
|
|
||||||
void Display::Destroy()
|
void Display::Destroy()
|
||||||
{
|
{
|
||||||
|
Aeon::Rendering::CleanupImGui();
|
||||||
SDL_DestroyWindow( mWindow );
|
SDL_DestroyWindow( mWindow );
|
||||||
// dangly balls
|
// dangly balls
|
||||||
mWindow = nullptr;
|
mWindow = nullptr;
|
||||||
|
|||||||
@@ -37,9 +37,6 @@ void Input::PollInput()
|
|||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
while ( SDL_PollEvent( &mEvent ) )
|
while ( SDL_PollEvent( &mEvent ) )
|
||||||
{
|
{
|
||||||
// Provide to non-event driven subsystem
|
|
||||||
ImGui_ImplSDL2_ProcessEvent( &mEvent );
|
|
||||||
|
|
||||||
switch ( mEvent.type )
|
switch ( mEvent.type )
|
||||||
{
|
{
|
||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
@@ -69,6 +66,8 @@ void Input::PollInput()
|
|||||||
mPollKeyboard();
|
mPollKeyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Provide to non-event driven subsystem
|
||||||
|
ImGui_ImplSDL2_ProcessEvent( &mEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
// just in case
|
// just in case
|
||||||
|
|||||||
@@ -26,6 +26,13 @@ inline void SetupImGui( const SDL_Window* window, const SDL_GLContext& context )
|
|||||||
ImGui_ImplOpenGL3_Init( "#version 450" );
|
ImGui_ImplOpenGL3_Init( "#version 450" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void CleanupImGui()
|
||||||
|
{
|
||||||
|
ImGui_ImplOpenGL3_Shutdown();
|
||||||
|
ImGui_ImplSDL2_Shutdown();
|
||||||
|
ImGui::DestroyContext();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user