X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffreeglut_window_mswin.c;h=583d5f7e08c6e0e16c5a0e0db8a63ad901cb7ce4;hb=9486b7d6a3bf0d00cc00ab98380e99810250aa84;hp=d53ba76ed9bf5933e1f15682091c847b37296f02;hpb=3eed8855ebe5e559e37503f99a76b009def7a3f7;p=freeglut diff --git a/src/mswin/freeglut_window_mswin.c b/src/mswin/freeglut_window_mswin.c index d53ba76..583d5f7 100644 --- a/src/mswin/freeglut_window_mswin.c +++ b/src/mswin/freeglut_window_mswin.c @@ -26,7 +26,7 @@ */ #include -#include "freeglut_internal_mswin.h" +#include "../Common/freeglut_internal.h" /* The following include file is available from SGI but is not standard: @@ -169,9 +169,9 @@ void fgNewWGLCreateContext( SFG_Window* window ) return; } - wglMakeCurrent( window->Window.Device, window->Window.Context ); + wglMakeCurrent( window->Window.pContext.Device, window->Window.Context ); - if ( !fghIsExtensionSupported( window->Window.Device, "WGL_ARB_create_context" ) ) + if ( !fghIsExtensionSupported( window->Window.pContext.Device, "WGL_ARB_create_context" ) ) { return; } @@ -185,7 +185,7 @@ void fgNewWGLCreateContext( SFG_Window* window ) fgError( "wglCreateContextAttribsARB not found" ); } - context = wglCreateContextAttribsARB( window->Window.Device, 0, attributes ); + context = wglCreateContextAttribsARB( window->Window.pContext.Device, 0, attributes ); if ( context == NULL ) { fghContextCreationError(); @@ -296,7 +296,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, if (checkOnly) current_hDC = CreateDC(TEXT("DISPLAY"), NULL ,NULL ,NULL); else - current_hDC = window->Window.Device; + current_hDC = window->Window.pContext.Device; fghFillPFD( ppfd, current_hDC, layer_type ); pixelformat = ChoosePixelFormat( current_hDC, ppfd ); @@ -313,12 +313,12 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, /* create a dummy window */ ZeroMemory(&wndCls, sizeof(wndCls)); wndCls.lpfnWndProc = DefWindowProc; - wndCls.hInstance = fgDisplay.Instance; + wndCls.hInstance = fgDisplay.pDisplay.Instance; wndCls.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; wndCls.lpszClassName = _T("FREEGLUT_dummy"); RegisterClass( &wndCls ); - hWnd=CreateWindow(_T("FREEGLUT_dummy"), _T(""), WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW , 0,0,0,0, 0, 0, fgDisplay.Instance, 0 ); + hWnd=CreateWindow(_T("FREEGLUT_dummy"), _T(""), WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW , 0,0,0,0, 0, 0, fgDisplay.pDisplay.Instance, 0 ); hDC=GetDC(hWnd); SetPixelFormat( hDC, pixelformat, ppfd ); @@ -350,7 +350,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, wglDeleteContext(rc); ReleaseDC(hWnd, hDC); DestroyWindow(hWnd); - UnregisterClass(_T("FREEGLUT_dummy"), fgDisplay.Instance); + UnregisterClass(_T("FREEGLUT_dummy"), fgDisplay.pDisplay.Instance); } success = ( pixelformat != 0 ) && ( checkOnly || SetPixelFormat( current_hDC, pixelformat, ppfd ) ); @@ -370,13 +370,13 @@ void fgPlatformSetWindow ( SFG_Window *window ) { if( fgStructure.CurrentWindow ) ReleaseDC( fgStructure.CurrentWindow->Window.Handle, - fgStructure.CurrentWindow->Window.Device ); + fgStructure.CurrentWindow->Window.pContext.Device ); if ( window ) { - window->Window.Device = GetDC( window->Window.Handle ); + window->Window.pContext.Device = GetDC( window->Window.Handle ); wglMakeCurrent( - window->Window.Device, + window->Window.pContext.Device, window->Window.Context ); } @@ -571,7 +571,7 @@ static BOOL CALLBACK m_proc(HMONITOR mon, /* * this function returns the origin of the screen identified by - * fgDisplay.DisplayName, and 0 otherwise. + * fgDisplay.pDisplay.DisplayName, and 0 otherwise. * This is used in fgOpenWindow to open the gamemode window on the screen * identified by the -display command line argument. The function should * not be called otherwise. @@ -582,12 +582,12 @@ static void get_display_origin(int *xp,int *yp) *xp = 0; *yp = 0; - if( fgDisplay.DisplayName ) + if( fgDisplay.pDisplay.DisplayName ) { m_proc_t st; st.x=xp; st.y=yp; - st.name=fgDisplay.DisplayName; + st.name=fgDisplay.pDisplay.DisplayName; EnumDisplayMonitors(0,0,m_proc,(LPARAM)&st); } } @@ -599,7 +599,7 @@ static void get_display_origin(int *xp,int *yp) *xp = 0; *yp = 0; - if( fgDisplay.DisplayName ) + if( fgDisplay.pDisplay.DisplayName ) { fgWarning( "for working -display support FreeGLUT must be compiled with WINVER >= 0x0500"); } @@ -624,7 +624,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, ATOM atom; /* Grab the window class we have registered on glutInit(): */ - atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc ); + atom = GetClassInfo( fgDisplay.pDisplay.Instance, _T("FREEGLUT"), &wc ); FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Info Not Found", "fgOpenWindow" ); @@ -748,7 +748,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, 0,0, 240,320, NULL, NULL, - fgDisplay.Instance, + fgDisplay.pDisplay.Instance, (LPVOID) window ); @@ -770,7 +770,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, x, y, w, h, (HWND) window->Parent == NULL ? NULL : window->Parent->Window.Handle, (HMENU) NULL, - fgDisplay.Instance, + fgDisplay.pDisplay.Instance, (LPVOID) window ); #endif /* defined(_WIN32_WCE) */