coords.x = x;
coords.y = y;
- /*
- * ClientToScreen() translates {coords} for us.
- */
+ /* ClientToScreen() translates {coords} for us. */
ClientToScreen( fgStructure.Window->Window.Handle, &coords );
SetCursorPos( coords.x, coords.y );
}
* The original freeglut fonts were extracted by a utility written
* by Pawel W. Olszta (see below) and the generated fonts contained
* his copyright exclusively. Steve Baker asserts that Pawel
- * assigned intellectual property writes to Steve Baker. Steve
+ * assigned intellectual property rights to Steve Baker. Steve
* Baker also asserts that fonts cannot be copyrighted. He has
* neither stripped the copyright from the freeglut fonts nor
* formally retitled anything in his name. Since that time, the
);
}
- /*
- * Query the current display settings:
- */
+ /* Query the current display settings: */
fgDisplay.DisplayModeValid =
XF86VidModeGetModeLine(
fgDisplay.Display,
/* DEVMODE devMode; */
- /*
- * Grab the current desktop settings...
- */
+ /* Grab the current desktop settings... */
/* hack to get around my stupid cross-gcc headers */
#define FREEGLUT_ENUM_CURRENT_SETTINGS -1
EnumDisplaySettings( NULL, FREEGLUT_ENUM_CURRENT_SETTINGS,
&fgDisplay.DisplayMode );
- /*
- * Make sure we will be restoring all settings needed
- */
+ /* Make sure we will be restoring all settings needed */
fgDisplay.DisplayMode.dmFields |=
DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
#if TARGET_HOST_UNIX_X11
# ifdef X_XF86VidModeGetAllModeLines
- /*
- * Restore the remembered pointer position:
- */
+ /* Restore the remembered pointer position: */
XWarpPointer(
fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
- /*
- * Restore the previously rememebered desktop display settings
- */
+ /* Restore the previously rememebered desktop display settings */
ChangeDisplaySettings( &fgDisplay.DisplayMode, 0 );
#endif
*/
GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
{
- /*
- * The desired values should be stored in fgState structure...
- */
+ /* The desired values should be stored in fgState structure... */
return ( width == fgState.GameModeSize.X ) &&
( height == fgState.GameModeSize.Y ) &&
( depth == fgState.GameModeDepth ) &&
&displayModes
);
- /*
- * Check every of the modes looking for one that matches our demands
- */
+ /* Check every of the modes looking for one that matches our demands */
for( i = 0; i < displayModesCount; i++ )
{
if( fghCheckDisplayMode( displayModes[ i ]->hdisplay,
{
if( haveToTest )
return GL_TRUE;
- /*
- * OKi, this is the display mode we have been looking for...
- */
+ /* OKi, this is the display mode we have been looking for... */
XF86VidModeSwitchToMode(
fgDisplay.Display,
fgDisplay.Screen,
}
}
- /*
- * Something must have went wrong
- */
+ /* Something must have gone wrong */
return GL_FALSE;
# else
*/
while( EnumDisplaySettings( NULL, displayModes, &devMode ) )
{
- /*
- * Does the enumerated display mode match the user's preferences?
- */
+ /* Does the enumerated display mode match the user's preferences? */
if( fghCheckDisplayMode( devMode.dmPelsWidth, devMode.dmPelsHeight,
devMode.dmBitsPerPel,
devMode.dmDisplayFrequency ) )
/* then try without Display Frequency */
displayModes = 0;
- /*
- * Enumerate the available display modes
- */
+ /* Enumerate the available display modes */
while( EnumDisplaySettings( NULL, displayModes, &devMode ) )
{
/* then try without Display Frequency */
}
}
- /*
- * Did we find a matching display mode?
- */
+ /* Did we find a matching display mode? */
if( mode != 0xffffffff )
{
int retVal = DISP_CHANGE_SUCCESSFUL;
- /*
- * Mark the values we want to modify in the display change call
- */
+ /* Mark the values we want to modify in the display change call */
devMode.dmFields |=
DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
retVal = ChangeDisplaySettings( &devMode, haveToTest ? CDS_TEST : 0 );
- /*
- * I don't know if it's really needed, but looks nice:
- */
+ /* I don't know if it's really needed, but looks nice: */
success = (retVal == DISP_CHANGE_SUCCESSFUL) ||
(retVal == DISP_CHANGE_NOTUPDATED);
string
);
- /*
- * Hopefully it worked, and if not, we still have the default values
- */
+ /* Hopefully it worked, and if not, we still have the default values */
fgState.GameModeSize.X = width;
fgState.GameModeSize.Y = height;
fgState.GameModeDepth = depth;
int x, y;
Window child;
- /*
- * Change to viewport to the window topleft edge:
- */
+ /* Change to viewport to the window topleft edge: */
XF86VidModeSetViewPort( fgDisplay.Display, fgDisplay.Screen, 0, 0 );
/*
#endif
- /*
- * Grab the keyboard, too
- */
+ /* Grab the keyboard, too */
XGrabKeyboard(
fgDisplay.Display,
fgStructure.GameMode->Window.Handle,
fgAddToWindowDestroyList( fgStructure.GameMode );
- fgStructure.GameMode = NULL ;
+ fgStructure.GameMode = NULL;
#if TARGET_HOST_UNIX_X11
# define V(a,b,c) glVertex3d( a size, b size, c size );
# define N(a,b,c) glNormal3d( a, b, c );
- /*
- * PWO: I dared to convert the code to use macros...
- */
+ /* PWO: I dared to convert the code to use macros... */
glBegin( GL_LINE_LOOP ); N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+); glEnd();
glBegin( GL_LINE_LOOP ); N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+); glEnd();
glBegin( GL_LINE_LOOP ); N( 0.0, 0.0, 1.0); V(+,+,+); V(-,+,+); V(-,-,+); V(+,-,+); glEnd();
# define V(a,b,c) glVertex3d( a size, b size, c size );
# define N(a,b,c) glNormal3d( a, b, c );
- /*
- * PWO: Again, I dared to convert the code to use macros...
- */
+ /* PWO: Again, I dared to convert the code to use macros... */
glBegin( GL_QUADS );
N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+);
N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+);
int i, j;
double spsi, cpsi, sphi, cphi ;
- /*
- * Allocate the vertices array
- */
+ /* Allocate the vertices array */
vertex = (double *)calloc( sizeof(double), 3 * nSides * nRings );
normal = (double *)calloc( sizeof(double), 3 * nSides * nRings );
int i, j;
double spsi, cpsi, sphi, cphi ;
- /*
- * Increment the number of sides and rings to allow for one more point than surface
- */
+ /* Increment the number of sides and rings to allow for one more point than surface */
nSides ++ ;
nRings ++ ;
- /*
- * Allocate the vertices array
- */
+ /* Allocate the vertices array */
vertex = (double *)calloc( sizeof(double), 3 * nSides * nRings );
normal = (double *)calloc( sizeof(double), 3 * nSides * nRings );
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
- * where x = 0.61803398875 and z = 1.61803398875.
+ * where x = (-1 + sqrt(5))/2, z = (1 + sqrt(5))/2 or
+ * x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_LINE_LOOP ) ;
glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
/* Magic Numbers: It is possible to create a dodecahedron by attaching two pentagons to each face of
* of a cube. The coordinates of the points are:
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
- * where x = 0.61803398875 and z = 1.61803398875.
+ * where x = (-1 + sqrt(5))/2, z = (1 + sqrt(5))/2 or
+ * x = 0.61803398875 and z = 1.61803398875.
*/
glBegin ( GL_POLYGON ) ;
glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
fgDisplay.Connection = ConnectionNumber( fgDisplay.Display );
- /*
- * Create the window deletion atom
- */
+ /* Create the window deletion atom */
fgDisplay.DeleteWindow = XInternAtom(
fgDisplay.Display,
"WM_DELETE_WINDOW",
WNDCLASS wc;
ATOM atom;
- /*
- * What we need to do is to initialize the fgDisplay global structure here.
- */
+ /* What we need to do is to initialize the fgDisplay global structure here. */
fgDisplay.Instance = GetModuleHandle( NULL );
atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc );
wc.lpszMenuName = NULL;
wc.lpszClassName = _T("FREEGLUT");
- /*
- * Register the window class
- */
+ /* Register the window class */
atom = RegisterClass( &wc );
assert( atom );
}
- /*
- * The screen dimensions can be obtained via GetSystemMetrics() calls
- */
+ /* The screen dimensions can be obtained via GetSystemMetrics() calls */
fgDisplay.ScreenWidth = GetSystemMetrics( SM_CXSCREEN );
fgDisplay.ScreenHeight = GetSystemMetrics( SM_CYSCREEN );
/* fgState.Initialised = GL_FALSE; */
- /*
- * If there was a menu created, destroy the rendering context
- */
+ /* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext )
{
free( fgStructure.MenuContext );
*/
void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode )
{
- /*
- * We will make use of this value when creating a new OpenGL context...
- */
+ /* We will make use of this value when creating a new OpenGL context... */
fgState.DisplayMode = displayMode;
}
token = strtok ( buffer, " \t" );
while ( token )
{
- /*
- * Process this token
- */
+ /* Process this token */
int i ;
for ( i = 0; i < NUM_TOKENS; i++ )
{
free ( buffer );
- /*
- * We will make use of this value when creating a new OpenGL context...
- */
+ /* We will make use of this value when creating a new OpenGL context... */
fgState.DisplayMode = glut_state_flag;
}
#define VERSION_MINOR 2
#define VERSION_PATCH 0
-/*
- * Freeglut is meant to be available under all Unix/X11 and Win32 platforms.
- */
+/* Freeglut is meant to be available under all Unix/X11 and Win32 platforms. */
#if defined(_WIN32_WCE)
# define TARGET_HOST_UNIX_X11 0
# define TARGET_HOST_WIN32 0
#define FREEGLUT_MAX_MENUS 3
-/*
- * Somehow all Win32 include headers depend on this one:
- */
+/* Somehow all Win32 include headers depend on this one: */
#if TARGET_HOST_WIN32
#include <windows.h>
#include <windowsx.h>
#define strdup _strdup
#endif
-/*
- * Those files should be available on every platform.
- */
+/* Those files should be available on every platform. */
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <sys/time.h>
#endif
-/*
- * The system-dependant include files should go here:
- */
+/* The system-dependant include files should go here: */
#if TARGET_HOST_UNIX_X11
#include <GL/glx.h>
#include <X11/Xlib.h>
#endif
#endif
-/*
- * Microsoft VisualC++ 5.0's <math.h> does not define the PI
- */
+/* Microsoft VisualC++ 5.0's <math.h> does not define the PI */
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
-/*
- * Freeglut callbacks type definitions
- */
+/* Freeglut callbacks type definitions */
typedef void (* FGCBDisplay )( void );
typedef void (* FGCBReshape )( int, int );
typedef void (* FGCBVisibility )( int );
typedef void (* FGCBTabletButton )( int, int, int, int );
typedef void (* FGCBDestroy )( void );
-/*
- * The global callbacks type definitions
- */
+/* The global callbacks type definitions */
typedef void (* FGCBIdle )( void );
typedef void (* FGCBTimer )( int );
typedef void (* FGCBMenuState )( int );
typedef void (* FGCBMenuStatus )( int, int, int );
-/*
- * The callback used when creating/using menus
- */
+/* The callback used when creating/using menus */
typedef void (* FGCBMenu )( int );
-/*
- * A list structure
- */
+/* A list structure */
typedef struct tagSFG_List SFG_List;
struct tagSFG_List
{
void *Last;
};
-/*
- * A list node structure
- */
+/* A list node structure */
typedef struct tagSFG_Node SFG_Node;
struct tagSFG_Node
{
void *Prev;
};
-/*
- * A helper structure holding two ints and a boolean
- */
+/* A helper structure holding two ints and a boolean */
typedef struct tagSFG_XYUse SFG_XYUse;
struct tagSFG_XYUse
{
GLboolean Use; /* ...and a single boolean. */
};
-/*
- * A helper structure holding a timeval and a boolean
- */
+/* A helper structure holding a timeval and a boolean */
typedef struct tagSFG_Time SFG_Time;
struct tagSFG_Time
{
-#if TARGET_HOST_WIN32 || TARGET_HOST_WINCE
+#ifdef WIN32
DWORD Value;
#else
struct timeval Value;
GLUT_EXEC_STATE_STOP
} fgExecutionState ;
-/*
- * This structure holds different freeglut settings
- */
+/* This structure holds different freeglut settings */
typedef struct tagSFG_State SFG_State;
struct tagSFG_State
{
char *ProgramName; /* Name of the invoking program */
};
-/*
- * The structure used by display initialization in freeglut_init.c
- */
+/* The structure used by display initialization in freeglut_init.c */
typedef struct tagSFG_Display SFG_Display;
struct tagSFG_Display
{
};
-/*
- * The user can create any number of timer hooks
- */
+/* The user can create any number of timer hooks */
typedef struct tagSFG_Timer SFG_Timer;
struct tagSFG_Timer
{
int DoubleBuffered; /* Treat the window as double-buffered */
};
-/*
- * Window's state description. This structure should be kept portable.
- */
+/* Window's state description. This structure should be kept portable. */
typedef struct tagSFG_WindowState SFG_WindowState;
struct tagSFG_WindowState
{
};
-/*
- * This structure holds the OpenGL rendering context for all the menu windows
- */
+/* This structure holds the OpenGL rendering context for all the menu windows */
typedef struct tagSFG_MenuContext SFG_MenuContext;
struct tagSFG_MenuContext
{
SFG_WindowContextType Context; /* The menu window's WGL context */
};
-/*
- * This structure describes a menu
- */
+/* This structure describes a menu */
typedef struct tagSFG_Window SFG_Window;
typedef struct tagSFG_MenuEntry SFG_MenuEntry;
typedef struct tagSFG_Menu SFG_Menu;
SFG_Window *ParentWindow; /* Window in which the menu is defined */
};
-/*
- * This is a menu entry
- */
+/* This is a menu entry */
struct tagSFG_MenuEntry
{
SFG_Node Node;
};
-/*
- * A linked list structure of windows
- */
+/* A linked list structure of windows */
typedef struct tagSFG_WindowList SFG_WindowList ;
struct tagSFG_WindowList
{
SFG_Window *window ;
};
-/*
- * This holds information about all the windows, menus etc.
- */
+/* This holds information about all the windows, menus etc. */
typedef struct tagSFG_Structure SFG_Structure;
struct tagSFG_Structure
{
};
typedef void (* FGCBenumerator )( SFG_Window *, SFG_Enumerator * );
-/*
- * The bitmap font structure
- */
+/* The bitmap font structure */
typedef struct tagSFG_Font SFG_Font;
struct tagSFG_Font
{
float xorig, yorig; /* Relative origin of the character */
};
-/*
- * The stroke font structures
- */
+/* The stroke font structures */
typedef struct tagSFG_StrokeVertex SFG_StrokeVertex;
struct tagSFG_StrokeVertex
/* -- GLOBAL VARIABLES EXPORTS --------------------------------------------- */
-/*
- * Freeglut display related stuff (initialized once per session)
- */
+/* Freeglut display related stuff (initialized once per session) */
extern SFG_Display fgDisplay;
-/*
- * Freeglut internal structure
- */
+/* Freeglut internal structure */
extern SFG_Structure fgStructure;
-/*
- * The current freeglut settings
- */
+/* The current freeglut settings */
extern SFG_State fgState;
void fgCreateStructure( void );
void fgDestroyStructure( void );
-/*
- * A helper function to check if a display mode is possible to use
- */
+/* A helper function to check if a display mode is possible to use */
#if TARGET_HOST_UNIX_X11
XVisualInfo* fgChooseVisual( void );
#endif
-/*
- * The window procedure for Win32 events handling
- */
+/* The window procedure for Win32 events handling */
#if TARGET_HOST_WIN32 || TARGET_HOST_WINCE
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam );
void fgDestroyWindow( SFG_Window* window );
void fgClearCallBacks( SFG_Window *window );
-/*
- * Menu creation and destruction. Defined in freeglut_structure.c
- */
+/* Menu creation and destruction. Defined in freeglut_structure.c */
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback );
void fgDestroyMenu( SFG_Menu* menu );
-/*
- * Joystick device management functions, defined in freeglut_joystick.c
- */
+/* Joystick device management functions, defined in freeglut_joystick.c */
void fgJoystickInit( int ident );
void fgJoystickClose( void );
void fgJoystickPollWindow( SFG_Window* window );
*/
void fgDisplayCursor( void );
-/*
- * Elapsed time as per glutGet(GLUT_ELAPSED_TIME).
- */
+/* Elapsed time as per glutGet(GLUT_ELAPSED_TIME). */
long fgElapsedTime( void );
-/*
- * List functions
- */
+/* List functions */
void fgListInit(SFG_List *list);
void fgListAppend(SFG_List *list, SFG_Node *node);
void fgListRemove(SFG_List *list, SFG_Node *node);
int fgListLength(SFG_List *list);
void fgListInsert(SFG_List *list, SFG_Node *next, SFG_Node *node);
-/*
- * Error Messages functions
- */
+/* Error Message functions */
void fgError( const char *fmt, ... );
void fgWarning( const char *fmt, ... );
#if TARGET_HOST_UNIX_X11
# define _JS_MAX_AXES 16
# if defined(__FreeBSD__) || defined(__NetBSD__)
-/*
- * XXX The below hack is done until freeglut's autoconf is updated.
- */
+/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USB_JS 1
# include <sys/ioctl.h>
#define JS_TRUE 1
#define JS_FALSE 0
-/*
- * BSD defines from "jsBSD.cxx" around lines 42-270
- */
+/* BSD defines from "jsBSD.cxx" around lines 42-270 */
#if defined(__NetBSD__) || defined(__FreeBSD__)
# ifdef HAVE_USB_JS
# if defined(__NetBSD__)
-/*
- * XXX The below hack is done until freeglut's autoconf is updated.
- */
+/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USBHID_H 1
# ifdef HAVE_USBHID_H
# include <usbhid.h>
# if __FreeBSD_version < 500000
# include <libusbhid.h>
# else
-/*
- * XXX The below hack is done until freeglut's autoconf is updated.
- */
+/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USBHID_H 1
# include <usbhid.h>
# endif
joy->name[ 0 ] = '\0';
#if TARGET_HOST_MACINTOSH
- /*
- * XXX FIXME: get joystick name in Mac
- */
+ /* XXX FIXME: get joystick name in Mac */
err = ISpStartup( );
joy->max[ 0 ] = ( float )joy->jsCaps.wXmax;
}
- /*
- * Guess all the rest judging on the axes extremals
- */
+ /* Guess all the rest judging on the axes extremals */
for( i = 0; i < joy->num_axes; i++ )
{
joy->center [ i ] = ( joy->max[ i ] + joy->min[ i ] ) * 0.5f;
#endif
#if defined( __linux__ )
- /*
- * Default for older Linux systems.
- */
+ /* Default for older Linux systems. */
joy->num_axes = 2;
joy->num_buttons = 32;
if( joy->error )
return;
- /*
- * Set the correct number of axes for the linux driver
- */
+ /* Set the correct number of axes for the linux driver */
# ifdef JS_NEW
/* Melchior Franz's fixes for big-endian Linuxes since writing
* to the upper byte of an uninitialized word doesn't work.
/*
* PWO: These jsJoystick class methods have not been implemented.
- * We might consider adding such functions to freeglut-2.0.
*/
int glutJoystickGetNumAxes( int ident )
{
* it is possible to have our socket drained but still have
* unprocessed events. (Or, this may just be normal with
* X, anyway?) We do non-trivial processing of X events
- * after tham in event-reading loop, in any case, so we
+ * after the event-reading loop, in any case, so we
* need to allow that we may have an empty socket but non-
* empty event queue.
*/
SFG_Window* window;
XEvent event;
- /*
- * This code was repeated constantly, so here it goes into a definition:
- */
+ /* This code was repeated constantly, so here it goes into a definition: */
#define GETWINDOW(a) \
window = fgWindowByHandle( event.a.window ); \
if( window == NULL ) \
switch( event.type )
{
case ClientMessage:
- /*
- * Destroy the window when the WM_DELETE_WINDOW message arrives
- */
+ /* Destroy the window when the WM_DELETE_WINDOW message arrives */
if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.DeleteWindow )
{
GETWINDOW( xclient );
break;
}
- /*
- * No active menu, let's check whether we need to activate one.
- */
+ /* No active menu, let's check whether we need to activate one. */
if( ( 0 <= button ) &&
( FREEGLUT_MAX_MENUS > button ) &&
( window->Menu[ button ] ) &&
pressed )
{
- /*
- * XXX Posting a requisite Redisplay seems bogus.
- */
+ /* XXX Posting a requisite Redisplay seems bogus. */
window->State.Redisplay = GL_TRUE;
fgSetWindow( window );
fgActivateMenu( window, button );
);
}
- /*
- * Trash the modifiers state
- */
+ /* Trash the modifiers state */
fgState.Modifiers = 0xffffffff;
}
break;
switch( uMsg )
{
case WM_CREATE:
- /*
- * The window structure is passed as the creation structure paramter...
- */
+ /* The window structure is passed as the creation structure paramter... */
window = (SFG_Window *) (((LPCREATESTRUCT) lParam)->lpCreateParams);
assert( window != NULL );
break;
#if 0
case WM_SETFOCUS:
- /* printf("WM_SETFOCUS: %p\n", window ); */
+/* printf("WM_SETFOCUS: %p\n", window ); */
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
break;
if (LOWORD(wParam) != WA_INACTIVE)
{
/* glutSetCursor( fgStructure.Window->State.Cursor ); */
- /* printf("WM_ACTIVATE: glutSetCursor( %p, %d)\n", window,
+/* printf("WM_ACTIVATE: glutSetCursor( %p, %d)\n", window,
window->State.Cursor ); */
glutSetCursor( window->State.Cursor );
}
SFG_MenuEntry* menuEntry;
int x, y;
- /*
- * First of all check any of the active sub menus...
- */
+ /* First of all check any of the active sub menus... */
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
menuEntry;
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
}
}
- /*
- * That much about our sub menus, let's get to checking the current menu:
- */
+ /* That much about our sub menus, let's get to checking the current menu: */
x = window->State.MouseX;
y = window->State.MouseY;
menu->IsActive = GL_FALSE;
- /*
- * Check if the mouse cursor is contained within the current menu box
- */
+ /* Check if the mouse cursor is contained within the current menu box */
if( ( x >= FREEGLUT_MENU_BORDER ) &&
( x < menu->Width - FREEGLUT_MENU_BORDER ) &&
( y >= FREEGLUT_MENU_BORDER ) &&
{
int menuID = ( y - FREEGLUT_MENU_BORDER ) / FREEGLUT_MENU_HEIGHT;
- /*
- * The mouse cursor is somewhere over our box, check it out.
- */
+ /* The mouse cursor is somewhere over our box, check it out. */
menuEntry = fghFindMenuEntry( menu, menuID + 1 );
assert( menuEntry );
{
SFG_Window *current_window = fgStructure.Window;
- /*
- * Set up the initial menu position now...
- */
+ /* Set up the initial menu position now... */
menuEntry->SubMenu->IsActive = GL_TRUE;
- /*
- * Set up the initial submenu position now:
- */
+ /* Set up the initial submenu position now: */
menuEntry->SubMenu->X = menu->X + menu->Width;
menuEntry->SubMenu->Y = menu->Y +
menuEntry->Ordinal * FREEGLUT_MENU_HEIGHT;
fghCheckMenuStatus( window, menuEntry->SubMenu );
- /*
- * Activate it because its parent entry is active
- */
+ /* Activate it because its parent entry is active */
menuEntry->SubMenu->IsActive = GL_TRUE;
}
- /*
- * Report back that we have caught the menu cursor
- */
+ /* Report back that we have caught the menu cursor */
return GL_TRUE;
}
- /*
- * Looks like the menu cursor is somewhere else...
- */
+ /* Looks like the menu cursor is somewhere else... */
return GL_FALSE;
}
glVertex2i( border, menu->Height - border);
glEnd( );
- /*
- * Check if any of the submenus is currently active...
- */
+ /* Check if any of the submenus is currently active... */
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
menuEntry;
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
{
- /*
- * Has the menu been marked as active, maybe?
- */
+ /* Has the menu been marked as active, maybe? */
if( menuEntry->IsActive )
{
/*
*/
int menuID = menuEntry->Ordinal;
- /*
- * So have the highlight drawn...
- */
+ /* So have the highlight drawn... */
glColor4fv( menu_pen_hback );
glBegin( GL_QUADS );
glVertex2i( border,
}
}
- /*
- * Print the menu entries now...
- */
+ /* Print the menu entries now... */
glColor4fv( menu_pen_fore );
menuEntry;
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next, ++i )
{
- /*
- * If the menu entry is active, set the color to white
- */
+ /* If the menu entry is active, set the color to white */
if( menuEntry->IsActive )
glColor4fv( menu_pen_hfore );
- /*
- * Move the raster into position...
- */
+ /* Move the raster into position... */
/* Try to center the text - JCJ 31 July 2003*/
glRasterPos2i(
2 * border,
( int )( FREEGLUT_MENU_HEIGHT*0.3 - border )
);
- /*
- * Have the label drawn, character after character:
- */
+ /* Have the label drawn, character after character: */
glutBitmapString( FREEGLUT_MENU_FONT,
(unsigned char *)menuEntry->Text);
- /*
- * If it's a submenu, draw a right arrow
- */
+ /* If it's a submenu, draw a right arrow */
if( menuEntry->SubMenu )
{
int width = glutBitmapWidth( FREEGLUT_MENU_FONT, '_' );
glEnd( );
}
- /*
- * If the menu entry is active, reset the color
- */
+ /* If the menu entry is active, reset the color */
if( menuEntry->IsActive )
glColor4fv( menu_pen_fore );
}
- /*
- * Now we are ready to check if any of our children needs to be redrawn:
- */
+ /* Now we are ready to check if any of our children needs to be redrawn: */
for( menuEntry = ( SFG_MenuEntry * )menu->Entries.First;
menuEntry;
menuEntry = ( SFG_MenuEntry * )menuEntry->Node.Next )
{
- /*
- * Is that an active sub menu by any case?
- */
+ /* Is that an active sub menu by any case? */
if( menuEntry->SubMenu && menuEntry->IsActive )
{
- /*
- * Yeah, indeed. Have it redrawn now:
- */
+ /* Yeah, indeed. Have it redrawn now: */
fgSetWindow( menuEntry->SubMenu->Window );
fghDisplayMenuBox( menuEntry->SubMenu );
fgSetWindow( menu->Window );
freeglut_assert_window;
- /*
- * Check if there is an active menu attached to this window...
- */
+ /* Check if there is an active menu attached to this window... */
menu = window->ActiveMenu;
freeglut_return_if_fail( menu );
*/
void fgActivateMenu( SFG_Window* window, int button )
{
- /*
- * We'll be referencing this menu a lot, so remember its address:
- */
+ /* We'll be referencing this menu a lot, so remember its address: */
SFG_Menu* menu = window->Menu[ button ];
- /*
- * Mark the menu as active, so that it gets displayed:
- */
+ /* Mark the menu as active, so that it gets displayed: */
window->ActiveMenu = menu;
menu->IsActive = GL_TRUE;
fgState.ActiveMenus++;
- /*
- * Set up the initial menu position now:
- */
+ /* Set up the initial menu position now: */
menu->X = window->State.MouseX + glutGet( GLUT_WINDOW_X );
menu->Y = window->State.MouseY + glutGet( GLUT_WINDOW_Y );
{
SFG_MenuEntry *menuEntry;
- /*
- * First of all check any of the active sub menus...
- */
+ /* First of all check any of the active sub menus... */
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
menuEntry;
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next)
{
SFG_Window *current_window = fgStructure.Window;
- /*
- * Check if there is an active menu attached to this window...
- */
+ /* Check if there is an active menu attached to this window... */
SFG_Menu* menu = window->ActiveMenu;
SFG_MenuEntry *menuEntry;
- /*
- * Did we find an active window?
- */
+ /* Did we find an active window? */
freeglut_return_if_fail( menu );
- /*
- * Hide the present menu's window
- */
+ /* Hide the present menu's window */
fgSetWindow( menu->Window );
glutHideWindow( );
- /*
- * Forget about having that menu active anymore, now:
- */
+ /* Forget about having that menu active anymore, now: */
menu->Window->ActiveMenu = NULL;
menu->ParentWindow->ActiveMenu = NULL;
menu->IsActive = GL_FALSE;
fgState.ActiveMenus--;
- /*
- * Hide all submenu windows, and the root menu's window.
- */
+ /* Hide all submenu windows, and the root menu's window. */
for ( menuEntry = ( SFG_MenuEntry * )menu->Entries.First;
menuEntry;
menuEntry = ( SFG_MenuEntry * )menuEntry->Node.Next )
{
- /*
- * Is that an active submenu by any case?
- */
+ /* Is that an active submenu by any case? */
if( menuEntry->SubMenu )
fgDeactivateSubMenu( menuEntry );
}
{
SFG_Window *current_window = fgStructure.Window;
SFG_MenuEntry *subMenuIter;
- /*
- * Hide the present menu's window
- */
+ /* Hide the present menu's window */
fgSetWindow( menuEntry->SubMenu->Window );
glutHideWindow( );
- /*
- * Forget about having that menu active anymore, now:
- */
+ /* Forget about having that menu active anymore, now: */
menuEntry->SubMenu->Window->ActiveMenu = NULL;
menuEntry->SubMenu->IsActive = GL_FALSE;
- /*
- * Hide all submenu windows, and the root menu's window.
- */
+ /* Hide all submenu windows, and the root menu's window. */
for ( subMenuIter = (SFG_MenuEntry *)menuEntry->SubMenu->Entries.First;
subMenuIter;
subMenuIter = (SFG_MenuEntry *)subMenuIter->Node.Next )
{
- /*
- * Is that an active submenu by any case?
- */
+ /* Is that an active submenu by any case? */
if( subMenuIter->SubMenu )
fgDeactivateSubMenu( subMenuIter );
}
SFG_MenuEntry* menuEntry;
int width = 0, height = 0;
- /*
- * Make sure there is a current menu set
- */
+ /* Make sure there is a current menu set */
freeglut_assert_ready;
freeglut_return_if_fail( fgStructure.Menu );
- /*
- * The menu's box size depends on the menu entries:
- */
+ /* The menu's box size depends on the menu entries: */
for( menuEntry = ( SFG_MenuEntry * )fgStructure.Menu->Entries.First;
menuEntry;
menuEntry = ( SFG_MenuEntry * )menuEntry->Node.Next )
{
- /*
- * Update the menu entry's width value
- */
+ /* Update the menu entry's width value */
menuEntry->Width = glutBitmapLength(
FREEGLUT_MENU_FONT,
(unsigned char *)menuEntry->Text
(unsigned char *)"_"
);
- /*
- * Check if it's the biggest we've found
- */
+ /* Check if it's the biggest we've found */
if( menuEntry->Width > width )
width = menuEntry->Width;
height += FREEGLUT_MENU_HEIGHT;
}
- /*
- * Store the menu's box size now:
- */
+ /* Store the menu's box size now: */
fgStructure.Menu->Height = height + 2 * FREEGLUT_MENU_BORDER;
fgStructure.Menu->Width = width + 4 * FREEGLUT_MENU_BORDER;
}
*/
int FGAPIENTRY glutCreateMenu( void(* callback)( int ) )
{
- /*
- * The menu object creation code resides in freeglut_structure.c
- */
+ /* The menu object creation code resides in freeglut_structure.c */
return fgCreateMenu( callback )->ID;
}
freeglut_assert_ready;
freeglut_return_if_fail( menu );
- /*
- * The menu object destruction code resides in freeglut_structure.c
- */
+ /* The menu object destruction code resides in freeglut_structure.c */
fgDestroyMenu( menu );
}
menuEntry->Text = strdup( label );
menuEntry->ID = value;
- /*
- * Have the new menu entry attached to the current menu
- */
+ /* Have the new menu entry attached to the current menu */
fgListAppend( &fgStructure.Menu->Entries, &menuEntry->Node );
fghCalculateMenuBoxSize( );
menuEntry->SubMenu = subMenu;
menuEntry->ID = -1;
- /*
- * Make the submenu's parent window be the menu's parent window
- */
+ /* Make the submenu's parent window be the menu's parent window */
fghSetSubmenuParentWindow( fgStructure.Menu->ParentWindow, subMenu );
fgListAppend( &fgStructure.Menu->Entries, &menuEntry->Node );
freeglut_assert_ready;
freeglut_return_if_fail( fgStructure.Menu );
- /*
- * Get n-th menu entry in the current menu, starting from one:
- */
+ /* Get n-th menu entry in the current menu, starting from one: */
menuEntry = fghFindMenuEntry( fgStructure.Menu, item );
freeglut_return_if_fail( menuEntry );
- /*
- * We want it to become a normal menu entry, so:
- */
+ /* We want it to become a normal menu entry, so: */
if( menuEntry->Text )
free( menuEntry->Text );
freeglut_return_if_fail( fgStructure.Menu );
freeglut_return_if_fail( subMenu );
- /*
- * Get n-th menu entry in the current menu, starting from one:
- */
+ /* Get n-th menu entry in the current menu, starting from one: */
menuEntry = fghFindMenuEntry( fgStructure.Menu, item );
freeglut_return_if_fail( menuEntry );
- /*
- * We want it to become a sub menu entry, so:
- */
+ /* We want it to become a sub menu entry, so: */
if( menuEntry->Text )
free( menuEntry->Text );
freeglut_assert_ready;
freeglut_return_if_fail( fgStructure.Menu );
- /*
- * Get n-th menu entry in the current menu, starting from one:
- */
+ /* Get n-th menu entry in the current menu, starting from one: */
menuEntry = fghFindMenuEntry( fgStructure.Menu, item );
freeglut_return_if_fail( menuEntry );
fgStructure.Window->Menu[ button ] = fgStructure.Menu;
- /*
- * Make the parent window of the menu (and all submenus) the current window
- */
+ /* Make the parent window of the menu (and all submenus) the current window */
fghSetSubmenuParentWindow( fgStructure.Window, fgStructure.Menu );
}
const char *extensions, *start;
const int len = strlen( extension );
- /*
- * Make sure there is a current window, and thus a current context available
- */
+ /* Make sure there is a current window, and thus a current context available */
freeglut_assert_ready;
freeglut_return_val_if_fail( fgStructure.Window != NULL, 0 );
*/
void FGAPIENTRY glutSetColor( int nColor, GLfloat red, GLfloat green, GLfloat blue )
{
- /*
- *
- */
+ /* We really need to do something here. */
}
/*
*/
GLfloat FGAPIENTRY glutGetColor( int color, int component )
{
- /*
- *
- */
+ /* We really need to do something here. */
return( 0.0f );
}
*/
void FGAPIENTRY glutCopyColormap( int window )
{
- /*
- *
- */
+ /* We really need to do something here. */
}
/*** END OF FILE ***/
freeglut_assert_ready;
- /*
- * XXX In chronological code add order. (WHY in that order?)
- */
+ /* XXX In chronological code add order. (WHY in that order?) */
switch( eWhat )
{
- /*
- * Following values are stored in fgState and fgDisplay global structures
- */
+ /* Following values are stored in fgState and fgDisplay global structures */
case GLUT_SCREEN_WIDTH: return fgDisplay.ScreenWidth ;
case GLUT_SCREEN_HEIGHT: return fgDisplay.ScreenHeight ;
case GLUT_SCREEN_WIDTH_MM: return fgDisplay.ScreenWidthMM ;
* fghGetConfig().
*/
case GLUT_WINDOW_NUM_SAMPLES:
- /*
- * XXX Multisampling. Return what I know about multisampling.
- */
+ /* XXX Multisampling. Return what I know about multisampling. */
return 0;
#if TARGET_HOST_UNIX_X11
# undef GLX_QUERY
- /*
- * Colormap size is handled in a bit different way than all the rest
- */
+ /* Colormap size is handled in a bit different way than all the rest */
case GLUT_WINDOW_COLORMAP_SIZE:
if( (fghGetConfig( GLX_RGBA )) || (fgStructure.Window == NULL) )
{
}
}
- /*
- * I do not know yet if there will be a fgChooseVisual() function for Win32
- */
+ /* I do not know yet if there will be a fgChooseVisual() function for Win32 */
case GLUT_DISPLAY_MODE_POSSIBLE:
return( fgChooseVisual() == NULL ? 0 : 1 );
- /*
- * This is system-dependant
- */
+ /* This is system-dependant */
case GLUT_WINDOW_FORMAT_ID:
if( fgStructure.Window == NULL )
return 0;
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
- /*
- * Handle the OpenGL inquiries
- */
+ /* Handle the OpenGL inquiries */
case GLUT_WINDOW_RGBA:
glGetBooleanv ( GL_RGBA_MODE, &boolValue );
returnValue = boolValue ? 1 : 0;
*/
GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
- /*
- * ...then we've got to correct the results we've just received...
- */
+ /* ...then we've got to correct the results we've just received... */
#if !TARGET_HOST_WINCE
if ( ( fgStructure.GameMode != fgStructure.Window ) && ( fgStructure.Window->Parent == NULL ) &&
#endif
- /*
- * The window structure queries
- */
+ /* The window structure queries */
case GLUT_WINDOW_PARENT:
if( fgStructure.Window == NULL ) return 0;
if( fgStructure.Window->Parent == NULL ) return 0;
{
freeglut_assert_ready;
- /*
- * XXX WARNING: we are mostly lying in this function.
- */
+ /* XXX WARNING: we are mostly lying in this function. */
switch( eWhat )
{
case GLUT_HAS_KEYBOARD:
return GetSystemMetrics( SM_MOUSEPRESENT );
case GLUT_NUM_MOUSE_BUTTONS:
- /*
- * We are much more fortunate under Win32 about this...
- */
+ /* We are much more fortunate under Win32 about this... */
#if TARGET_HOST_WINCE
return 1;
#else
case GLUT_OWNS_JOYSTICK:
case GLUT_JOYSTICK_BUTTONS:
case GLUT_JOYSTICK_AXES:
- /*
- * XXX WARNING: THIS IS A BIG LIE!
- */
+ /* XXX WARNING: THIS IS A BIG LIE! */
return 0;
case GLUT_HAS_SPACEBALL:
return fgStructure.Window ? fgStructure.Window->State.IgnoreKeyRepeat : 0;
case GLUT_DEVICE_KEY_REPEAT:
- /*
- * XXX WARNING: THIS IS A BIG LIE!
- */
+ /* XXX WARNING: THIS IS A BIG LIE! */
return GLUT_KEY_REPEAT_DEFAULT;
default:
break;
}
- /*
- * And now -- the failure.
- */
+ /* And now -- the failure. */
return -1;
}
return 0;
case GLUT_NORMAL_DAMAGED:
- /*
- * XXX Actually I do not know. Maybe.
- */
+ /* XXX Actually I do not know. Maybe. */
return FALSE;
case GLUT_OVERLAY_DAMAGED:
return 0;
case GLUT_NORMAL_DAMAGED:
- /*
- * XXX Actually I do not know. Maybe.
- */
+ /* XXX Actually I do not know. Maybe. */
return FALSE;
case GLUT_OVERLAY_DAMAGED:
break;
}
- /*
- * And fail. That's good. Programs do love failing.
- */
+ /* And fail. That's good. Programs do love failing. */
return -1;
}
+/*
+ * freeglut_stroke_mono_roman.c
+ *
+ * freeglut Monospace Roman stroke font definition
+ *
+ * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
+ * Written by Pawel W. Olszta, <olszta@sourceforge.net>
+ * Creation date: ?????
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
/* This file has been automatically generated by the genstroke utility. */
+/*
+ * freeglut_stroke_roman.c
+ *
+ * freeglut Roman stroke font definition
+ *
+ * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
+ * Written by Pawel W. Olszta, <olszta@sourceforge.net>
+ * Creation date: ?????
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
/* This file has been automatically generated by the genstroke utility. */
int x, int y, int w, int h,
GLboolean gameMode, GLboolean isMenu )
{
- /*
- * Have the window object created
- */
+ /* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
int fakeArgc = 0;
if( !fgState.Initialised )
glutInit( &fakeArgc, NULL );
- /*
- * Initialize the object properties
- */
+ /* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
window->State.OldHeight = window->State.OldWidth = -1;
else
fgListAppend( &fgStructure.Windows, &window->Node );
- /*
- * Set the default mouse cursor and reset the modifiers value
- */
+ /* Set the default mouse cursor and reset the modifiers value */
window->State.Cursor = GLUT_CURSOR_INHERIT;
window->IsMenu = isMenu;
int x = 100, y = 100, w = 100, h = 100;
SFG_Window *current_window = fgStructure.Window;
- /*
- * Have the menu object created
- */
+ /* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
int fakeArgc = 0;
menu->ParentWindow = fgStructure.Window;
- /*
- * Create a window for the menu to reside in.
- */
+ /* Create a window for the menu to reside in. */
fgCreateWindow( NULL, "freeglut menu", x, y, w, h, GL_FALSE, GL_TRUE );
menu->Window = fgStructure.Window;
glutHideWindow( ); /* Hide the window for now */
fgSetWindow( current_window );
- /*
- * Initialize the object properties:
- */
+ /* Initialize the object properties: */
menu->ID = ++fgStructure.MenuID;
menu->Callback = menuCallback;
menu->ActiveEntry = NULL;
fgListInit( &menu->Entries );
fgListAppend( &fgStructure.Menus, &menu->Node );
- /*
- * Newly created menus implicitly become current ones
- */
+ /* Newly created menus implicitly become current ones */
fgStructure.Menu = menu;
return menu;
new_list_entry->window = window;
fgListAppend( &fgStructure.WindowsToDestroy, &new_list_entry->node );
- /*
- * Check if the window is the current one...
- */
+ /* Check if the window is the current one... */
if( fgStructure.Window == window )
fgStructure.Window = NULL;
if( window->Menu[ i ] == menu )
window->Menu[ i ] = NULL;
- /*
- * Call this function for all of the window's children recursively:
- */
+ /* Call this function for all of the window's children recursively: */
for( subWindow = (SFG_Window *)window->Children.First;
subWindow;
subWindow = (SFG_Window *)subWindow->Node.Next)
assert( menu );
freeglut_assert_ready;
- /*
- * First of all, have all references to this menu removed from all windows:
- */
+ /* First of all, have all references to this menu removed from all windows: */
for( window = (SFG_Window *)fgStructure.Windows.First;
window;
window = (SFG_Window *)window->Node.Next )
fghRemoveMenuFromWindow( window, menu );
- /*
- * Now proceed with removing menu entries that lead to this menu
- */
+ /* Now proceed with removing menu entries that lead to this menu */
for( from = ( SFG_Menu * )fgStructure.Menus.First;
from;
from = ( SFG_Menu * )from->Node.Next )
{
freeglut_assert_ready;
- /*
- * Clean up the WindowsToDestroy list.
- */
+ /* Clean up the WindowsToDestroy list. */
fgCloseWindows( );
- /*
- * Make sure all windows and menus have been deallocated
- */
+ /* Make sure all windows and menus have been deallocated */
while( fgStructure.Menus.First )
fgDestroyMenu( ( SFG_Menu * )fgStructure.Menus.First );
assert( enumCallback && enumerator );
freeglut_assert_ready;
- /*
- * Check every of the top-level windows
- */
+ /* Check every of the top-level windows */
for( window = ( SFG_Window * )fgStructure.Windows.First;
window;
window = ( SFG_Window * )window->Node.Next )
if ( enumerator->found )
return;
- /*
- * Check the window's handle. Hope this works. Looks ugly. That's for sure.
- */
+ /* Check the window's handle. Hope this works. Looks ugly. That's for sure. */
if( window->Window.Handle == (SFG_WindowHandleType) (enumerator->data) )
{
enumerator->found = GL_TRUE;
return;
}
- /*
- * Otherwise, check this window's children
- */
+ /* Otherwise, check this window's children */
fgEnumSubWindows( window, fghcbWindowByHandle, enumerator );
}
{
SFG_Enumerator enumerator;
- /*
- * This is easy and makes use of the windows enumeration defined above
- */
+ /* This is easy and makes use of the windows enumeration defined above */
enumerator.found = GL_FALSE;
enumerator.data = (void *)hWindow;
fgEnumWindows( fghcbWindowByHandle, &enumerator );
*/
static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
{
- /*
- * Make sure we do not overwrite our precious results...
- */
+ /* Make sure we do not overwrite our precious results... */
if( enumerator->found )
return;
- /*
- * Check the window's handle. Hope this works. Looks ugly. That's for sure.
- */
+ /* Check the window's handle. Hope this works. Looks ugly. That's for sure. */
if( window->ID == *( int *)(enumerator->data) )
{
enumerator->found = GL_TRUE;
return;
}
- /*
- * Otherwise, check this window's children
- */
+ /* Otherwise, check this window's children */
fgEnumSubWindows( window, fghcbWindowByID, enumerator );
}
{
SFG_Enumerator enumerator;
- /*
- * Uses a method very similiar for fgWindowByHandle...
- */
+ /* Uses a method very similiar for fgWindowByHandle... */
enumerator.found = GL_FALSE;
enumerator.data = ( void * )&windowID;
fgEnumWindows( fghcbWindowByID, &enumerator );
/*
* Looks up a menu given its ID. This is easier that fgWindowByXXX
- * as all menus are placed in a single doubly linked list...
+ * as all menus are placed in one doubly linked list...
*/
SFG_Menu* fgMenuByID( int menuID )
{
freeglut_assert_ready;
- /*
- * It's enough to check all entries in fgStructure.Menus...
- */
+ /* It's enough to check all entries in fgStructure.Menus... */
for( menu = (SFG_Menu *)fgStructure.Menus.First;
menu;
menu = (SFG_Menu *)menu->Node.Next )
*/
void FGAPIENTRY glutWireTeapot( GLdouble size )
{
- /*
- * We will use the general teapot rendering code
- */
+ /* We will use the general teapot rendering code */
teapot( 10, size, GL_LINE );
}
*/
void FGAPIENTRY glutSolidTeapot( GLdouble size )
{
- /*
- * We will use the general teapot rendering code
- */
+ /* We will use the general teapot rendering code */
teapot( 7, size, GL_FILL );
}
* First we have to process the display mode settings...
*/
/*
- * Why is there a semi-colon in this #define? The code
- * that uses the macro seems to always add more semicolons...
+ * XXX Why is there a semi-colon in this #define? The code
+ * XXX that uses the macro seems to always add more semicolons...
*/
#define ATTRIB(a) attributes[where++]=a;
#define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);}
/*
* Fill in the size hints values now (the x, y, width and height
- * settings are obsolote, are there any more WMs that support them?)
+ * settings are obsolete, are there any more WMs that support them?)
* Unless the X servers actually stop supporting these, we should
* continue to fill them in. It is *not* our place to tell the user
* that they should replace a window manager that they like, and which
* works, just because *we* think that it's not "modern" enough.
*/
-#if TARGET_HOST_WINCE
+#if TARGET_HOST_WINCE /* Since this is in the X11 branch, it's pretty dumb */
sizeHints.x = 0;
sizeHints.y = 0;
sizeHints.width = 320;
wmHints.flags = StateHint;
wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
- /*
- * Prepare the window and iconified window names...
- */
+ /* Prepare the window and iconified window names... */
XStringListToTextProperty( (char **) &title, 1, &textProperty );
XSetWMProperties(
freeglut_assert_ready;
- /*
- * Grab the window class we have registered on glutInit():
- */
+ /* Grab the window class we have registered on glutInit(): */
atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc );
assert( atom != 0 );
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
- /*
- * Make sure we don't close a window with current context active
- */
+ /* Make sure we don't close a window with current context active */
if( fgStructure.Window == window )
wglMakeCurrent( NULL, NULL );
int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
{
int ret = 0;
-
SFG_Window* window = NULL;
SFG_Window* parent = NULL;
{
RECT winRect;
+ /* "GetWindowRect" returns the pixel coordinates of the outside of the window */
GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
MoveWindow(
fgStructure.Window->Window.Handle,