comparison src/video/directfb/SDL_DirectFB_mouse.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 164f20ba08eb
children b530ef003506
comparison
equal deleted inserted replaced
5250:329d435f97f4 5251:58265e606e4e
168 168
169 window = SDL_GetFocusWindow(); 169 window = SDL_GetFocusWindow();
170 if (!window) 170 if (!window)
171 return -1; 171 return -1;
172 else { 172 else {
173 SDL_VideoDisplay *display = window->display; 173 SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
174 174
175 if (display) { 175 if (display) {
176 DFB_DisplayData *dispdata = 176 DFB_DisplayData *dispdata =
177 (DFB_DisplayData *) display->driverdata; 177 (DFB_DisplayData *) display->driverdata;
178 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 178 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
220 220
221 /* Warp the mouse to (x,y) */ 221 /* Warp the mouse to (x,y) */
222 static void 222 static void
223 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y) 223 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
224 { 224 {
225 SDL_VideoDisplay *display = window->display; 225 SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
226 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 226 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
227 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 227 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
228 DFBResult ret; 228 DFBResult ret;
229 int cx, cy; 229 int cx, cy;
230 230