Some changes, mostly from John. Mostly style changes.
One bug fix from John: Execution state bug-fix in glutMainLoop(), per his post yesterday. One fix from me: Changed "if( ButtonPress )" to "if( pressed )". {ButtonPress} is a constant. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@299 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
d5d4789b6b
commit
585433d174
@ -653,10 +653,14 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
event.xmotion.y );
|
||||
}
|
||||
}
|
||||
else if( window->Callbacks.Passive )
|
||||
else
|
||||
{
|
||||
if( window->Callbacks.Passive )
|
||||
{
|
||||
fgSetWindow( window );
|
||||
window->Callbacks.Passive( event.xmotion.x, event.xmotion.y );
|
||||
window->Callbacks.Passive( event.xmotion.x,
|
||||
event.xmotion.y );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -790,14 +794,12 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
if( window->Callbacks.Mouse )
|
||||
fgStructure.Window->Callbacks.Mouse(
|
||||
button,
|
||||
event.type == ButtonPress ? GLUT_DOWN : GLUT_UP,
|
||||
pressed ? GLUT_DOWN : GLUT_UP,
|
||||
event.xbutton.x,
|
||||
event.xbutton.y
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( button >= 4 ) && window->Callbacks.MouseWheel )
|
||||
{
|
||||
/*
|
||||
* Map 4 and 5 to wheel zero; EVEN to +1, ODD to -1
|
||||
@ -811,7 +813,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
int wheel_number = (button - 4) / 2;
|
||||
int direction = (button & 1)*2 - 1;
|
||||
|
||||
if( ButtonPress )
|
||||
if( pressed )
|
||||
fgStructure.Window->Callbacks.MouseWheel(
|
||||
wheel_number,
|
||||
direction,
|
||||
@ -819,14 +821,13 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
||||
event.xbutton.y
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Trash the modifiers state
|
||||
*/
|
||||
fgStructure.Window->State.Modifiers = 0xffffffff;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KeyRelease:
|
||||
case KeyPress:
|
||||
@ -1018,7 +1019,7 @@ void FGAPIENTRY glutMainLoop( void )
|
||||
}
|
||||
|
||||
{
|
||||
fgExecutionState execState = fgState.ActionOnWindowClose;
|
||||
fgExecutionState execState = fgState.ExecState;
|
||||
|
||||
/*
|
||||
* When this loop terminates, destroy the display, state and structure
|
||||
@ -1381,7 +1382,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ( window->Menu[ button ] != NULL ) && ( pressed == TRUE ) )
|
||||
if ( ( window->Menu[ button ] ) && ( pressed == TRUE ) )
|
||||
{
|
||||
window->State.Redisplay = TRUE;
|
||||
fgSetWindow( window );
|
||||
|
Reference in New Issue
Block a user