comparison src/video/directfb/SDL_DirectFB_render.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 58c1b9ec7074
children f7b03b6838cb
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
278 278
279 SDL_Renderer * 279 SDL_Renderer *
280 DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) 280 DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
281 { 281 {
282 SDL_DFB_WINDOWDATA(window); 282 SDL_DFB_WINDOWDATA(window);
283 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 283 SDL_VideoDisplay *display = window->display;
284 SDL_Renderer *renderer = NULL; 284 SDL_Renderer *renderer = NULL;
285 DirectFB_RenderData *data = NULL; 285 DirectFB_RenderData *data = NULL;
286 DFBResult ret; 286 DFBResult ret;
287 DFBSurfaceCapabilities scaps; 287 DFBSurfaceCapabilities scaps;
288 char *p; 288 char *p;
311 renderer->RenderCopy = DirectFB_RenderCopy; 311 renderer->RenderCopy = DirectFB_RenderCopy;
312 renderer->RenderPresent = DirectFB_RenderPresent; 312 renderer->RenderPresent = DirectFB_RenderPresent;
313 renderer->DestroyTexture = DirectFB_DestroyTexture; 313 renderer->DestroyTexture = DirectFB_DestroyTexture;
314 renderer->DestroyRenderer = DirectFB_DestroyRenderer; 314 renderer->DestroyRenderer = DirectFB_DestroyRenderer;
315 renderer->info = DirectFB_RenderDriver.info; 315 renderer->info = DirectFB_RenderDriver.info;
316 renderer->window = window->id; /* SDL window id */ 316 renderer->window = window; /* SDL window */
317 renderer->driverdata = data; 317 renderer->driverdata = data;
318 318
319 renderer->info.flags = 319 renderer->info.flags =
320 SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD; 320 SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD;
321 321
444 static int 444 static int
445 DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) 445 DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture)
446 { 446 {
447 SDL_DFB_RENDERERDATA(renderer); 447 SDL_DFB_RENDERERDATA(renderer);
448 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 448 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
449 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 449 SDL_VideoDisplay *display = window->display;
450 SDL_DFB_DEVICEDATA(display->device); 450 SDL_DFB_DEVICEDATA(display->device);
451 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 451 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
452 DirectFB_TextureData *data = texture->driverdata; 452 DirectFB_TextureData *data = texture->driverdata;
453 DFBDisplayLayerConfig layconf; 453 DFBDisplayLayerConfig layconf;
454 int ret; 454 int ret;
500 500
501 static int 501 static int
502 DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) 502 DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
503 { 503 {
504 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 504 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
505 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 505 SDL_VideoDisplay *display = window->display;
506 SDL_DFB_DEVICEDATA(display->device); 506 SDL_DFB_DEVICEDATA(display->device);
507 DirectFB_TextureData *data; 507 DirectFB_TextureData *data;
508 DFBResult ret; 508 DFBResult ret;
509 DFBSurfaceDescription dsc; 509 DFBSurfaceDescription dsc;
510 DFBSurfacePixelFormat pixelformat; 510 DFBSurfacePixelFormat pixelformat;