comparison src/video/directfb/SDL_DirectFB_render.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
299 299
300 SDL_Renderer * 300 SDL_Renderer *
301 DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) 301 DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
302 { 302 {
303 SDL_DFB_WINDOWDATA(window); 303 SDL_DFB_WINDOWDATA(window);
304 SDL_VideoDisplay *display = window->display; 304 SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
305 SDL_Renderer *renderer = NULL; 305 SDL_Renderer *renderer = NULL;
306 DirectFB_RenderData *data = NULL; 306 DirectFB_RenderData *data = NULL;
307 DFBSurfaceCapabilities scaps; 307 DFBSurfaceCapabilities scaps;
308 //char *p; 308 //char *p;
309 309
407 static int 407 static int
408 DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) 408 DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture)
409 { 409 {
410 //SDL_DFB_RENDERERDATA(renderer); 410 //SDL_DFB_RENDERERDATA(renderer);
411 SDL_Window *window = renderer->window; 411 SDL_Window *window = renderer->window;
412 SDL_VideoDisplay *display = window->display; 412 SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
413 SDL_DFB_DEVICEDATA(display->device); 413 SDL_DFB_DEVICEDATA(display->device);
414 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 414 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
415 DirectFB_TextureData *data = texture->driverdata; 415 DirectFB_TextureData *data = texture->driverdata;
416 DFBDisplayLayerConfig layconf; 416 DFBDisplayLayerConfig layconf;
417 DFBResult ret; 417 DFBResult ret;
463 463
464 static int 464 static int
465 DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) 465 DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
466 { 466 {
467 SDL_Window *window = renderer->window; 467 SDL_Window *window = renderer->window;
468 SDL_VideoDisplay *display = window->display; 468 SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
469 SDL_DFB_DEVICEDATA(display->device); 469 SDL_DFB_DEVICEDATA(display->device);
470 DirectFB_TextureData *data; 470 DirectFB_TextureData *data;
471 DFBSurfaceDescription dsc; 471 DFBSurfaceDescription dsc;
472 DFBSurfacePixelFormat pixelformat; 472 DFBSurfacePixelFormat pixelformat;
473 473
1127 1127
1128 static void 1128 static void
1129 DirectFB_DestroyRenderer(SDL_Renderer * renderer) 1129 DirectFB_DestroyRenderer(SDL_Renderer * renderer)
1130 { 1130 {
1131 DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; 1131 DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
1132 SDL_VideoDisplay *display = renderer->window->display; 1132 SDL_VideoDisplay *display = renderer->SDL_GetDisplayForWindow(window);
1133 1133
1134 #if 0 1134 #if 0
1135 if (display->palette) { 1135 if (display->palette) {
1136 SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged, data); 1136 SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged, data);
1137 } 1137 }