comparison src/video/ps3/SDL_ps3render.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 f638ded38b8a
children f7b03b6838cb
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
131 131
132 SDL_Renderer * 132 SDL_Renderer *
133 SDL_PS3_CreateRenderer(SDL_Window * window, Uint32 flags) 133 SDL_PS3_CreateRenderer(SDL_Window * window, Uint32 flags)
134 { 134 {
135 deprintf(1, "+SDL_PS3_CreateRenderer()\n"); 135 deprintf(1, "+SDL_PS3_CreateRenderer()\n");
136 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 136 SDL_VideoDisplay *display = window->display;
137 SDL_DisplayMode *displayMode = &display->current_mode; 137 SDL_DisplayMode *displayMode = &display->current_mode;
138 SDL_VideoData *devdata = display->device->driverdata; 138 SDL_VideoData *devdata = display->device->driverdata;
139 SDL_Renderer *renderer; 139 SDL_Renderer *renderer;
140 SDL_PS3_RenderData *data; 140 SDL_PS3_RenderData *data;
141 struct ps3fb_ioctl_res res; 141 struct ps3fb_ioctl_res res;
177 renderer->RenderCopy = SDL_PS3_RenderCopy; 177 renderer->RenderCopy = SDL_PS3_RenderCopy;
178 renderer->RenderPresent = SDL_PS3_RenderPresent; 178 renderer->RenderPresent = SDL_PS3_RenderPresent;
179 renderer->DestroyRenderer = SDL_PS3_DestroyRenderer; 179 renderer->DestroyRenderer = SDL_PS3_DestroyRenderer;
180 renderer->info.name = SDL_PS3_RenderDriver.info.name; 180 renderer->info.name = SDL_PS3_RenderDriver.info.name;
181 renderer->info.flags = 0; 181 renderer->info.flags = 0;
182 renderer->window = window->id; 182 renderer->window = window;
183 renderer->driverdata = data; 183 renderer->driverdata = data;
184 184
185 deprintf(1, "window->w = %u\n", window->w); 185 deprintf(1, "window->w = %u\n", window->w);
186 deprintf(1, "window->h = %u\n", window->h); 186 deprintf(1, "window->h = %u\n", window->h);
187 187
516 { 516 {
517 deprintf(1, "+SDL_PS3_RenderCopy()\n"); 517 deprintf(1, "+SDL_PS3_RenderCopy()\n");
518 SDL_PS3_RenderData *data = 518 SDL_PS3_RenderData *data =
519 (SDL_PS3_RenderData *) renderer->driverdata; 519 (SDL_PS3_RenderData *) renderer->driverdata;
520 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 520 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
521 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 521 SDL_VideoDisplay *display = window->display;
522 PS3_TextureData *txdata = (PS3_TextureData *) texture->driverdata; 522 PS3_TextureData *txdata = (PS3_TextureData *) texture->driverdata;
523 SDL_VideoData *devdata = display->device->driverdata; 523 SDL_VideoData *devdata = display->device->driverdata;
524 524
525 if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { 525 if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
526 deprintf(1, "Texture is in a FOURCC format\n"); 526 deprintf(1, "Texture is in a FOURCC format\n");
638 { 638 {
639 deprintf(1, "+SDL_PS3_RenderPresent()\n"); 639 deprintf(1, "+SDL_PS3_RenderPresent()\n");
640 SDL_PS3_RenderData *data = 640 SDL_PS3_RenderData *data =
641 (SDL_PS3_RenderData *) renderer->driverdata; 641 (SDL_PS3_RenderData *) renderer->driverdata;
642 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 642 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
643 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 643 SDL_VideoDisplay *display = window->display;
644 SDL_VideoData *devdata = display->device->driverdata; 644 SDL_VideoData *devdata = display->device->driverdata;
645 645
646 /* Send the data to the screen */ 646 /* Send the data to the screen */
647 /* Get screeninfo */ 647 /* Get screeninfo */
648 struct fb_fix_screeninfo fb_finfo; 648 struct fb_fix_screeninfo fb_finfo;