projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix object/function pointer inconsistencies which are a problem for gcc 3.4.2.
[freeglut]
/
src
/
freeglut_structure.c
diff --git
a/src/freeglut_structure.c
b/src/freeglut_structure.c
index
6e1f542
..
07bf892
100644
(file)
--- a/
src/freeglut_structure.c
+++ b/
src/freeglut_structure.c
@@
-25,14
+25,9
@@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <GL/freeglut.h>
#include "freeglut_internal.h"
#include <GL/freeglut.h>
#include "freeglut_internal.h"
-
/* -- GLOBAL EXPORTS ------------------------------------------------------- */
/*
/* -- GLOBAL EXPORTS ------------------------------------------------------- */
/*
@@
-75,17
+70,9
@@
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
{
/* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
{
/* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
- int fakeArgc = 0;
fghClearCallBacks( window );
fghClearCallBacks( window );
- /*
- * If the freeglut internals haven't been initialized yet,
- * do it now. Hack's idea courtesy of Chris Purnell...
- */
- if( !fgState.Initialised )
- glutInit( &fakeArgc, NULL );
-
/* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
window->State.OldHeight = window->State.OldWidth = -1;
/* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
window->State.OldHeight = window->State.OldWidth = -1;
@@
-127,14
+114,6
@@
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
/* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
/* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
- int fakeArgc = 0;
-
- /*
- * If the freeglut internals haven't been initialized yet,
- * do it now. Hack's idea courtesy of Chris Purnell...
- */
- if( !fgState.Initialised )
- glutInit( &fakeArgc, NULL );
menu->ParentWindow = fgStructure.Window;
menu->ParentWindow = fgStructure.Window;
@@
-215,8
+194,8
@@
void fgDestroyWindow( SFG_Window* window )
{
int menu_index;
{
int menu_index;
- assert( window );
- freeglut_assert_ready;
+ FREEGLUT_INTERNAL_ERROR_EXIT ( window, "Window destroy function called with null window",
+ "fgDestroyWindow" );
while( window->Children.First )
fgDestroyWindow( ( SFG_Window * )window->Children.First );
while( window->Children.First )
fgDestroyWindow( ( SFG_Window * )window->Children.First );
@@
-294,8
+273,8
@@
void fgDestroyMenu( SFG_Menu* menu )
SFG_Window *window;
SFG_Menu *from;
SFG_Window *window;
SFG_Menu *from;
- assert( menu );
- freeglut_assert_ready;
+ FREEGLUT_INTERNAL_ERROR_EXIT ( menu, "Menu destroy function called with null menu",
+ "fgDestroyMenu" );
/* First of all, have all references to this menu removed from all windows: */
for( window = (SFG_Window *)fgStructure.Windows.First;
/* First of all, have all references to this menu removed from all windows: */
for( window = (SFG_Window *)fgStructure.Windows.First;
@@
-374,8
+353,6
@@
void fgCreateStructure( void )
*/
void fgDestroyStructure( void )
{
*/
void fgDestroyStructure( void )
{
- freeglut_assert_ready;
-
/* Clean up the WindowsToDestroy list. */
fgCloseWindows( );
/* Clean up the WindowsToDestroy list. */
fgCloseWindows( );
@@
-394,8
+371,9
@@
void fgEnumWindows( FGCBenumerator enumCallback, SFG_Enumerator* enumerator )
{
SFG_Window *window;
{
SFG_Window *window;
- assert( enumCallback && enumerator );
- freeglut_assert_ready;
+ FREEGLUT_INTERNAL_ERROR_EXIT ( enumCallback && enumerator,
+ "Enumerator or callback missing from window enumerator call",
+ "fgEnumWindows" );
/* Check every of the top-level windows */
for( window = ( SFG_Window * )fgStructure.Windows.First;
/* Check every of the top-level windows */
for( window = ( SFG_Window * )fgStructure.Windows.First;
@@
-417,8
+395,10
@@
void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback,
{
SFG_Window *child;
{
SFG_Window *child;
- assert( enumCallback && enumerator );
- freeglut_assert_ready;
+ FREEGLUT_INTERNAL_ERROR_EXIT ( enumCallback && enumerator,
+ "Enumerator or callback missing from subwindow enumerator call",
+ "fgEnumSubWindows" );
+ FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Window Enumeration" );
for( child = ( SFG_Window * )window->Children.First;
child;
for( child = ( SFG_Window * )window->Children.First;
child;
@@
-519,8
+499,6
@@
SFG_Menu* fgMenuByID( int menuID )
{
SFG_Menu *menu = NULL;
{
SFG_Menu *menu = NULL;
- freeglut_assert_ready;
-
/* It's enough to check all entries in fgStructure.Menus... */
for( menu = (SFG_Menu *)fgStructure.Menus.First;
menu;
/* It's enough to check all entries in fgStructure.Menus... */
for( menu = (SFG_Menu *)fgStructure.Menus.First;
menu;