#if TARGET_HOST_UNIX_X11
-fgGetCursorError( Cursor cursor )
+int fgGetCursorError( Cursor cursor )
{
int ret = 0;
char buf[ 256 ];
* (c) Out-of-range cursor-types generate warnings. Should we abort?
*/
{
- Cursor cursor;
- Pixmap no_cursor; /* Used for GLUT_CURSOR_NONE */
+ Cursor cursor = None;
+ Pixmap no_cursor = None ; /* Used for GLUT_CURSOR_NONE */
int error = 0;
#define MAP_CURSOR(a,b) \
#include "config.h"
#endif
+#define GLX_GLXEXT_PROTOTYPES
+
#include "../include/GL/freeglut.h"
#include "freeglut_internal.h"
*/
for( j=0; j<slices; j++ )
{
- double scl = height / slope;
-
glBegin( GL_TRIANGLES );
glNormal3d( 0.0, 0.0, -1.0 );
glVertex3d( vertices[ (j+0)*2+0 ] * sBase, vertices[ (j+0)*2+1 ] * sBase, 0 );
16, /* GameModeDepth */
72, /* GameModeRefresh */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
- GLUT_EXEC_STATE_INIT /* ExecState */
- NULL, /* ProgramName */
+ GLUT_EXEC_STATE_INIT, /* ExecState */
+ NULL /* ProgramName */
};
fgDestroyStructure( );
- while( timer = ( SFG_Timer * )fgState.Timers.First )
+ while( (timer = ( SFG_Timer * )fgState.Timers.First) )
{
fgListRemove ( &fgState.Timers, &timer->Node );
free( timer );
* Everything inside the following #ifndef is copied from the X sources.
*/
-#ifndef TARGET_HOST_UNIX_X11
+#if TARGET_HOST_WIN32
/*
}
static int XParseGeometry (
- _Xconst char *string,
+ const char *string,
int *x,
int *y,
unsigned int *width, /* RETURN */
int i, j, argc = *pargc;
if( fgState.Initialised )
- fgError( "illegal glutInit() reinitialization attemp" );
+ fgError( "illegal glutInit() reinitialization attempt" );
if (pargc && *pargc && argv && *argv && **argv)
{
#include <assert.h>
#include <stdarg.h>
#if TARGET_HOST_UNIX_X11
+#include <unistd.h>
#include <sys/time.h>
#endif
fgState.Time.Value = timeGetTime( );
#endif
fgState.Time.Set = GL_TRUE;
+
+ return 0;
}
}
/*
* Indicates whether there are any outstanding timers.
*/
+#if 0 /* Not used */
static int fgHaveTimers( void )
{
return !!fgState.Timers.First;
}
+#endif
/*
* Returns the number of GLUT ticks (milliseconds) till the next timer event.
*/
used = TRUE;
}
- if( used == FALSE )
+ if( ! used )
wglDeleteContext( window->Window.Context );
}
if( menuEntry->SubMenu && menuEntry->IsActive )
{
/*
- * OK, have the sub-menu checked, too. If it returns TRUE, it
+ * OK, have the sub-menu checked, too. If it returns GL_TRUE, it
* will mean that it caught the mouse cursor and we do not need
* to regenerate the activity list, and so our parents do...
*/
*/
int FGAPIENTRY glutGet( GLenum eWhat )
{
+#if TARGET_HOST_WIN32
int returnValue ;
GLboolean boolValue ;
+#endif
switch (eWhat)
{
window->ID = ++fgStructure.WindowID;
fgListInit( &window->Children );
- if( parent != NULL )
+ if( parent )
{
fgListAppend( &parent->Children, &window->Node );
window->Parent = parent;
assert( window );
freeglut_assert_ready;
- while( subWindow = ( SFG_Window * )window->Children.First )
+ while( (subWindow = ( SFG_Window * )window->Children.First) )
fgDestroyWindow( subWindow, needToClose );
/*
for ( menu_index = 0; menu_index < 3; menu_index ++ )
{
- if ( window->Menu[menu_index] != NULL )
+ if ( window->Menu[menu_index] )
window->Menu[menu_index]->ParentWindow = NULL ;
}
* Now we are pretty sure the menu is not used anywhere
* and that we can remove all of its entries
*/
- while( entry = ( SFG_MenuEntry * )menu->Entries.First )
+ while( (entry = ( SFG_MenuEntry * )menu->Entries.First) )
{
fgListRemove( &menu->Entries, &entry->Node );
/*
* Make sure all windows and menus have been deallocated
*/
- while( menu = ( SFG_Menu * )fgStructure.Menus.First )
+ while( (menu = ( SFG_Menu * )fgStructure.Menus.First) )
fgDestroyMenu( menu );
- while( window = ( SFG_Window * )fgStructure.Windows.First )
+ while( (window = ( SFG_Window * )fgStructure.Windows.First) )
fgDestroyWindow( window, GL_TRUE );
}
{
SFG_Node *ln;
- if ( (ln = (SFG_Node *)list->Last) != NULL )
+ if ( (ln = (SFG_Node *)list->Last) )
{
ln->Next = node;
node->Prev = ln;
{
SFG_Node *ln;
- if( ln = (SFG_Node *)node->Next )
+ if( (ln = (SFG_Node *)node->Next) )
ln->Prev = node->Prev;
- if( ln = (SFG_Node *)node->Prev )
+ if( (ln = (SFG_Node *)node->Prev) )
ln->Next = node->Next;
- if( ( ln = (SFG_Node *)list->First ) == node )
+ if( (ln = (SFG_Node *)list->First) == node )
list->First = node->Next;
- if( ( ln = (SFG_Node *)list->Last ) == node )
+ if( (ln = (SFG_Node *)list->Last) == node )
list->Last = node->Prev;
}