projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updating the ChangeLog ...
[freeglut]
/
src
/
freeglut_main.c
diff --git
a/src/freeglut_main.c
b/src/freeglut_main.c
index
da5bcfe
..
da13c94
100644
(file)
--- a/
src/freeglut_main.c
+++ b/
src/freeglut_main.c
@@
-29,12
+29,16
@@
#include "freeglut_internal.h"
#include <errno.h>
#include <stdarg.h>
#include "freeglut_internal.h"
#include <errno.h>
#include <stdarg.h>
-#if HAVE_VPRINTF
+#if TARGET_HOST_WIN32
# define VFPRINTF(s,f,a) vfprintf((s),(f),(a))
# define VFPRINTF(s,f,a) vfprintf((s),(f),(a))
-#elif HAVE_DOPRNT
-# define VFPRINTF(s,f,a) _doprnt((f),(a),(s))
#else
#else
-# define VFPRINTF(s,f,a)
+# if HAVE_VPRINTF
+# define VFPRINTF(s,f,a) vfprintf((s),(f),(a))
+# elif HAVE_DOPRNT
+# define VFPRINTF(s,f,a) _doprnt((f),(a),(s))
+# else
+# define VFPRINTF(s,f,a)
+# endif
#endif
#if TARGET_HOST_WINCE
#endif
#if TARGET_HOST_WINCE
@@
-588,6
+592,8
@@
void FGAPIENTRY glutMainLoopEvent( void )
if( ( width != window->State.OldWidth ) ||
( height != window->State.OldHeight ) )
{
if( ( width != window->State.OldWidth ) ||
( height != window->State.OldHeight ) )
{
+ SFG_Window *current_window = fgStructure.CurrentWindow;
+
window->State.OldWidth = width;
window->State.OldHeight = height;
if( FETCH_WCB( *window, Reshape ) )
window->State.OldWidth = width;
window->State.OldHeight = height;
if( FETCH_WCB( *window, Reshape ) )
@@
-598,6
+604,8
@@
void FGAPIENTRY glutMainLoopEvent( void )
glViewport( 0, 0, width, height );
}
glutPostRedisplay( );
glViewport( 0, 0, width, height );
}
glutPostRedisplay( );
+ if( window->IsMenu )
+ fgSetWindow( current_window );
}
}
break;
}
}
break;
@@
-624,8
+632,7
@@
void FGAPIENTRY glutMainLoopEvent( void )
if( event.xexpose.count == 0 )
{
GETWINDOW( xexpose );
if( event.xexpose.count == 0 )
{
GETWINDOW( xexpose );
- fgSetWindow( window );
- glutPostRedisplay( );
+ window->State.Redisplay = GL_TRUE;
}
break;
}
break;
@@
-691,6
+698,10
@@
void FGAPIENTRY glutMainLoopEvent( void )
case LeaveNotify:
GETWINDOW( xcrossing );
GETMOUSE( xcrossing );
case LeaveNotify:
GETWINDOW( xcrossing );
GETMOUSE( xcrossing );
+ if( ( event.type == LeaveNotify ) && window->IsMenu &&
+ window->ActiveMenu && window->ActiveMenu->IsActive )
+ fgUpdateMenuHighlight( window->ActiveMenu );
+
INVOKE_WCB( *window, Entry, ( ( EnterNotify == event.type ) ?
GLUT_ENTERED :
GLUT_LEFT ) );
INVOKE_WCB( *window, Entry, ( ( EnterNotify == event.type ) ?
GLUT_ENTERED :
GLUT_LEFT ) );
@@
-710,8
+721,8
@@
void FGAPIENTRY glutMainLoopEvent( void )
window->ActiveMenu->Window->State.MouseY =
event.xmotion.y_root - window->ActiveMenu->Y;
}
window->ActiveMenu->Window->State.MouseY =
event.xmotion.y_root - window->ActiveMenu->Y;
}
- window->ActiveMenu->Window->State.Redisplay = GL_TRUE ;
- fgSetWindow( window->ActiveMenu->ParentWindow );
+
+ fgUpdateMenuHighlight( window->ActiveMenu );
break;
}
break;
}
@@
-858,13
+869,13
@@
void FGAPIENTRY glutMainLoopEvent( void )
if( event.type == KeyPress )
{
if( event.type == KeyPress )
{
- keyboard_cb = FETCH_WCB( *window, Keyboard );
- special_cb = FETCH_WCB( *window, Special );
+ keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, Keyboard ));
+ special_cb = (FGCBSpecial) ( FETCH_WCB( *window, Special ));
}
else
{
}
else
{
- keyboard_cb = FETCH_WCB( *window, KeyboardUp );
- special_cb = FETCH_WCB( *window, SpecialUp );
+ keyboard_cb = (FGCBKeyboard)( FETCH_WCB( *window, KeyboardUp ));
+ special_cb = (FGCBSpecial) ( FETCH_WCB( *window, SpecialUp ));
}
/* Is there a keyboard/special callback hooked for this window? */
}
/* Is there a keyboard/special callback hooked for this window? */
@@
-1052,7
+1063,13
@@
void FGAPIENTRY glutMainLoop( void )
else
{
if( fgState.IdleCallback )
else
{
if( fgState.IdleCallback )
+ {
+ if( fgStructure.CurrentWindow &&
+ fgStructure.CurrentWindow->IsMenu )
+ /* fail safe */
+ fgSetWindow( window );
fgState.IdleCallback( );
fgState.IdleCallback( );
+ }
fghSleepForEvents( );
}
fghSleepForEvents( );
}
@@
-1268,6
+1285,10
@@
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
* XXX if the flag is false we invoke the Entry callback and set the flag to true.
*/
case 0x02a2: /* This is the message we get when the mouse is leaving the window */
* XXX if the flag is false we invoke the Entry callback and set the flag to true.
*/
case 0x02a2: /* This is the message we get when the mouse is leaving the window */
+ if( window->IsMenu &&
+ window->ActiveMenu && window->ActiveMenu->IsActive )
+ fgUpdateMenuHighlight( window->ActiveMenu );
+
INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) );
break ;
INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) );
break ;
@@
-1287,8
+1308,7
@@
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
if ( window->ActiveMenu )
{
if ( window->ActiveMenu )
{
- window->State.Redisplay = GL_TRUE;
- fgSetWindow ( window->ActiveMenu->ParentWindow );
+ fgUpdateMenuHighlight( window->ActiveMenu );
break;
}
break;
}