diff src/video/win32/SDL_gdirender.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 0f958e527e5e
children f7b03b6838cb
line wrap: on
line diff
--- a/src/video/win32/SDL_gdirender.c	Thu Jan 21 05:49:41 2010 +0000
+++ b/src/video/win32/SDL_gdirender.c	Thu Jan 21 06:21:52 2010 +0000
@@ -207,7 +207,7 @@
     renderer->DestroyTexture = GDI_DestroyTexture;
     renderer->DestroyRenderer = GDI_DestroyRenderer;
     renderer->info = GDI_RenderDriver.info;
-    renderer->window = window->id;
+    renderer->window = window;
     renderer->driverdata = data;
 
     renderer->info.flags = SDL_RENDERER_ACCELERATED;
@@ -274,7 +274,7 @@
 GDI_DisplayModeChanged(SDL_Renderer * renderer)
 {
     GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata;
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+    SDL_Window *window = renderer->window;
     int i, n;
 
     if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) {
@@ -378,8 +378,8 @@
 GDI_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
 {
     GDI_RenderData *renderdata = (GDI_RenderData *) renderer->driverdata;
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
-    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
     GDI_TextureData *data;
 
     data = (GDI_TextureData *) SDL_calloc(1, sizeof(*data));
@@ -699,7 +699,7 @@
 
     if (data->makedirty) {
         /* Get the smallest rectangle that contains everything */
-        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+        SDL_Window *window = renderer->window;
         SDL_Rect rect;
 
         rect.x = 0;
@@ -732,7 +732,7 @@
 
     if (data->makedirty) {
         /* Get the smallest rectangle that contains everything */
-        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+        SDL_Window *window = renderer->window;
         SDL_Rect clip, rect;
 
         clip.x = 0;
@@ -787,7 +787,7 @@
     int i, status = 1;
 
     if (data->makedirty) {
-        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+        SDL_Window *window = renderer->window;
         SDL_Rect clip, rect;
 
         clip.x = 0;
@@ -844,7 +844,7 @@
     int i, status = 1;
 
     if (data->makedirty) {
-        SDL_Window *window = SDL_GetWindowFromID(renderer->window);
+        SDL_Window *window = renderer->window;
         SDL_Rect clip, rect;
 
         clip.x = 0;
@@ -943,8 +943,8 @@
                      Uint32 format, void * pixels, int pitch)
 {
     GDI_RenderData *renderdata = (GDI_RenderData *) renderer->driverdata;
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
-    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
     struct {
         HBITMAP hbm;
         void *pixels;
@@ -984,8 +984,8 @@
                       Uint32 format, const void * pixels, int pitch)
 {
     GDI_RenderData *renderdata = (GDI_RenderData *) renderer->driverdata;
-    SDL_Window *window = SDL_GetWindowFromID(renderer->window);
-    SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
+    SDL_Window *window = renderer->window;
+    SDL_VideoDisplay *display = window->display;
     struct {
         HBITMAP hbm;
         void *pixels;