Some assertion changes / removals from Dr. John Fay
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@524 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
8fd086e068
commit
277a549cc6
@ -84,7 +84,7 @@ static int fghGetCursorError( Cursor cursor )
|
|||||||
void FGAPIENTRY glutSetCursor( int cursorID )
|
void FGAPIENTRY glutSetCursor( int cursorID )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready; /* XXX WHY do we need the timer active for this? */
|
freeglut_assert_ready; /* XXX WHY do we need the timer active for this? */
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
/*
|
/*
|
||||||
@ -237,7 +237,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
|||||||
void FGAPIENTRY glutWarpPointer( int x, int y )
|
void FGAPIENTRY glutWarpPointer( int x, int y )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready; /* XXX WHY do we need the timer active for this? */
|
freeglut_assert_ready; /* XXX WHY do we need the timer active for this? */
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
void FGAPIENTRY glutPostRedisplay( void )
|
void FGAPIENTRY glutPostRedisplay( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutPostRedisplay" );
|
||||||
fgStructure.Window->State.Redisplay = GL_TRUE;
|
fgStructure.Window->State.Redisplay = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ void FGAPIENTRY glutPostRedisplay( void )
|
|||||||
void FGAPIENTRY glutSwapBuffers( void )
|
void FGAPIENTRY glutSwapBuffers( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSwapBuffers" );
|
||||||
|
|
||||||
glFlush( );
|
glFlush( );
|
||||||
if( ! fgStructure.Window->Window.DoubleBuffered )
|
if( ! fgStructure.Window->Window.DoubleBuffered )
|
||||||
|
@ -651,8 +651,13 @@ extern SFG_State fgState;
|
|||||||
* A call to those macros assures us that there is a current
|
* A call to those macros assures us that there is a current
|
||||||
* window and menu set, respectively:
|
* window and menu set, respectively:
|
||||||
*/
|
*/
|
||||||
#define freeglut_assert_window assert( fgStructure.Window != NULL );
|
|
||||||
#define freeglut_assert_menu assert( fgStructure.Menu != NULL );
|
#define freeglut_assert_menu assert( fgStructure.Menu != NULL );
|
||||||
|
#define FREEGLUT_EXIT_IF_NO_WINDOW( string ) \
|
||||||
|
if ( ! fgStructure.Window ) \
|
||||||
|
{ \
|
||||||
|
fgError ( " ERROR: Function <%s> called" \
|
||||||
|
" with no current window defined.", (string) ) ; \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The deinitialize function gets called on glutMainLoop() end. It should clean up
|
* The deinitialize function gets called on glutMainLoop() end. It should clean up
|
||||||
|
@ -394,7 +394,7 @@ void fgDisplayMenu( void )
|
|||||||
SFG_Window* window = fgStructure.Window;
|
SFG_Window* window = fgStructure.Window;
|
||||||
SFG_Menu* menu = NULL;
|
SFG_Menu* menu = NULL;
|
||||||
|
|
||||||
freeglut_assert_window;
|
freeglut_return_if_fail ( fgStructure.Window != NULL );
|
||||||
|
|
||||||
/* 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;
|
menu = window->ActiveMenu;
|
||||||
|
@ -96,7 +96,7 @@ void FGAPIENTRY glutReportErrors( void )
|
|||||||
void FGAPIENTRY glutIgnoreKeyRepeat( int ignore )
|
void FGAPIENTRY glutIgnoreKeyRepeat( int ignore )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutIgnoreKeyRepeat" );
|
||||||
|
|
||||||
fgStructure.Window->State.IgnoreKeyRepeat = ignore ? GL_TRUE : GL_FALSE;
|
fgStructure.Window->State.IgnoreKeyRepeat = ignore ? GL_TRUE : GL_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -743,7 +743,7 @@ int FGAPIENTRY glutGetWindow( void )
|
|||||||
void FGAPIENTRY glutShowWindow( void )
|
void FGAPIENTRY glutShowWindow( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutShowWindow" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ void FGAPIENTRY glutShowWindow( void )
|
|||||||
void FGAPIENTRY glutHideWindow( void )
|
void FGAPIENTRY glutHideWindow( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutHideWindow" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ void FGAPIENTRY glutHideWindow( void )
|
|||||||
void FGAPIENTRY glutIconifyWindow( void )
|
void FGAPIENTRY glutIconifyWindow( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutIconifyWindow" );
|
||||||
|
|
||||||
fgStructure.Window->State.Visible = GL_FALSE;
|
fgStructure.Window->State.Visible = GL_FALSE;
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
@ -817,7 +817,7 @@ void FGAPIENTRY glutIconifyWindow( void )
|
|||||||
void FGAPIENTRY glutSetWindowTitle( const char* title )
|
void FGAPIENTRY glutSetWindowTitle( const char* title )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetWindowTitle" );
|
||||||
if( ! fgStructure.Window->Parent )
|
if( ! fgStructure.Window->Parent )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
@ -859,7 +859,7 @@ void FGAPIENTRY glutSetWindowTitle( const char* title )
|
|||||||
void FGAPIENTRY glutSetIconTitle( const char* title )
|
void FGAPIENTRY glutSetIconTitle( const char* title )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetIconTitle" );
|
||||||
|
|
||||||
if( ! fgStructure.Window->Parent )
|
if( ! fgStructure.Window->Parent )
|
||||||
{
|
{
|
||||||
@ -902,7 +902,7 @@ void FGAPIENTRY glutSetIconTitle( const char* title )
|
|||||||
void FGAPIENTRY glutReshapeWindow( int width, int height )
|
void FGAPIENTRY glutReshapeWindow( int width, int height )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutReshapeWindow" );
|
||||||
|
|
||||||
fgStructure.Window->State.NeedToResize = GL_TRUE;
|
fgStructure.Window->State.NeedToResize = GL_TRUE;
|
||||||
fgStructure.Window->State.Width = width ;
|
fgStructure.Window->State.Width = width ;
|
||||||
@ -915,7 +915,7 @@ void FGAPIENTRY glutReshapeWindow( int width, int height )
|
|||||||
void FGAPIENTRY glutPositionWindow( int x, int y )
|
void FGAPIENTRY glutPositionWindow( int x, int y )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutPositionWindow" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -949,7 +949,7 @@ void FGAPIENTRY glutPositionWindow( int x, int y )
|
|||||||
void FGAPIENTRY glutPushWindow( void )
|
void FGAPIENTRY glutPushWindow( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutPushWindow" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -973,7 +973,7 @@ void FGAPIENTRY glutPushWindow( void )
|
|||||||
void FGAPIENTRY glutPopWindow( void )
|
void FGAPIENTRY glutPopWindow( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutPopWindow" );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -997,7 +997,7 @@ void FGAPIENTRY glutPopWindow( void )
|
|||||||
void FGAPIENTRY glutFullScreen( void )
|
void FGAPIENTRY glutFullScreen( void )
|
||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutFullScreen" );
|
||||||
|
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
Reference in New Issue
Block a user