src/video/win32/SDL_win32window.c
changeset 1951 7177581dc9fa
parent 1913 83420da906a5
child 1952 420716272158
--- a/src/video/win32/SDL_win32window.c	Wed Jul 26 06:34:54 2006 +0000
+++ b/src/video/win32/SDL_win32window.c	Thu Jul 27 06:53:23 2006 +0000
@@ -31,8 +31,9 @@
 
 
 static int
-SetupWindowData(SDL_Window * window, HWND hwnd, BOOL created)
+SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
 {
+    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     SDL_WindowData *data;
 
     /* Allocate the window data */
@@ -46,7 +47,7 @@
     data->hdc = GetDC(hwnd);
     data->created = created;
     data->mouse_pressed = SDL_FALSE;
-    data->videodata = (SDL_VideoData *) SDL_GetVideoDevice()->driverdata;
+    data->videodata = videodata;
 
     /* Associate the data with the window */
     if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
@@ -208,7 +209,7 @@
         return -1;
     }
 
-    if (SetupWindowData(window, hwnd, TRUE) < 0) {
+    if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) {
         DestroyWindow(hwnd);
         return -1;
     }
@@ -245,7 +246,7 @@
         SDL_stack_free(title);
     }
 
-    if (SetupWindowData(window, hwnd, FALSE) < 0) {
+    if (SetupWindowData(_this, window, hwnd, SDL_FALSE) < 0) {
         return -1;
     }
     return 0;