projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moving the platform-specific window handle and context type definitions into platform...
[freeglut]
/
src
/
mswin
/
freeglut_init_mswin.c
diff --git
a/src/mswin/freeglut_init_mswin.c
b/src/mswin/freeglut_init_mswin.c
index
ff476fd
..
9792632
100644
(file)
--- a/
src/mswin/freeglut_init_mswin.c
+++ b/
src/mswin/freeglut_init_mswin.c
@@
-26,21
+26,26
@@
*/
\r
\r
#include <GL/freeglut.h>
\r
*/
\r
\r
#include <GL/freeglut.h>
\r
-#include "freeglut_internal_mswin.h"
\r
+#include "../Common/freeglut_internal.h"
\r
+
\r
+
\r
+
\r
+extern LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg,
\r
+ WPARAM wParam, LPARAM lParam );
\r
\r
\r
/*
\r
* A call to this function should initialize all the display stuff...
\r
*/
\r
\r
\r
/*
\r
* A call to this function should initialize all the display stuff...
\r
*/
\r
-void fghInitialize( const char* displayName )
\r
+void fgPlatformInitialize( const char* displayName )
\r
{
\r
WNDCLASS wc;
\r
ATOM atom;
\r
\r
/* What we need to do is to initialize the fgDisplay global structure here. */
\r
{
\r
WNDCLASS wc;
\r
ATOM atom;
\r
\r
/* What we need to do is to initialize the fgDisplay global structure here. */
\r
- fgDisplay.Instance = GetModuleHandle( NULL );
\r
- fgDisplay.DisplayName= displayName ? strdup(displayName) : 0 ;
\r
- atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc );
\r
+ fgDisplay.pDisplay.Instance = GetModuleHandle( NULL );
\r
+ fgDisplay.pDisplay.DisplayName= displayName ? strdup(displayName) : 0 ;
\r
+ atom = GetClassInfo( fgDisplay.pDisplay.Instance, _T("FREEGLUT"), &wc );
\r
\r
if( atom == 0 )
\r
{
\r
\r
if( atom == 0 )
\r
{
\r
@@
-54,11
+59,11
@@
void fghInitialize( const char* displayName )
* XXX Old code had "| CS_DBCLCKS" commented out. Plans for the
\r
* XXX future? Dead-end idea?
\r
*/
\r
* XXX Old code had "| CS_DBCLCKS" commented out. Plans for the
\r
* XXX future? Dead-end idea?
\r
*/
\r
- wc.lpfnWndProc = fgWindowProc;
\r
+ wc.lpfnWndProc = fgPlatformWindowProc;
\r
wc.cbClsExtra = 0;
\r
wc.cbWndExtra = 0;
\r
wc.cbClsExtra = 0;
\r
wc.cbWndExtra = 0;
\r
- wc.hInstance = fgDisplay.Instance;
\r
- wc.hIcon = LoadIcon( fgDisplay.Instance, _T("GLUT_ICON") );
\r
+ wc.hInstance = fgDisplay.pDisplay.Instance;
\r
+ wc.hIcon = LoadIcon( fgDisplay.pDisplay.Instance, _T("GLUT_ICON") );
\r
\r
#if defined(_WIN32_WCE)
\r
wc.style = CS_HREDRAW | CS_VREDRAW;
\r
\r
#if defined(_WIN32_WCE)
\r
wc.style = CS_HREDRAW | CS_VREDRAW;
\r
@@
-75,7
+80,7
@@
void fghInitialize( const char* displayName )
\r
/* Register the window class */
\r
atom = RegisterClass( &wc );
\r
\r
/* Register the window class */
\r
atom = RegisterClass( &wc );
\r
- FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" );
\r
+ FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fgPlatformInitialize" );
\r
}
\r
\r
/* The screen dimensions can be obtained via GetSystemMetrics() calls */
\r
}
\r
\r
/* The screen dimensions can be obtained via GetSystemMetrics() calls */
\r
@@
-92,9
+97,9
@@
void fghInitialize( const char* displayName )
ReleaseDC( desktop, context );
\r
}
\r
/* If we have a DisplayName try to use it for metrics */
\r
ReleaseDC( desktop, context );
\r
}
\r
/* If we have a DisplayName try to use it for metrics */
\r
- if( fgDisplay.DisplayName )
\r
+ if( fgDisplay.pDisplay.DisplayName )
\r
{
\r
{
\r
- HDC context = CreateDC(fgDisplay.DisplayName,0,0,0);
\r
+ HDC context = CreateDC(fgDisplay.pDisplay.DisplayName,0,0,0);
\r
if( context )
\r
{
\r
fgDisplay.ScreenWidth = GetDeviceCaps( context, HORZRES );
\r
if( context )
\r
{
\r
fgDisplay.ScreenWidth = GetDeviceCaps( context, HORZRES );
\r
@@
-104,7
+109,7
@@
void fghInitialize( const char* displayName )
DeleteDC(context);
\r
}
\r
else
\r
DeleteDC(context);
\r
}
\r
else
\r
- fgWarning("fghInitialize: "
\r
+ fgWarning("fgPlatformInitialize: "
\r
"CreateDC failed, Screen size info may be incorrect\n"
\r
"This is quite likely caused by a bad '-display' parameter");
\r
\r
"CreateDC failed, Screen size info may be incorrect\n"
\r
"This is quite likely caused by a bad '-display' parameter");
\r
\r
@@
-131,7
+136,7
@@
void fghInitialize( const char* displayName )
/* Platform-Specific Deinitialization Functions: */
\r
extern void fghCloseInputDevices ( void );
\r
\r
/* Platform-Specific Deinitialization Functions: */
\r
extern void fghCloseInputDevices ( void );
\r
\r
-void fghDeinitialiseInputDevices ( void )
\r
+void fgPlatformDeinitialiseInputDevices ( void )
\r
{
\r
#if !defined(_WIN32_WCE)
\r
fghCloseInputDevices ();
\r
{
\r
#if !defined(_WIN32_WCE)
\r
fghCloseInputDevices ();
\r
@@
-140,12
+145,12
@@
void fghDeinitialiseInputDevices ( void )
fgState.InputDevsInitialised = GL_FALSE;
\r
}
\r
\r
fgState.InputDevsInitialised = GL_FALSE;
\r
}
\r
\r
-void fghCloseDisplay ( void )
\r
+void fgPlatformCloseDisplay ( void )
\r
{
\r
{
\r
- if( fgDisplay.DisplayName )
\r
+ if( fgDisplay.pDisplay.DisplayName )
\r
{
\r
{
\r
- free( fgDisplay.DisplayName );
\r
- fgDisplay.DisplayName = NULL;
\r
+ free( fgDisplay.pDisplay.DisplayName );
\r
+ fgDisplay.pDisplay.DisplayName = NULL;
\r
}
\r
\r
/* Reset the timer granularity */
\r
}
\r
\r
/* Reset the timer granularity */
\r