comparison src/video/SDL_renderer_gles.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 1e2e19d51265
children 6512cba48440
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
330 static int 330 static int
331 GLES_ActivateRenderer(SDL_Renderer * renderer) 331 GLES_ActivateRenderer(SDL_Renderer * renderer)
332 { 332 {
333 333
334 GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; 334 GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
335 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 335 SDL_Window *window = renderer->window;
336 336
337 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { 337 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
338 return -1; 338 return -1;
339 } 339 }
340 if (data->updateSize) { 340 if (data->updateSize) {
870 break; 870 break;
871 } 871 }
872 872
873 if (data->GL_OES_draw_texture_supported && data->useDrawTexture) { 873 if (data->GL_OES_draw_texture_supported && data->useDrawTexture) {
874 /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */ 874 /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */
875 SDL_Window *window = SDL_GetWindowFromID(renderer->window); 875 SDL_Window *window = renderer->window;
876 GLint cropRect[4]; 876 GLint cropRect[4];
877 cropRect[0] = srcrect->x; 877 cropRect[0] = srcrect->x;
878 cropRect[1] = srcrect->y + srcrect->h; 878 cropRect[1] = srcrect->y + srcrect->h;
879 cropRect[2] = srcrect->w; 879 cropRect[2] = srcrect->w;
880 cropRect[3] = -srcrect->h; 880 cropRect[3] = -srcrect->h;