mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 10:31:16 +00:00
Use SDL_EVENT_QUIT for window close (#126)
This commit is contained in:
parent
af554676e4
commit
911330e61c
@ -425,6 +425,9 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
|
||||
);
|
||||
}
|
||||
break;
|
||||
case SDL_EVENT_QUIT:
|
||||
return SDL_APP_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
if (event->user.type == g_legoSdlEvents.m_windowsMessage) {
|
||||
@ -432,9 +435,6 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
|
||||
case WM_ISLE_SETCURSOR:
|
||||
g_isle->SetupCursor((Cursor) (uintptr_t) event->user.data1);
|
||||
break;
|
||||
case WM_QUIT:
|
||||
return SDL_APP_SUCCESS;
|
||||
break;
|
||||
case WM_TIMER:
|
||||
if (InputManager()) {
|
||||
InputManager()->QueueEvent(c_notificationTimer, (MxU8) (uintptr_t) event->user.data1, 0, 0, 0);
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "mxomni.h"
|
||||
|
||||
#include <SDL3/SDL_events.h>
|
||||
#include <SDL3/SDL_timer.h>
|
||||
|
||||
class Isle;
|
||||
class LegoAnimationManager;
|
||||
@ -192,11 +193,13 @@ class LegoOmni : public MxOmni {
|
||||
|
||||
void CloseMainWindow()
|
||||
{
|
||||
SDL_QuitEvent quit;
|
||||
quit.type = SDL_EVENT_QUIT;
|
||||
quit.timestamp = SDL_GetTicksNS();
|
||||
|
||||
SDL_Event event;
|
||||
event.user.type = g_legoSdlEvents.m_windowsMessage;
|
||||
event.user.code = WM_QUIT;
|
||||
event.user.data1 = NULL;
|
||||
event.user.data2 = NULL;
|
||||
event.quit = quit;
|
||||
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user