Many updates from John Fay. (freeglut.h may need a small change to allow Win32 DLL build again)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@33 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
6d93edeb79
commit
d75f5e6d00
@ -36,12 +36,27 @@
|
||||
* Under windows, we've got some issues to solve
|
||||
*/
|
||||
#if defined(WIN32)
|
||||
#if 0
|
||||
# if defined(FREEGLUT_LIBRARY_BUILD)
|
||||
# define FGAPI __declspec(dllexport)
|
||||
# else
|
||||
# define FGAPI __declspec(dllimport)
|
||||
# endif
|
||||
# define FGAPIENTRY __stdcall
|
||||
#else
|
||||
# include <windows.h>
|
||||
# include <windowsx.h>
|
||||
# include <mmsystem.h>
|
||||
# define WINDOWS
|
||||
# define FGAPI
|
||||
# define FGAPIENTRY
|
||||
#endif
|
||||
|
||||
#pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
|
||||
#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
|
||||
#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */
|
||||
#pragma comment (lib, "freeglut.lib") /* link with Win32 freeglut lib */
|
||||
|
||||
#else
|
||||
# define FGAPI
|
||||
# define FGAPIENTRY
|
||||
@ -166,6 +181,13 @@
|
||||
# define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
|
||||
*/
|
||||
#define GLUT_ACTION_EXIT 0
|
||||
#define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1
|
||||
#define GLUT_ACTION_CONTINUE_EXECUTION 2
|
||||
|
||||
/*
|
||||
* GLUT API macro definitions -- the glutGet parameters
|
||||
*/
|
||||
@ -207,6 +229,8 @@
|
||||
#define GLUT_ELAPSED_TIME 0x02BC
|
||||
#define GLUT_WINDOW_FORMAT_ID 0x007B
|
||||
|
||||
#define GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9
|
||||
|
||||
/*
|
||||
* GLUT API macro definitions -- the glutDeviceGet parameters
|
||||
*/
|
||||
@ -335,6 +359,8 @@ FGAPI void FGAPIENTRY glutInitDisplayString( char* displayMode );
|
||||
* Process loop function, see freeglut_main.c
|
||||
*/
|
||||
FGAPI void FGAPIENTRY glutMainLoop( void );
|
||||
FGAPI void FGAPIENTRY glutMainLoopEvent( void );
|
||||
FGAPI void FGAPIENTRY glutLeaveMainLoop( void );
|
||||
|
||||
/*
|
||||
* Window management functions, see freeglut_window.c
|
||||
@ -412,6 +438,8 @@ FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int )
|
||||
FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) );
|
||||
FGAPI void FGAPIENTRY glutCloseFunc( void (* callback)( void ) );
|
||||
FGAPI void FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) );
|
||||
|
||||
FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) );
|
||||
FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) );
|
||||
@ -424,14 +452,16 @@ FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) );
|
||||
FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) );
|
||||
FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) );
|
||||
FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutBottonBoxFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) );
|
||||
FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) );
|
||||
|
||||
/*
|
||||
* State retrieval functions, see freeglut_state.c
|
||||
* State setting and retrieval functions, see freeglut_state.c
|
||||
*/
|
||||
FGAPI void FGAPIENTRY glutSetOption ( GLenum option_flag, int value ) ;
|
||||
|
||||
FGAPI int FGAPIENTRY glutGet( GLenum query );
|
||||
FGAPI int FGAPIENTRY glutDeviceGet( GLenum query );
|
||||
FGAPI int FGAPIENTRY glutGetModifiers( void );
|
||||
@ -471,6 +501,10 @@ FGAPI void FGAPIENTRY glutWireTetrahedron( void );
|
||||
FGAPI void FGAPIENTRY glutSolidTetrahedron( void );
|
||||
FGAPI void FGAPIENTRY glutWireIcosahedron( void );
|
||||
FGAPI void FGAPIENTRY glutSolidIcosahedron( void );
|
||||
FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void );
|
||||
FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void );
|
||||
FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLfloat offset[3], GLfloat scale ) ;
|
||||
FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLfloat offset[3], GLfloat scale ) ;
|
||||
|
||||
/*
|
||||
* Teapot rendering functions, found in freeglut_teapot.c
|
||||
@ -506,7 +540,7 @@ FGAPI void FGAPIENTRY glutCopyColormap( int window );
|
||||
* Misc keyboard and joystick functions, see freeglut_misc.c
|
||||
*/
|
||||
FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore );
|
||||
FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode );
|
||||
FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode ); /* DEPRECATED 11/4/02 - Do not use */
|
||||
FGAPI void FGAPIENTRY glutForceJoystickFunc( void );
|
||||
|
||||
/*
|
||||
|
@ -69,7 +69,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#if TARGET_HOST_UNIX_X11
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The system-dependant include files should go here:
|
||||
@ -130,6 +132,7 @@ typedef void (* FGCBdials )( int, int );
|
||||
typedef void (* FGCBbuttonBox )( int, int );
|
||||
typedef void (* FGCBtabletMotion )( int, int );
|
||||
typedef void (* FGCBtabletButton )( int, int, int, int );
|
||||
typedef void (* FGCBdestroy )( void );
|
||||
|
||||
/*
|
||||
* The global callbacks type definitions
|
||||
@ -187,6 +190,15 @@ struct tagSFG_Time
|
||||
GLboolean Set;
|
||||
};
|
||||
|
||||
/*
|
||||
* An enumeration containing the state of the GLUT execution: initializing, running, or stopping
|
||||
*/
|
||||
typedef enum {
|
||||
GLUT_EXEC_STATE_INIT,
|
||||
GLUT_EXEC_STATE_RUNNING,
|
||||
GLUT_EXEC_STATE_STOP
|
||||
} fgExecutionState ;
|
||||
|
||||
/*
|
||||
* This structure holds different freeglut settings
|
||||
*/
|
||||
@ -218,6 +230,10 @@ struct tagSFG_State
|
||||
SFG_XYUse GameModeSize; /* The game mode screen's dimensions */
|
||||
int GameModeDepth; /* The pixel depth for game mode */
|
||||
int GameModeRefresh; /* The refresh rate for game mode */
|
||||
|
||||
int ActionOnWindowClose ; /* Action when user clicks "x" on window header bar */
|
||||
|
||||
fgExecutionState ExecState ; /* Current state of the GLUT execution */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -264,7 +280,7 @@ struct tagSFG_Timer
|
||||
};
|
||||
|
||||
/*
|
||||
* A window and it's OpenGL context. The contents of this structure
|
||||
* A window and its OpenGL context. The contents of this structure
|
||||
* are highly dependant on the target operating system we aim at...
|
||||
*/
|
||||
typedef struct tagSFG_Context SFG_Context;
|
||||
@ -333,6 +349,7 @@ struct tagSFG_WindowCallbacks
|
||||
FGCBvisibility Visibility;
|
||||
FGCBwindowStatus WindowStatus;
|
||||
FGCBjoystick Joystick;
|
||||
FGCBdestroy Destroy;
|
||||
|
||||
/*
|
||||
* Those callbacks are being ignored for the moment
|
||||
@ -393,12 +410,23 @@ struct tagSFG_Window
|
||||
SFG_WindowCallbacks Callbacks; /* The window callbacks */
|
||||
|
||||
SFG_Menu* Menu[ FREEGLUT_MAX_MENUS ]; /* Menus appended to window */
|
||||
GLboolean MenuActive[ FREEGLUT_MAX_MENUS ]; /* The menus activity flags */
|
||||
SFG_Menu* ActiveMenu; /* The window's active menu */
|
||||
|
||||
SFG_Window* Parent; /* The parent to this window */
|
||||
SFG_List Children; /* The subwindows d.l. list */
|
||||
};
|
||||
|
||||
/*
|
||||
* A linked list structure of windows
|
||||
*/
|
||||
typedef struct tagSFG_WindowList SFG_WindowList ;
|
||||
struct tagSFG_WindowList
|
||||
{
|
||||
SFG_Window *window ;
|
||||
GLboolean needToClose ;
|
||||
SFG_WindowList *next ;
|
||||
} ;
|
||||
|
||||
/*
|
||||
* This holds information about all the windows, menus etc.
|
||||
*/
|
||||
@ -419,9 +447,9 @@ struct tagSFG_Structure
|
||||
|
||||
/*
|
||||
* This structure is used for the enumeration purposes.
|
||||
* You can easily extend it's functionalities by declaring
|
||||
* You can easily extend its functionalities by declaring
|
||||
* a structure containing enumerator's contents and custom
|
||||
* data, then casting it's pointer to (SFG_Enumerator *).
|
||||
* data, then casting its pointer to (SFG_Enumerator *).
|
||||
*/
|
||||
typedef struct tagSFG_Enumerator SFG_Enumerator;
|
||||
struct tagSFG_Enumerator
|
||||
@ -441,6 +469,8 @@ struct tagSFG_Font
|
||||
int Quantity; /* Number of chars in font */
|
||||
int Height; /* Height of the characters */
|
||||
const GLubyte** Characters; /* The characters mapping */
|
||||
|
||||
float xorig, yorig ; /* The origin of the character relative to the draw location */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -554,8 +584,10 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly );
|
||||
* Defined in freeglut_structure.c, freeglut_window.c.
|
||||
*/
|
||||
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, int x, int y, int w, int h, GLboolean gameMode );
|
||||
void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, int h, GLboolean gameMode );
|
||||
void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, int h, GLboolean gameMode, int isSubWindow );
|
||||
void fgCloseWindow( SFG_Window* window );
|
||||
void fgAddToWindowDestroyList ( SFG_Window* window, GLboolean needToClose ) ;
|
||||
void fgCloseWindows () ;
|
||||
void fgDestroyWindow( SFG_Window* window, GLboolean needToClose );
|
||||
|
||||
/*
|
||||
@ -606,7 +638,7 @@ void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback, SFG_Enum
|
||||
SFG_Window* fgWindowByID( int windowID );
|
||||
|
||||
/*
|
||||
* Looks up a menu given it's ID. This is easier that fgWindowByXXX
|
||||
* Looks up a menu given its ID. This is easier that fgWindowByXXX
|
||||
* as all menus are placed in a single doubly linked list...
|
||||
*/
|
||||
SFG_Menu* fgMenuByID( int menuID );
|
||||
@ -615,8 +647,10 @@ SFG_Menu* fgMenuByID( int menuID );
|
||||
* The menu activation and deactivation the code. This is the meat
|
||||
* of the menu user interface handling code...
|
||||
*/
|
||||
void fgActivateMenu( int button );
|
||||
void fgDeactivateMenu( int button );
|
||||
void fgActivateMenu( SFG_Window* window, int button );
|
||||
void fgExecuteMenuCallback( SFG_Menu* menu ) ;
|
||||
GLboolean fgCheckActiveMenu ( SFG_Window *window, SFG_Menu *menu ) ;
|
||||
void fgDeactivateMenu( SFG_Window *window );
|
||||
|
||||
/*
|
||||
* This function gets called just before the buffers swap, so that
|
||||
|
Reference in New Issue
Block a user