imgui cleanup - still crashes on mod

This commit is contained in:
Ben
2021-09-22 01:31:50 +01:00
parent 1b6aa78e44
commit 46024124e3
3 changed files with 10 additions and 3 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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