X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_internal.h;h=9f18d043b9b9de6516ed93356021d1a6d327a8e4;hb=9f6ad6f0f0c2783d89e6b4b6281cdb3a08528c6e;hp=cddae4e86ec48bdfe43123d1ec30ec65e691d66b;hpb=78d46c63a115e0a868d83f365399864b62a4ea7f;p=freeglut diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index cddae4e..9f18d04 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -323,8 +323,6 @@ struct tagSFG_Context #if TARGET_HOST_UNIX_X11 XVisualInfo* VisualInfo; /* The window's visual information */ - Pixmap Pixmap; /* Used for offscreen rendering */ - /* GLXPixmap GLXPixMap; */ /* Used for offscreen rendering */ #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE HDC Device; /* The window's device context */ #endif @@ -387,8 +385,8 @@ typedef void (*SFG_Proc)(); #define SET_WCB(window,cbname,func) \ do \ { \ - if( FETCH_WCB( window, cbname ) != func ) \ - (((window).CallBacks[CB_ ## cbname]) = (SFG_Proc) func); \ + if( FETCH_WCB( window, cbname ) != (SFG_Proc)(func) ) \ + (((window).CallBacks[CB_ ## cbname]) = (SFG_Proc)(func)); \ } while( 0 ) /* @@ -403,7 +401,7 @@ do \ * type. */ #define FETCH_WCB(window,cbname) \ - ((FGCB ## cbname)((window).CallBacks[CB_ ## cbname])) + ((window).CallBacks[CB_ ## cbname]) /* * INVOKE_WCB() is used as: @@ -424,15 +422,28 @@ do \ * current window. * */ +#if TARGET_HOST_WIN32 +#define INVOKE_WCB(window,cbname,arg_list) \ +do \ +{ \ + if( FETCH_WCB( window, cbname ) ) \ + { \ + FGCB ## cbname func = (FGCB ## cbname)(FETCH_WCB( window, cbname )); \ + fgSetWindow( &window ); \ + func arg_list; \ + } \ +} while( 0 ) +#else #define INVOKE_WCB(window,cbname,arg_list) \ do \ { \ if( FETCH_WCB( window, cbname ) ) \ { \ fgSetWindow( &window ); \ - FETCH_WCB( window, cbname ) arg_list; \ + ((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \ } \ } while( 0 ) +#endif /* * The window callbacks the user can supply us with. Should be kept portable. @@ -532,6 +543,8 @@ struct tagSFG_MenuEntry /* * A window, making part of freeglut windows hierarchy. * Should be kept portable. + * + * NOTE that ActiveMenu is set to menu itself if the window is a menu. */ struct tagSFG_Window { @@ -570,7 +583,7 @@ struct tagSFG_Structure SFG_List WindowsToDestroy; SFG_Window* CurrentWindow; /* The currently set window */ - SFG_Menu* CurrentMenu; /* Same, but menu... */ + SFG_Menu* CurrentMenu; /* Same, but menu... */ SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */ @@ -693,7 +706,7 @@ extern SFG_State fgState; * window set, respectively: */ #define FREEGLUT_EXIT_IF_NO_WINDOW( string ) \ - if ( ! fgStructure.CurrentWindow ) \ + if ( ! fgStructure.CurrentWindow ) \ { \ fgError ( " ERROR: Function <%s> called" \ " with no current window defined.", (string) ) ; \ @@ -802,6 +815,7 @@ SFG_Menu* fgMenuByID( int menuID ); * The menu activation and deactivation the code. This is the meat * of the menu user interface handling code... */ +void fgUpdateMenuHighlight ( SFG_Menu *menu ); GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed, int mouse_x, int mouse_y ); void fgDeactivateMenu( SFG_Window *window );