Mercurial > sdl-ios-xcode
comparison src/video/directfb/SDL_DirectFB_mouse.c @ 2721:e82a0e3e9b0e
Date: Sun, 20 Jul 2008 22:34:37 +0200
From: Couriersud
Subject: Updated DirectFB driver for SDL1.3
please find attached a patch for an updated directfb driver for SDL1.3.
It does now
- properly supported the new input api.
- send unicode text events
- support directfb windows
- support multiple screens
- support hardware YUV scaling for the first YUV texture created.
- support hardware scaling for textures.
- properly interpret streaming access
- support software opengl if one manages to install the mesa directfb
driver (broken/not broken in mesa svn)
Within bugzilla (http://bugzilla.libsdl.org/show_bug.cgi?id=603) there
is another patch which fixes a crash due to GL context creation.
Kind regards,
couriersud
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 26 Aug 2008 02:32:45 +0000 |
parents | 1e690901ecd7 |
children | 204be4fc2726 |
comparison
equal
deleted
inserted
replaced
2720:4eb759edddf5 | 2721:e82a0e3e9b0e |
---|---|
78 SDL_DFB_CALLOC(cursor, 1, sizeof(*cursor)); | 78 SDL_DFB_CALLOC(cursor, 1, sizeof(*cursor)); |
79 SDL_DFB_CALLOC(curdata, 1, sizeof(*curdata)); | 79 SDL_DFB_CALLOC(curdata, 1, sizeof(*curdata)); |
80 | 80 |
81 dsc.flags = | 81 dsc.flags = |
82 DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS; | 82 DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS; |
83 dsc.caps = DSCAPS_NONE; //DSCAPS_SYSTEMONLY; | 83 dsc.caps = DSCAPS_VIDEOONLY; |
84 dsc.width = surface->w; | 84 dsc.width = surface->w; |
85 dsc.height = surface->h; | 85 dsc.height = surface->h; |
86 dsc.pixelformat = DSPF_ARGB; | 86 dsc.pixelformat = DSPF_ARGB; |
87 | 87 |
88 SDL_DFB_CHECKERR(devdata->dfb-> | 88 SDL_DFB_CHECKERR(devdata->dfb-> |
99 for (i = 0; i < surface->w * surface->h; i++) | 99 for (i = 0; i < surface->w * surface->h; i++) |
100 if (p[i] == 0x00000000) | 100 if (p[i] == 0x00000000) |
101 dest[i] = 0x00000000; | 101 dest[i] = 0x00000000; |
102 else | 102 else |
103 dest[i] = p[i]; | 103 dest[i] = p[i]; |
104 //memcpy(dest, surface->pixels, surface->w * surface->h * 4); | |
105 curdata->surf->Unlock(curdata->surf); | 104 curdata->surf->Unlock(curdata->surf); |
106 return cursor; | 105 return cursor; |
107 error: | 106 error: |
108 return NULL; | 107 return NULL; |
109 } | 108 } |
110 | 109 |
111 /* Show the specified cursor, or hide if cursor is NULL */ | 110 /* Show the specified cursor, or hide if cursor is NULL */ |
112 static int | 111 static int |
113 DirectFB_ShowCursor(SDL_Cursor * cursor) | 112 DirectFB_ShowCursor(SDL_Cursor * cursor) |
114 { | 113 { |
115 //FIXME check for null cursor here | |
116 SDL_DFB_CURSORDATA(cursor); | 114 SDL_DFB_CURSORDATA(cursor); |
117 SDL_VideoDevice *dev = SDL_GetVideoDevice(); | 115 SDL_VideoDevice *dev = SDL_GetVideoDevice(); |
118 SDL_DFB_DEVICEDATA(dev); | 116 SDL_DFB_DEVICEDATA(dev); |
119 #if 0 | 117 #if 0 |
120 DFB_DisplayData *dispdata = | 118 DFB_DisplayData *dispdata = |
134 | 132 |
135 if (cursor) | 133 if (cursor) |
136 SDL_DFB_CHECKERR(windata->window-> | 134 SDL_DFB_CHECKERR(windata->window-> |
137 SetCursorShape(windata->window, curdata->surf, | 135 SetCursorShape(windata->window, curdata->surf, |
138 curdata->hotx, curdata->hoty)); | 136 curdata->hotx, curdata->hoty)); |
139 //FIXME: This is somehow a directfb issue | |
140 //TODO: Check administrative | 137 //TODO: Check administrative |
141 SDL_DFB_CHECKERR(dispdata->layer-> | 138 SDL_DFB_CHECKERR(dispdata->layer-> |
142 SetCooperativeLevel(dispdata->layer, | 139 SetCooperativeLevel(dispdata->layer, |
143 DLSCL_ADMINISTRATIVE)); | 140 DLSCL_ADMINISTRATIVE)); |
144 SDL_DFB_CHECKERR(dispdata->layer-> | 141 SDL_DFB_CHECKERR(dispdata->layer-> |
174 | 171 |
175 /* Warp the mouse to (x,y) */ | 172 /* Warp the mouse to (x,y) */ |
176 static void | 173 static void |
177 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y) | 174 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y) |
178 { | 175 { |
179 // SDL_DFB_CURSORDATA(cursor); | |
180 SDL_Window *window = SDL_GetWindowFromID(windowID); | 176 SDL_Window *window = SDL_GetWindowFromID(windowID); |
181 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); | 177 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); |
182 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; | 178 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; |
183 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; | 179 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; |
184 DFBResult ret; | 180 DFBResult ret; |