Use the convenience function SDL_GetWindowFromEvent()
This commit is contained in:
1 parent
8d748d64e8
commit
f7c8d66ccb
3 files changed
+27
-27
No files matched your search
+2
-2
@@ -167,7 +167,7 @@ static void loop(void)
|
||||
SDLTest_CommonEvent(state, &event, &done);
|
||||
|
||||
if (event.type == SDL_EVENT_WINDOW_RESIZED) {
|
||||
SDL_Window *window = SDL_GetWindowFromID(event.window.windowID);
|
||||
SDL_Window *window = SDL_GetWindowFromEvent(&event);
|
||||
if (window) {
|
||||
SDL_Log("Window %" SDL_PRIu32 " resized to %" SDL_PRIs32 "x%" SDL_PRIs32 "\n",
|
||||
event.window.windowID,
|
||||
@@ -176,7 +176,7 @@ static void loop(void)
|
||||
}
|
||||
}
|
||||
if (event.type == SDL_EVENT_WINDOW_MOVED) {
|
||||
SDL_Window *window = SDL_GetWindowFromID(event.window.windowID);
|
||||
SDL_Window *window = SDL_GetWindowFromEvent(&event);
|
||||
if (window) {
|
||||
SDL_Log("Window %" SDL_PRIu32 " moved to %" SDL_PRIs32 ",%" SDL_PRIs32 " (display %s)\n",
|
||||
event.window.windowID,
|
||||
|
||||
Reference in new issue
Block a user