Mercurial > sdl-ios-xcode
comparison test/testwm2.c @ 5251:58265e606e4e
Window coordinates are in the global space and windows are not tied to a particular display.
Also added Ctrl-Enter keybinding to the test code to toggle fullscreen mode for testing.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 10 Feb 2011 14:44:25 -0800 |
parents | 9de326b3099c |
children |
comparison
equal
deleted
inserted
replaced
5250:329d435f97f4 | 5251:58265e606e4e |
---|---|
47 done = 0; | 47 done = 0; |
48 while (!done) { | 48 while (!done) { |
49 /* Check for events */ | 49 /* Check for events */ |
50 while (SDL_PollEvent(&event)) { | 50 while (SDL_PollEvent(&event)) { |
51 CommonEvent(state, &event, &done); | 51 CommonEvent(state, &event, &done); |
52 | |
53 if (event.type == SDL_WINDOWEVENT) { | |
54 if (event.window.event == SDL_WINDOWEVENT_MOVED) { | |
55 SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); | |
56 if (window) { | |
57 printf("Window %d moved to %d,%d (display %d)\n", | |
58 event.window.windowID, | |
59 event.window.data1, | |
60 event.window.data2, | |
61 SDL_GetWindowDisplay(window)); | |
62 } | |
63 } | |
64 } | |
52 } | 65 } |
53 } | 66 } |
54 quit(0); | 67 quit(0); |
55 // keep the compiler happy ... | 68 // keep the compiler happy ... |
56 return(0); | 69 return(0); |