Mercurial > sdl-ios-xcode
diff src/video/SDL_renderer_gl.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 | 8b4c0320638e |
children | f7b03b6838cb |
line wrap: on
line diff
--- a/src/video/SDL_renderer_gl.c Thu Jan 21 05:49:41 2010 +0000 +++ b/src/video/SDL_renderer_gl.c Thu Jan 21 06:21:52 2010 +0000 @@ -321,7 +321,7 @@ renderer->DestroyTexture = GL_DestroyTexture; renderer->DestroyRenderer = GL_DestroyRenderer; renderer->info = GL_RenderDriver.info; - renderer->window = window->id; + renderer->window = window; renderer->driverdata = data; renderer->info.flags = @@ -332,12 +332,12 @@ return NULL; } - data->context = SDL_GL_CreateContext(window->id); + data->context = SDL_GL_CreateContext(window); if (!data->context) { GL_DestroyRenderer(renderer); return NULL; } - if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { + if (SDL_GL_MakeCurrent(window, data->context) < 0) { GL_DestroyRenderer(renderer); return NULL; } @@ -442,9 +442,9 @@ GL_ActivateRenderer(SDL_Renderer * renderer) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; - if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { + if (SDL_GL_MakeCurrent(window, data->context) < 0) { return -1; } if (data->updateSize) { @@ -752,7 +752,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; GL_TextureData *data; GLint internalFormat; GLenum format, type; @@ -1407,7 +1407,7 @@ Uint32 pixel_format, void * pixels, int pitch) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; GLint internalFormat; GLenum format, type; Uint8 *src, *dst, *tmp; @@ -1454,7 +1454,7 @@ Uint32 pixel_format, const void * pixels, int pitch) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; GLint internalFormat; GLenum format, type; Uint8 *src, *dst, *tmp;