Path: blob/main/system/include/GL/freeglut_std.h
6162 views
#ifndef __FREEGLUT_STD_H__1#define __FREEGLUT_STD_H__23/*4* freeglut_std.h5*6* The GLUT-compatible part of the freeglut library include file7*8* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.9* Written by Pawel W. Olszta, <[email protected]>10* Creation date: Thu Dec 2 199911*12* Permission is hereby granted, free of charge, to any person obtaining a13* copy of this software and associated documentation files (the "Software"),14* to deal in the Software without restriction, including without limitation15* the rights to use, copy, modify, merge, publish, distribute, sublicense,16* and/or sell copies of the Software, and to permit persons to whom the17* Software is furnished to do so, subject to the following conditions:18*19* The above copyright notice and this permission notice shall be included20* in all copies or substantial portions of the Software.21*22* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS23* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,24* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL25* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER26* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN27* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.28*/2930#ifdef __cplusplus31extern "C" {32#endif3334/*35* Under windows, we have to differentiate between static and dynamic libraries36*/37#ifdef _WIN3238/* #pragma may not be supported by some compilers.39* Discussion by FreeGLUT developers suggests that40* Visual C++ specific code involving pragmas may41* need to move to a separate header. 24th Dec 200342*/4344/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library45* pragmas or to 0 to exclude library pragmas.46* The default behavior depends on the compiler/platform.47*/48# ifndef FREEGLUT_LIB_PRAGMAS49# if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE)50# define FREEGLUT_LIB_PRAGMAS 151# else52# define FREEGLUT_LIB_PRAGMAS 053# endif54# endif5556# ifndef WIN32_LEAN_AND_MEAN57# define WIN32_LEAN_AND_MEAN 158# endif59# ifndef NOMINMAX60# define NOMINMAX61# endif62# include <windows.h>6364/* Windows static library */65# ifdef FREEGLUT_STATIC6667# define FGAPI68# define FGAPIENTRY6970/* Link with Win32 static freeglut lib */71# if FREEGLUT_LIB_PRAGMAS72# pragma comment (lib, "freeglut_static.lib")73# endif7475/* Windows shared library (DLL) */76# else7778# define FGAPIENTRY __stdcall79# if defined(FREEGLUT_EXPORTS)80# define FGAPI __declspec(dllexport)81# else82# define FGAPI __declspec(dllimport)8384/* Link with Win32 shared freeglut lib */85# if FREEGLUT_LIB_PRAGMAS86# pragma comment (lib, "freeglut.lib")87# endif8889# endif9091# endif9293/* Drag in other Windows libraries as required by FreeGLUT */94# if FREEGLUT_LIB_PRAGMAS95# pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */96# pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */97# pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */98# pragma comment (lib, "winmm.lib") /* link Windows MultiMedia lib */99# pragma comment (lib, "user32.lib") /* link Windows user lib */100# endif101102#else103104/* Non-Windows definition of FGAPI and FGAPIENTRY */105# define FGAPI106# define FGAPIENTRY107108#endif109110/*111* The freeglut and GLUT API versions112*/113#define FREEGLUT 1114#define GLUT_API_VERSION 4115#define FREEGLUT_VERSION_2_0 1116#define GLUT_XLIB_IMPLEMENTATION 13117118/*119* Always include OpenGL and GLU headers120*/121#include <GL/gl.h>122#include <GL/glu.h>123124/*125* GLUT API macro definitions -- the special key codes:126*/127#define GLUT_KEY_F1 0x0001128#define GLUT_KEY_F2 0x0002129#define GLUT_KEY_F3 0x0003130#define GLUT_KEY_F4 0x0004131#define GLUT_KEY_F5 0x0005132#define GLUT_KEY_F6 0x0006133#define GLUT_KEY_F7 0x0007134#define GLUT_KEY_F8 0x0008135#define GLUT_KEY_F9 0x0009136#define GLUT_KEY_F10 0x000A137#define GLUT_KEY_F11 0x000B138#define GLUT_KEY_F12 0x000C139#define GLUT_KEY_LEFT 0x0064140#define GLUT_KEY_UP 0x0065141#define GLUT_KEY_RIGHT 0x0066142#define GLUT_KEY_DOWN 0x0067143#define GLUT_KEY_PAGE_UP 0x0068144#define GLUT_KEY_PAGE_DOWN 0x0069145#define GLUT_KEY_HOME 0x006A146#define GLUT_KEY_END 0x006B147#define GLUT_KEY_INSERT 0x006C148149/*150* GLUT API macro definitions -- mouse state definitions151*/152#define GLUT_LEFT_BUTTON 0x0000153#define GLUT_MIDDLE_BUTTON 0x0001154#define GLUT_RIGHT_BUTTON 0x0002155#define GLUT_DOWN 0x0000156#define GLUT_UP 0x0001157#define GLUT_LEFT 0x0000158#define GLUT_ENTERED 0x0001159160/*161* GLUT API macro definitions -- the display mode definitions162*/163#define GLUT_RGB 0x0000164#define GLUT_RGBA 0x0000165#define GLUT_INDEX 0x0001166#define GLUT_SINGLE 0x0000167#define GLUT_DOUBLE 0x0002168#define GLUT_ACCUM 0x0004169#define GLUT_ALPHA 0x0008170#define GLUT_DEPTH 0x0010171#define GLUT_STENCIL 0x0020172#define GLUT_MULTISAMPLE 0x0080173#define GLUT_STEREO 0x0100174#define GLUT_LUMINANCE 0x0200175176/*177* GLUT API macro definitions -- windows and menu related definitions178*/179#define GLUT_MENU_NOT_IN_USE 0x0000180#define GLUT_MENU_IN_USE 0x0001181#define GLUT_NOT_VISIBLE 0x0000182#define GLUT_VISIBLE 0x0001183#define GLUT_HIDDEN 0x0000184#define GLUT_FULLY_RETAINED 0x0001185#define GLUT_PARTIALLY_RETAINED 0x0002186#define GLUT_FULLY_COVERED 0x0003187188/*189* GLUT API macro definitions -- fonts definitions190*191* Steve Baker suggested to make it binary compatible with GLUT:192*/193#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__)194# define GLUT_STROKE_ROMAN ((void *)0x0000)195# define GLUT_STROKE_MONO_ROMAN ((void *)0x0001)196# define GLUT_BITMAP_9_BY_15 ((void *)0x0002)197# define GLUT_BITMAP_8_BY_13 ((void *)0x0003)198# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004)199# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005)200# define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006)201# define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007)202# define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008)203#else204/*205* I don't really know if it's a good idea... But here it goes:206*/207extern void* glutStrokeRoman;208extern void* glutStrokeMonoRoman;209extern void* glutBitmap9By15;210extern void* glutBitmap8By13;211extern void* glutBitmapTimesRoman10;212extern void* glutBitmapTimesRoman24;213extern void* glutBitmapHelvetica10;214extern void* glutBitmapHelvetica12;215extern void* glutBitmapHelvetica18;216217/*218* Those pointers will be used by following definitions:219*/220# define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman)221# define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman)222# define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15)223# define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13)224# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10)225# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24)226# define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10)227# define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12)228# define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18)229#endif230231/*232* GLUT API macro definitions -- the glutGet parameters233*/234#define GLUT_WINDOW_X 0x0064235#define GLUT_WINDOW_Y 0x0065236#define GLUT_WINDOW_WIDTH 0x0066237#define GLUT_WINDOW_HEIGHT 0x0067238#define GLUT_WINDOW_BUFFER_SIZE 0x0068239#define GLUT_WINDOW_STENCIL_SIZE 0x0069240#define GLUT_WINDOW_DEPTH_SIZE 0x006A241#define GLUT_WINDOW_RED_SIZE 0x006B242#define GLUT_WINDOW_GREEN_SIZE 0x006C243#define GLUT_WINDOW_BLUE_SIZE 0x006D244#define GLUT_WINDOW_ALPHA_SIZE 0x006E245#define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F246#define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070247#define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071248#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072249#define GLUT_WINDOW_DOUBLEBUFFER 0x0073250#define GLUT_WINDOW_RGBA 0x0074251#define GLUT_WINDOW_PARENT 0x0075252#define GLUT_WINDOW_NUM_CHILDREN 0x0076253#define GLUT_WINDOW_COLORMAP_SIZE 0x0077254#define GLUT_WINDOW_NUM_SAMPLES 0x0078255#define GLUT_WINDOW_STEREO 0x0079256#define GLUT_WINDOW_CURSOR 0x007A257258#define GLUT_SCREEN_WIDTH 0x00C8259#define GLUT_SCREEN_HEIGHT 0x00C9260#define GLUT_SCREEN_WIDTH_MM 0x00CA261#define GLUT_SCREEN_HEIGHT_MM 0x00CB262#define GLUT_MENU_NUM_ITEMS 0x012C263#define GLUT_DISPLAY_MODE_POSSIBLE 0x0190264#define GLUT_INIT_WINDOW_X 0x01F4265#define GLUT_INIT_WINDOW_Y 0x01F5266#define GLUT_INIT_WINDOW_WIDTH 0x01F6267#define GLUT_INIT_WINDOW_HEIGHT 0x01F7268#define GLUT_INIT_DISPLAY_MODE 0x01F8269#define GLUT_ELAPSED_TIME 0x02BC270#define GLUT_WINDOW_FORMAT_ID 0x007B271272/*273* GLUT API macro definitions -- the glutDeviceGet parameters274*/275#define GLUT_HAS_KEYBOARD 0x0258276#define GLUT_HAS_MOUSE 0x0259277#define GLUT_HAS_SPACEBALL 0x025A278#define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B279#define GLUT_HAS_TABLET 0x025C280#define GLUT_NUM_MOUSE_BUTTONS 0x025D281#define GLUT_NUM_SPACEBALL_BUTTONS 0x025E282#define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F283#define GLUT_NUM_DIALS 0x0260284#define GLUT_NUM_TABLET_BUTTONS 0x0261285#define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262286#define GLUT_DEVICE_KEY_REPEAT 0x0263287#define GLUT_HAS_JOYSTICK 0x0264288#define GLUT_OWNS_JOYSTICK 0x0265289#define GLUT_JOYSTICK_BUTTONS 0x0266290#define GLUT_JOYSTICK_AXES 0x0267291#define GLUT_JOYSTICK_POLL_RATE 0x0268292293/*294* GLUT API macro definitions -- the glutLayerGet parameters295*/296#define GLUT_OVERLAY_POSSIBLE 0x0320297#define GLUT_LAYER_IN_USE 0x0321298#define GLUT_HAS_OVERLAY 0x0322299#define GLUT_TRANSPARENT_INDEX 0x0323300#define GLUT_NORMAL_DAMAGED 0x0324301#define GLUT_OVERLAY_DAMAGED 0x0325302303/*304* GLUT API macro definitions -- the glutVideoResizeGet parameters305*/306#define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384307#define GLUT_VIDEO_RESIZE_IN_USE 0x0385308#define GLUT_VIDEO_RESIZE_X_DELTA 0x0386309#define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387310#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388311#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389312#define GLUT_VIDEO_RESIZE_X 0x038A313#define GLUT_VIDEO_RESIZE_Y 0x038B314#define GLUT_VIDEO_RESIZE_WIDTH 0x038C315#define GLUT_VIDEO_RESIZE_HEIGHT 0x038D316317/*318* GLUT API macro definitions -- the glutUseLayer parameters319*/320#define GLUT_NORMAL 0x0000321#define GLUT_OVERLAY 0x0001322323/*324* GLUT API macro definitions -- the glutGetModifiers parameters325*/326#define GLUT_ACTIVE_SHIFT 0x0001327#define GLUT_ACTIVE_CTRL 0x0002328#define GLUT_ACTIVE_ALT 0x0004329330/*331* GLUT API macro definitions -- the glutSetCursor parameters332*/333#define GLUT_CURSOR_RIGHT_ARROW 0x0000334#define GLUT_CURSOR_LEFT_ARROW 0x0001335#define GLUT_CURSOR_INFO 0x0002336#define GLUT_CURSOR_DESTROY 0x0003337#define GLUT_CURSOR_HELP 0x0004338#define GLUT_CURSOR_CYCLE 0x0005339#define GLUT_CURSOR_SPRAY 0x0006340#define GLUT_CURSOR_WAIT 0x0007341#define GLUT_CURSOR_TEXT 0x0008342#define GLUT_CURSOR_CROSSHAIR 0x0009343#define GLUT_CURSOR_UP_DOWN 0x000A344#define GLUT_CURSOR_LEFT_RIGHT 0x000B345#define GLUT_CURSOR_TOP_SIDE 0x000C346#define GLUT_CURSOR_BOTTOM_SIDE 0x000D347#define GLUT_CURSOR_LEFT_SIDE 0x000E348#define GLUT_CURSOR_RIGHT_SIDE 0x000F349#define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010350#define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011351#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012352#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013353#define GLUT_CURSOR_INHERIT 0x0064354#define GLUT_CURSOR_NONE 0x0065355#define GLUT_CURSOR_FULL_CROSSHAIR 0x0066356357/*358* GLUT API macro definitions -- RGB color component specification definitions359*/360#define GLUT_RED 0x0000361#define GLUT_GREEN 0x0001362#define GLUT_BLUE 0x0002363364/*365* GLUT API macro definitions -- additional keyboard and joystick definitions366*/367#define GLUT_KEY_REPEAT_OFF 0x0000368#define GLUT_KEY_REPEAT_ON 0x0001369#define GLUT_KEY_REPEAT_DEFAULT 0x0002370371#define GLUT_JOYSTICK_BUTTON_A 0x0001372#define GLUT_JOYSTICK_BUTTON_B 0x0002373#define GLUT_JOYSTICK_BUTTON_C 0x0004374#define GLUT_JOYSTICK_BUTTON_D 0x0008375376/*377* GLUT API macro definitions -- game mode definitions378*/379#define GLUT_GAME_MODE_ACTIVE 0x0000380#define GLUT_GAME_MODE_POSSIBLE 0x0001381#define GLUT_GAME_MODE_WIDTH 0x0002382#define GLUT_GAME_MODE_HEIGHT 0x0003383#define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004384#define GLUT_GAME_MODE_REFRESH_RATE 0x0005385#define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006386387/*388* Initialization functions, see fglut_init.c389*/390FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv );391FGAPI void FGAPIENTRY glutInitWindowPosition( int x, int y );392FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height );393FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode );394FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode );395396/*397* Process loop function, see freeglut_main.c398*/399FGAPI void FGAPIENTRY glutMainLoop( void );400401/*402* Window management functions, see freeglut_window.c403*/404FGAPI int FGAPIENTRY glutCreateWindow( const char* title );405FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height );406FGAPI void FGAPIENTRY glutDestroyWindow( int window );407FGAPI void FGAPIENTRY glutSetWindow( int window );408FGAPI int FGAPIENTRY glutGetWindow( void );409FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title );410FGAPI void FGAPIENTRY glutSetIconTitle( const char* title );411FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height );412FGAPI void FGAPIENTRY glutPositionWindow( int x, int y );413FGAPI void FGAPIENTRY glutShowWindow( void );414FGAPI void FGAPIENTRY glutHideWindow( void );415FGAPI void FGAPIENTRY glutIconifyWindow( void );416FGAPI void FGAPIENTRY glutPushWindow( void );417FGAPI void FGAPIENTRY glutPopWindow( void );418FGAPI void FGAPIENTRY glutFullScreen( void );419420/*421* Display-connected functions, see freeglut_display.c422*/423FGAPI void FGAPIENTRY glutPostWindowRedisplay( int window );424FGAPI void FGAPIENTRY glutPostRedisplay( void );425FGAPI void FGAPIENTRY glutSwapBuffers( void );426427/*428* Mouse cursor functions, see freeglut_cursor.c429*/430FGAPI void FGAPIENTRY glutWarpPointer( int x, int y );431FGAPI void FGAPIENTRY glutSetCursor( int cursor );432433/*434* Overlay stuff, see freeglut_overlay.c435*/436FGAPI void FGAPIENTRY glutEstablishOverlay( void );437FGAPI void FGAPIENTRY glutRemoveOverlay( void );438FGAPI void FGAPIENTRY glutUseLayer( GLenum layer );439FGAPI void FGAPIENTRY glutPostOverlayRedisplay( void );440FGAPI void FGAPIENTRY glutPostWindowOverlayRedisplay( int window );441FGAPI void FGAPIENTRY glutShowOverlay( void );442FGAPI void FGAPIENTRY glutHideOverlay( void );443444/*445* Menu stuff, see freeglut_menu.c446*/447FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) );448FGAPI void FGAPIENTRY glutDestroyMenu( int menu );449FGAPI int FGAPIENTRY glutGetMenu( void );450FGAPI void FGAPIENTRY glutSetMenu( int menu );451FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value );452FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu );453FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value );454FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value );455FGAPI void FGAPIENTRY glutRemoveMenuItem( int item );456FGAPI void FGAPIENTRY glutAttachMenu( int button );457FGAPI void FGAPIENTRY glutDetachMenu( int button );458459/*460* Global callback functions, see freeglut_callbacks.c461*/462FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value );463FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) );464465/*466* Window-specific callback functions, see freeglut_callbacks.c467*/468FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) );469FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) );470FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) );471FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) );472FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) );473FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) );474FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) );475FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) );476FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) );477478FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) );479FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) );480FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval );481FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) );482FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) );483FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) );484FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) );485486FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) );487FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) );488FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) );489FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) );490FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) );491FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) );492FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) );493494/*495* State setting and retrieval functions, see freeglut_state.c496*/497FGAPI int FGAPIENTRY glutGet( GLenum query );498FGAPI int FGAPIENTRY glutDeviceGet( GLenum query );499FGAPI int FGAPIENTRY glutGetModifiers( void );500FGAPI int FGAPIENTRY glutLayerGet( GLenum query );501502/*503* Font stuff, see freeglut_font.c504*/505FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character );506FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character );507FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character );508FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character );509FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string );510FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string );511512/*513* Geometry functions, see freeglut_geometry.c514*/515FGAPI void FGAPIENTRY glutWireCube( GLdouble size );516FGAPI void FGAPIENTRY glutSolidCube( GLdouble size );517FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks );518FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks );519FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );520FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );521522FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );523FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );524FGAPI void FGAPIENTRY glutWireDodecahedron( void );525FGAPI void FGAPIENTRY glutSolidDodecahedron( void );526FGAPI void FGAPIENTRY glutWireOctahedron( void );527FGAPI void FGAPIENTRY glutSolidOctahedron( void );528FGAPI void FGAPIENTRY glutWireTetrahedron( void );529FGAPI void FGAPIENTRY glutSolidTetrahedron( void );530FGAPI void FGAPIENTRY glutWireIcosahedron( void );531FGAPI void FGAPIENTRY glutSolidIcosahedron( void );532533/*534* Teapot rendering functions, found in freeglut_teapot.c535*/536FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size );537FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size );538539/*540* Game mode functions, see freeglut_gamemode.c541*/542FGAPI void FGAPIENTRY glutGameModeString( const char* string );543FGAPI int FGAPIENTRY glutEnterGameMode( void );544FGAPI void FGAPIENTRY glutLeaveGameMode( void );545FGAPI int FGAPIENTRY glutGameModeGet( GLenum query );546547/*548* Video resize functions, see freeglut_videoresize.c549*/550FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query );551FGAPI void FGAPIENTRY glutSetupVideoResizing( void );552FGAPI void FGAPIENTRY glutStopVideoResizing( void );553FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height );554FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height );555556/*557* Colormap functions, see freeglut_misc.c558*/559FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue );560FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component );561FGAPI void FGAPIENTRY glutCopyColormap( int window );562563/*564* Misc keyboard and joystick functions, see freeglut_misc.c565*/566FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore );567FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode );568FGAPI void FGAPIENTRY glutForceJoystickFunc( void );569570/*571* Misc functions, see freeglut_misc.c572*/573FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension );574FGAPI void FGAPIENTRY glutReportErrors( void );575576/* Comment from glut.h of classic GLUT:577578Win32 has an annoying issue where there are multiple C run-time579libraries (CRTs). If the executable is linked with a different CRT580from the GLUT DLL, the GLUT DLL will not share the same CRT static581data seen by the executable. In particular, atexit callbacks registered582in the executable will not be called if GLUT calls its (different)583exit routine). GLUT is typically built with the584"/MD" option (the CRT with multithreading DLL support), but the Visual585C++ linker default is "/ML" (the single threaded CRT).586587One workaround to this issue is requiring users to always link with588the same CRT as GLUT is compiled with. That requires users supply a589non-standard option. GLUT 3.7 has its own built-in workaround where590the executable's "exit" function pointer is covertly passed to GLUT.591GLUT then calls the executable's exit function pointer to ensure that592any "atexit" calls registered by the application are called if GLUT593needs to exit.594595Note that the __glut*WithExit routines should NEVER be called directly.596To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */597598/* to get the prototype for exit() */599#include <stdlib.h>600601#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__)602FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));603FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));604FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));605#ifndef FREEGLUT_BUILDING_LIB606#if defined(__GNUC__)607#define FGUNUSED __attribute__((unused))608#else609#define FGUNUSED610#endif611static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }612#define glutInit glutInit_ATEXIT_HACK613static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }614#define glutCreateWindow glutCreateWindow_ATEXIT_HACK615static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }616#define glutCreateMenu glutCreateMenu_ATEXIT_HACK617#endif618#endif619620#ifdef __cplusplus621}622#endif623624/*** END OF FILE ***/625626#endif /* __FREEGLUT_STD_H__ */627628629630