diff src/video/directfb/SDL_DirectFB_mouse.c @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents d72a0dd80e8b
children f7b03b6838cb
line wrap: on
line diff
--- a/src/video/directfb/SDL_DirectFB_mouse.c	Thu Jan 21 05:49:41 2010 +0000
+++ b/src/video/directfb/SDL_DirectFB_mouse.c	Thu Jan 21 06:21:52 2010 +0000
@@ -31,7 +31,7 @@
 static int DirectFB_ShowCursor(SDL_Cursor * cursor);
 static void DirectFB_MoveCursor(SDL_Cursor * cursor);
 static void DirectFB_FreeCursor(SDL_Cursor * cursor);
-static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID,
+static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window,
                                int x, int y);
 static void DirectFB_FreeMouse(SDL_Mouse * mouse);
 
@@ -159,14 +159,13 @@
 {
     SDL_DFB_CURSORDATA(cursor);
     DFBResult ret;
-    SDL_WindowID wid;
+    SDL_Window *window;
 
-    wid = SDL_GetFocusWindow();
-    if (wid <= 0)
+    window = SDL_GetFocusWindow();
+    if (!window)
         return -1;
     else {
-        SDL_Window *window = SDL_GetWindowFromID(wid);
-        SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
+        SDL_VideoDisplay *display = window->display;
 
         if (display) {
             DFB_DisplayData *dispdata =
@@ -216,10 +215,9 @@
 
 /* Warp the mouse to (x,y) */
 static void
-DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y)
+DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
 {
-    SDL_Window *window = SDL_GetWindowFromID(windowID);
-    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
+    SDL_VideoDisplay *display = window->display;
     DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
     DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
     DFBResult ret;