comparison src/video/pandora/SDL_pandora.c @ 3500:4b594623401b

Work in progress on multi-display support: * Added display parameter to many internal functions so video modes can be set on displays that aren't the public current one. * The fullscreen mode is associated with fullscreen windows - not displays, so different windows more naturally have a mode associated with them based on their width and height. It's no longer necessary to specify a fullscreen mode, a default one will be picked automatically for fullscreen windows.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 01 Dec 2009 05:57:15 +0000
parents ca5663493497
children 64ce267332c6
comparison
equal deleted inserted replaced
3499:4cf8a1423d57 3500:4b594623401b
106 /* Setup all functions which we can handle */ 106 /* Setup all functions which we can handle */
107 device->VideoInit = PND_videoinit; 107 device->VideoInit = PND_videoinit;
108 device->VideoQuit = PND_videoquit; 108 device->VideoQuit = PND_videoquit;
109 device->GetDisplayModes = PND_getdisplaymodes; 109 device->GetDisplayModes = PND_getdisplaymodes;
110 device->SetDisplayMode = PND_setdisplaymode; 110 device->SetDisplayMode = PND_setdisplaymode;
111 device->SetDisplayPalette = PND_setdisplaypalette;
112 device->GetDisplayPalette = PND_getdisplaypalette;
113 device->SetDisplayGammaRamp = PND_setdisplaygammaramp;
114 device->GetDisplayGammaRamp = PND_getdisplaygammaramp;
115 device->CreateWindow = PND_createwindow; 111 device->CreateWindow = PND_createwindow;
116 device->CreateWindowFrom = PND_createwindowfrom; 112 device->CreateWindowFrom = PND_createwindowfrom;
117 device->SetWindowTitle = PND_setwindowtitle; 113 device->SetWindowTitle = PND_setwindowtitle;
118 device->SetWindowIcon = PND_setwindowicon; 114 device->SetWindowIcon = PND_setwindowicon;
119 device->SetWindowPosition = PND_setwindowposition; 115 device->SetWindowPosition = PND_setwindowposition;
189 { 185 {
190 186
191 } 187 }
192 188
193 void 189 void
194 PND_getdisplaymodes(_THIS) 190 PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display)
195 { 191 {
196 192
197 } 193 }
198 194
199 int 195 int
200 PND_setdisplaymode(_THIS, SDL_DisplayMode * mode) 196 PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
201 { 197 {
202 return 0; 198 return 0;
203 }
204
205 int
206 PND_setdisplaypalette(_THIS, SDL_Palette * palette)
207 {
208 SDL_DisplayData *didata =
209 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
210
211 /* Setting display palette operation has been failed */
212 return -1;
213 }
214
215 int
216 PND_getdisplaypalette(_THIS, SDL_Palette * palette)
217 {
218 SDL_DisplayData *didata =
219 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
220
221 /* Getting display palette operation has been failed */
222 return -1;
223 }
224
225 int
226 PND_setdisplaygammaramp(_THIS, Uint16 * ramp)
227 {
228 SDL_DisplayData *didata =
229 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
230
231 /* Setting display gamma ramp operation has been failed */
232 return -1;
233 }
234
235 int
236 PND_getdisplaygammaramp(_THIS, Uint16 * ramp)
237 {
238 /* Getting display gamma ramp operation has been failed */
239 return -1;
240 } 199 }
241 200
242 int 201 int
243 PND_createwindow(_THIS, SDL_Window * window) 202 PND_createwindow(_THIS, SDL_Window * window)
244 { 203 {
456 PND_gl_createcontext(_THIS, SDL_Window * window) 415 PND_gl_createcontext(_THIS, SDL_Window * window)
457 { 416 {
458 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; 417 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
459 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; 418 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
460 SDL_DisplayData *didata = 419 SDL_DisplayData *didata =
461 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; 420 (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata;
462 EGLBoolean status; 421 EGLBoolean status;
463 int32_t gfstatus; 422 int32_t gfstatus;
464 EGLint configs; 423 EGLint configs;
465 uint32_t attr_pos; 424 uint32_t attr_pos;
466 EGLint attr_value; 425 EGLint attr_value;
855 PND_gl_swapwindow(_THIS, SDL_Window * window) 814 PND_gl_swapwindow(_THIS, SDL_Window * window)
856 { 815 {
857 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; 816 SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata;
858 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; 817 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
859 SDL_DisplayData *didata = 818 SDL_DisplayData *didata =
860 (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; 819 (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata;
861 820
862 821
863 if (phdata->egl_initialized != SDL_TRUE) { 822 if (phdata->egl_initialized != SDL_TRUE) {
864 SDL_SetError("PND: GLES initialization failed, no OpenGL ES support"); 823 SDL_SetError("PND: GLES initialization failed, no OpenGL ES support");
865 return; 824 return;