projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed acconfig.h, it is deprecated and we don't need it.
[freeglut]
/
src
/
freeglut_init.c
diff --git
a/src/freeglut_init.c
b/src/freeglut_init.c
index
5c92464
..
7688714
100644
(file)
--- a/
src/freeglut_init.c
+++ b/
src/freeglut_init.c
@@
-183,7
+183,7
@@
static void fghInitialize( const char* displayName )
/* Register the window class */
atom = RegisterClass( &wc );
/* Register the window class */
atom = RegisterClass( &wc );
- assert( atom );
+ FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" );
}
/* The screen dimensions can be obtained via GetSystemMetrics() calls */
}
/* The screen dimensions can be obtained via GetSystemMetrics() calls */
@@
-219,8
+219,6
@@
void fgDeinitialize( void )
return;
}
return;
}
- /* fgState.Initialised = GL_FALSE; */
-
/* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext )
{
/* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext )
{
@@
-230,13
+228,13
@@
void fgDeinitialize( void )
fgDestroyStructure( );
fgDestroyStructure( );
- while( timer = fgState.Timers.First )
+ while( ( timer = fgState.Timers.First) )
{
fgListRemove( &fgState.Timers, &timer->Node );
free( timer );
}
{
fgListRemove( &fgState.Timers, &timer->Node );
free( timer );
}
- while( timer = fgState.FreeTimers.First )
+ while( ( timer = fgState.FreeTimers.First) )
{
fgListRemove( &fgState.FreeTimers, &timer->Node );
free( timer );
{
fgListRemove( &fgState.FreeTimers, &timer->Node );
free( timer );
@@
-311,6
+309,8
@@
void fgDeinitialize( void )
XCloseDisplay( fgDisplay.Display );
#endif
XCloseDisplay( fgDisplay.Display );
#endif
+
+ fgState.Initialised = GL_FALSE;
}
/*
}
/*
@@
-594,11
+594,8
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
}
}
}
}
- /*
- * Compact {argv}.
- */
- j = 1;
- for( i = 1; i < *pargc; i++, j++ )
+ /* Compact {argv}. */
+ for( i = j = 1; i < *pargc; i++, j++ )
{
/* Guaranteed to end because there are "*pargc" arguments left */
while ( argv[ j ] == NULL )
{
/* Guaranteed to end because there are "*pargc" arguments left */
while ( argv[ j ] == NULL )
@@
-623,9
+620,13
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
if (geometry )
{
if (geometry )
{
+ unsigned int parsedWidth, parsedHeight;
int mask = XParseGeometry( geometry,
&fgState.Position.X, &fgState.Position.Y,
int mask = XParseGeometry( geometry,
&fgState.Position.X, &fgState.Position.Y,
- &fgState.Size.X, &fgState.Size.Y );
+ &parsedWidth, &parsedHeight );
+ /* TODO: Check for overflow? */
+ fgState.Size.X = parsedWidth;
+ fgState.Size.Y = parsedHeight;
if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
fgState.Size.Use = GL_TRUE;
if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
fgState.Size.Use = GL_TRUE;