comparison src/video/qnxgf/SDL_gf_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 4b594623401b
children f7b03b6838cb
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
108 }; 108 };
109 109
110 static SDL_Renderer * 110 static SDL_Renderer *
111 gf_createrenderer(SDL_Window * window, Uint32 flags) 111 gf_createrenderer(SDL_Window * window, Uint32 flags)
112 { 112 {
113 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 113 SDL_VideoDisplay *display = window->display;
114 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata; 114 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
115 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; 115 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
116 SDL_Renderer *renderer = NULL; 116 SDL_Renderer *renderer = NULL;
117 SDL_RenderData *rdata = NULL; 117 SDL_RenderData *rdata = NULL;
118 uint32_t it; 118 uint32_t it;
160 renderer->RenderCopy = gf_rendercopy; 160 renderer->RenderCopy = gf_rendercopy;
161 renderer->RenderPresent = gf_renderpresent; 161 renderer->RenderPresent = gf_renderpresent;
162 renderer->DestroyTexture = gf_destroytexture; 162 renderer->DestroyTexture = gf_destroytexture;
163 renderer->DestroyRenderer = gf_destroyrenderer; 163 renderer->DestroyRenderer = gf_destroyrenderer;
164 renderer->info = gf_renderdriver.info; 164 renderer->info = gf_renderdriver.info;
165 renderer->window = window->id; 165 renderer->window = window;
166 renderer->driverdata = rdata; 166 renderer->driverdata = rdata;
167 167
168 /* Set render acceleration flag in case it is accelerated */ 168 /* Set render acceleration flag in case it is accelerated */
169 if ((didata->caps & SDL_GF_ACCELERATED) == SDL_GF_ACCELERATED) { 169 if ((didata->caps & SDL_GF_ACCELERATED) == SDL_GF_ACCELERATED) {
170 renderer->info.flags = SDL_RENDERER_ACCELERATED; 170 renderer->info.flags = SDL_RENDERER_ACCELERATED;
282 282
283 static int 283 static int
284 gf_activaterenderer(SDL_Renderer * renderer) 284 gf_activaterenderer(SDL_Renderer * renderer)
285 { 285 {
286 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata; 286 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
287 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(rdata->window); 287 SDL_VideoDisplay *display = rdata->window->display;
288 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata; 288 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
289 289
290 /* Setup current surface as visible */ 290 /* Setup current surface as visible */
291 // gf_layer_set_surfaces(didata->layer, &rdata->surface[rdata->surface_visible_idx], 1); 291 // gf_layer_set_surfaces(didata->layer, &rdata->surface[rdata->surface_visible_idx], 1);
292 292
299 static int 299 static int
300 gf_createtexture(SDL_Renderer * renderer, SDL_Texture * texture) 300 gf_createtexture(SDL_Renderer * renderer, SDL_Texture * texture)
301 { 301 {
302 SDL_RenderData *renderdata = (SDL_RenderData *) renderer->driverdata; 302 SDL_RenderData *renderdata = (SDL_RenderData *) renderer->driverdata;
303 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 303 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
304 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 304 SDL_VideoDisplay *display = window->display;
305 SDL_TextureData *tdata = NULL; 305 SDL_TextureData *tdata = NULL;
306 306
307 /* Allocate texture driver data */ 307 /* Allocate texture driver data */
308 tdata = (SDL_TextureData *) SDL_calloc(1, sizeof(SDL_TextureData)); 308 tdata = (SDL_TextureData *) SDL_calloc(1, sizeof(SDL_TextureData));
309 if (tdata == NULL) { 309 if (tdata == NULL) {