X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_init_mswin.c;h=bd20b2768b127e7d3e19397055ff34784f50da23;hb=b1ed93dd348f7b8f3bd2c75474f5d4151d502f1f;hp=40a4c7edcac881f5c3315bbf37b1574c5a5e22a5;hpb=75ee380e8ec27aad5c793bb8d966efd927d82cba;p=freeglut diff --git a/src/mswin/fg_init_mswin.c b/src/mswin/fg_init_mswin.c index 40a4c7e..bd20b27 100644 --- a/src/mswin/fg_init_mswin.c +++ b/src/mswin/fg_init_mswin.c @@ -1,5 +1,5 @@ /* - * freeglut_init_mswin.c + * fg_init_mswin.c * * The Windows-specific mouse cursor related stuff. * @@ -34,6 +34,7 @@ extern LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); extern void fgPlatformInitSystemTime(); +extern void fghCloseInputDevices(void); /* @@ -42,7 +43,7 @@ extern void fgPlatformInitSystemTime(); void fgPlatformInitialize( const char* displayName ) { WNDCLASS wc; - ATOM atom; + BOOL atom; /* What we need to do is to initialize the fgDisplay global structure here. */ fgDisplay.pDisplay.Instance = GetModuleHandle( NULL ); @@ -57,9 +58,6 @@ void fgPlatformInitialize( const char* displayName ) * Each of the windows should have its own device context, and we * want redraw events during Vertical and Horizontal Resizes by * the user. - * - * XXX Old code had "| CS_DBCLCKS" commented out. Plans for the - * XXX future? Dead-end idea? */ wc.lpfnWndProc = fgPlatformWindowProc; wc.cbClsExtra = 0; @@ -104,17 +102,17 @@ void fgPlatformInitialize( const char* displayName ) HDC context = CreateDC(fgDisplay.pDisplay.DisplayName,0,0,0); if( context ) { - fgDisplay.ScreenWidth = GetDeviceCaps( context, HORZRES ); - fgDisplay.ScreenHeight = GetDeviceCaps( context, VERTRES ); - fgDisplay.ScreenWidthMM = GetDeviceCaps( context, HORZSIZE ); - fgDisplay.ScreenHeightMM = GetDeviceCaps( context, VERTSIZE ); - DeleteDC(context); + fgDisplay.ScreenWidth = GetDeviceCaps( context, HORZRES ); + fgDisplay.ScreenHeight = GetDeviceCaps( context, VERTRES ); + fgDisplay.ScreenWidthMM = GetDeviceCaps( context, HORZSIZE ); + fgDisplay.ScreenHeightMM = GetDeviceCaps( context, VERTSIZE ); + DeleteDC(context); } else - fgWarning("fgPlatformInitialize: " - "CreateDC failed, Screen size info may be incorrect\n" + fgWarning("fgPlatformInitialize: " + "CreateDC failed, Screen size info may be incorrect\n" "This is quite likely caused by a bad '-display' parameter"); - + } /* Set the timer granularity to 1 ms */ timeBeginPeriod ( 1 ); @@ -141,12 +139,10 @@ void fgPlatformInitialize( const char* displayName ) /* Platform-Specific Deinitialization Functions: */ -extern void fghCloseInputDevices ( void ); - void fgPlatformDeinitialiseInputDevices ( void ) { #if !defined(_WIN32_WCE) - fghCloseInputDevices (); + fghCloseInputDevices (); #endif /* !defined(_WIN32_WCE) */ fgState.JoysticksInitialised = GL_FALSE; fgState.InputDevsInitialised = GL_FALSE; @@ -166,7 +162,7 @@ void fgPlatformCloseDisplay ( void ) void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext ) { - /* Do nothing -- this is required for X11 */ + /* Do nothing -- this is required for X11 */ } /* -- PLATFORM-SPECIFIC INTERFACE FUNCTION -------------------------------------------------- */