X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_structure.c;h=8708d2bf8def8bfcc6d41fec83f89821bbd17efe;hb=e218a8c9e3bd45717847d9d63b052a6d0a7d1e67;hp=e61eac797e965e8d9856ccf797cbb0f2d1504baa;hpb=1b0d16ef859db5c028546ff865ec586778044ab8;p=freeglut diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index e61eac7..8708d2b 100644 --- a/src/freeglut_structure.c +++ b/src/freeglut_structure.c @@ -29,8 +29,6 @@ #include "config.h" #endif -#define G_LOG_DOMAIN "freeglut-structure" - #include "../include/GL/freeglut.h" #include "freeglut_internal.h" @@ -111,7 +109,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, /* * This private function creates a menu and adds it to the menus list */ -SFG_Menu* fgCreateMenu( FGCBmenu menuCallback ) +SFG_Menu* fgCreateMenu( FGCBMenu menuCallback ) { int x = 100, y = 100, w = 100, h = 100 ; SFG_Window *current_window = fgStructure.Window ; @@ -268,11 +266,15 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ) while ( (subWindow = (SFG_Window *)window->Children.First) != NULL ) fgDestroyWindow( subWindow, needToClose ); - if ( window->Callbacks.Destroy != NULL ) + /* + * XXX Since INVOKE_WCB() tests the function pointer, why not make + * XXX this unconditional? Overhead is close to nil, and it would + * XXX clarify the code by omitting a conditional test. + */ + if ( FETCH_WCB( *window, Destroy ) ) { SFG_Window *activeWindow = fgStructure.Window ; - fgSetWindow ( window ) ; - window->Callbacks.Destroy () ; + INVOKE_WCB( *window, Destroy, ( ) ); fgSetWindow ( activeWindow ) ; }