Moving the platform-specific FBConfig and device context variables into platform...
[freeglut] / src / mswin / freeglut_main_mswin.c
index b4d1bc9..b04e9e0 100644 (file)
@@ -329,7 +329,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                                        "fgPlatformWindowProc" );\r
 \r
         window->Window.Handle = hWnd;\r
-        window->Window.Device = GetDC( hWnd );\r
+        window->Window.pContext.Device = GetDC( hWnd );\r
         if( window->IsMenu )\r
         {\r
             unsigned int current_DisplayMode = fgState.DisplayMode;\r
@@ -340,7 +340,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             fgState.DisplayMode = current_DisplayMode;\r
 \r
             if( fgStructure.MenuContext )\r
-                wglMakeCurrent( window->Window.Device,\r
+                wglMakeCurrent( window->Window.pContext.Device,\r
                                 fgStructure.MenuContext->MContext\r
                 );\r
             else\r
@@ -348,11 +348,11 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
                 fgStructure.MenuContext =\r
                     (SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) );\r
                 fgStructure.MenuContext->MContext =\r
-                    wglCreateContext( window->Window.Device );\r
+                    wglCreateContext( window->Window.pContext.Device );\r
             }\r
 \r
             /* window->Window.Context = wglGetCurrentContext ();   */\r
-            window->Window.Context = wglCreateContext( window->Window.Device );\r
+            window->Window.Context = wglCreateContext( window->Window.pContext.Device );\r
         }\r
         else\r
         {\r
@@ -362,13 +362,13 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
 \r
             if( ! fgState.UseCurrentContext )\r
                 window->Window.Context =\r
-                    wglCreateContext( window->Window.Device );\r
+                    wglCreateContext( window->Window.pContext.Device );\r
             else\r
             {\r
                 window->Window.Context = wglGetCurrentContext( );\r
                 if( ! window->Window.Context )\r
                     window->Window.Context =\r
-                        wglCreateContext( window->Window.Device );\r
+                        wglCreateContext( window->Window.pContext.Device );\r
             }\r
 \r
 #if !defined(_WIN32_WCE)\r
@@ -391,7 +391,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
             fgSetWindow( current_window );\r
         }\r
 \r
-        ReleaseDC( window->Window.Handle, window->Window.Device );\r
+        ReleaseDC( window->Window.Handle, window->Window.pContext.Device );\r
 \r
 #if defined(_WIN32_WCE)\r
         /* Take over button handling */\r