9353d22d99c277fe323808ad61a9810484c95b84
[freeglut] / include / GL / freeglut_ext.h
1 #ifndef  __FREEGLUT_EXT_H__
2 #define  __FREEGLUT_EXT_H__
3
4 /*
5  * freeglut_ext.h
6  *
7  * The non-GLUT-compatible extensions to the freeglut library include file
8  *
9  * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
10  * Written by Pawel W. Olszta, <olszta@sourceforge.net>
11  * Creation date: Thu Dec 2 1999
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
26  * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
27  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  */
30
31 #ifdef __cplusplus
32     extern "C" {
33 #endif
34
35 /*
36  * Additional GLUT Key definitions for the Special key function
37  */
38 #define GLUT_KEY_NUM_LOCK           0x006D
39 #define GLUT_KEY_BEGIN              0x006E
40 #define GLUT_KEY_DELETE             0x006F
41 #define GLUT_KEY_SHIFT_L            0x0070
42 #define GLUT_KEY_SHIFT_R            0x0071
43 #define GLUT_KEY_CTRL_L             0x0072
44 #define GLUT_KEY_CTRL_R             0x0073
45 #define GLUT_KEY_ALT_L              0x0074
46 #define GLUT_KEY_ALT_R              0x0075
47
48 /*
49  * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
50  */
51 #define GLUT_ACTION_EXIT                         0
52 #define GLUT_ACTION_GLUTMAINLOOP_RETURNS         1
53 #define GLUT_ACTION_CONTINUE_EXECUTION           2
54
55 /*
56  * Create a new rendering context when the user opens a new window?
57  */
58 #define GLUT_CREATE_NEW_CONTEXT                  0
59 #define GLUT_USE_CURRENT_CONTEXT                 1
60
61 /*
62  * Direct/Indirect rendering context options (has meaning only in Unix/X11)
63  */
64 #define GLUT_FORCE_INDIRECT_CONTEXT              0
65 #define GLUT_ALLOW_DIRECT_CONTEXT                1
66 #define GLUT_TRY_DIRECT_CONTEXT                  2
67 #define GLUT_FORCE_DIRECT_CONTEXT                3
68
69 /*
70  * GLUT API Extension macro definitions -- the glutGet parameters
71  */
72 #define  GLUT_INIT_STATE                    0x007C
73
74 #define  GLUT_ACTION_ON_WINDOW_CLOSE        0x01F9
75
76 #define  GLUT_WINDOW_BORDER_WIDTH           0x01FA
77 #define  GLUT_WINDOW_HEADER_HEIGHT          0x01FB
78
79 #define  GLUT_VERSION                       0x01FC
80
81 #define  GLUT_RENDERING_CONTEXT             0x01FD
82 #define  GLUT_DIRECT_RENDERING              0x01FE
83
84 #define  GLUT_FULL_SCREEN                   0x01FF
85
86 /*
87  * New tokens for glutInitDisplayMode.
88  * Only one GLUT_AUXn bit may be used at a time.
89  * Value 0x0400 is defined in OpenGLUT.
90  */
91 #define  GLUT_AUX                           0x1000
92
93 #define  GLUT_AUX1                          0x1000
94 #define  GLUT_AUX2                          0x2000
95 #define  GLUT_AUX3                          0x4000
96 #define  GLUT_AUX4                          0x8000
97
98 /*
99  * Context-related flags, see freeglut_state.c
100  * Set the requested OpenGL version
101  */
102 #define  GLUT_INIT_MAJOR_VERSION            0x0200
103 #define  GLUT_INIT_MINOR_VERSION            0x0201
104 #define  GLUT_INIT_FLAGS                    0x0202
105 #define  GLUT_INIT_PROFILE                  0x0203
106
107 /*
108  * Flags for glutInitContextFlags, see freeglut_init.c
109  */
110 #define  GLUT_DEBUG                         0x0001
111 #define  GLUT_FORWARD_COMPATIBLE            0x0002
112
113
114 /*
115  * Flags for glutInitContextProfile, see freeglut_init.c
116  */
117 #define GLUT_CORE_PROFILE                   0x0001
118 #define GLUT_COMPATIBILITY_PROFILE          0x0002
119
120 /*
121  * Process loop function, see freeglut_main.c
122  */
123 FGAPI void    FGAPIENTRY glutMainLoopEvent( void );
124 FGAPI void    FGAPIENTRY glutLeaveMainLoop( void );
125 FGAPI void    FGAPIENTRY glutExit         ( void );
126
127 /*
128  * Window management functions, see freeglut_window.c
129  */
130 FGAPI void    FGAPIENTRY glutFullScreenToggle( void );
131 FGAPI void    FGAPIENTRY glutLeaveFullScreen( void );
132
133 /*
134  * Window-specific callback functions, see freeglut_callbacks.c
135  */
136 FGAPI void    FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) );
137 FGAPI void    FGAPIENTRY glutCloseFunc( void (* callback)( void ) );
138 FGAPI void    FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) );
139 /* A. Donev: Also a destruction callback for menus */
140 FGAPI void    FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) );
141
142 /*
143  * State setting and retrieval functions, see freeglut_state.c
144  */
145 FGAPI void    FGAPIENTRY glutSetOption ( GLenum option_flag, int value );
146 FGAPI int *   FGAPIENTRY glutGetModeValues(GLenum mode, int * size);
147 /* A.Donev: User-data manipulation */
148 FGAPI void*   FGAPIENTRY glutGetWindowData( void );
149 FGAPI void    FGAPIENTRY glutSetWindowData(void* data);
150 FGAPI void*   FGAPIENTRY glutGetMenuData( void );
151 FGAPI void    FGAPIENTRY glutSetMenuData(void* data);
152
153 /*
154  * Font stuff, see freeglut_font.c
155  */
156 FGAPI int     FGAPIENTRY glutBitmapHeight( void* font );
157 FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font );
158 FGAPI void    FGAPIENTRY glutBitmapString( void* font, const unsigned char *string );
159 FGAPI void    FGAPIENTRY glutStrokeString( void* font, const unsigned char *string );
160
161 /*
162  * Geometry functions, see freeglut_geometry.c
163  */
164 FGAPI void    FGAPIENTRY glutWireRhombicDodecahedron( void );
165 FGAPI void    FGAPIENTRY glutSolidRhombicDodecahedron( void );
166
167 #ifdef EGL_VERSION_1_0
168 /* TODO: temporary work-around for missing GLdouble in GLES */
169 #   define GLdouble     GLfloat
170 #endif
171 FGAPI void    FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
172 FGAPI void    FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
173 FGAPI void    FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
174 FGAPI void    FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
175 #ifdef EGL_VERSION_1_0
176 #   undef GLdouble
177 #endif
178
179 /*
180  * Extension functions, see freeglut_ext.c
181  */
182 typedef void (*GLUTproc)();
183 FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName );
184
185 /*
186  * Multi-touch/multi-pointer extensions
187  */
188
189 #define GLUT_HAS_MULTI 1
190
191 FGAPI void FGAPIENTRY glutMultiEntryFunc( void (* callback)( int, int ) );
192 FGAPI void FGAPIENTRY glutMultiButtonFunc( void (* callback)( int, int, int, int, int ) );
193 FGAPI void FGAPIENTRY glutMultiMotionFunc( void (* callback)( int, int, int ) );
194 FGAPI void FGAPIENTRY glutMultiPassiveFunc( void (* callback)( int, int, int ) );
195
196 /*
197  * Joystick functions, see freeglut_joystick.c
198  */
199 /* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */
200 /* If you have a serious need for these functions in your application, please either
201  * contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net,
202  * switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's
203  * "js" library.
204  */
205 int     glutJoystickGetNumAxes( int ident );
206 int     glutJoystickGetNumButtons( int ident );
207 int     glutJoystickNotWorking( int ident );
208 float   glutJoystickGetDeadBand( int ident, int axis );
209 void    glutJoystickSetDeadBand( int ident, int axis, float db );
210 float   glutJoystickGetSaturation( int ident, int axis );
211 void    glutJoystickSetSaturation( int ident, int axis, float st );
212 void    glutJoystickSetMinRange( int ident, float *axes );
213 void    glutJoystickSetMaxRange( int ident, float *axes );
214 void    glutJoystickSetCenter( int ident, float *axes );
215 void    glutJoystickGetMinRange( int ident, float *axes );
216 void    glutJoystickGetMaxRange( int ident, float *axes );
217 void    glutJoystickGetCenter( int ident, float *axes );
218
219 /*
220  * Initialization functions, see freeglut_init.c
221  */
222 FGAPI void    FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion );
223 FGAPI void    FGAPIENTRY glutInitContextFlags( int flags );
224 FGAPI void    FGAPIENTRY glutInitContextProfile( int profile );
225
226 /* to get the typedef for va_list */
227 #include <stdarg.h>
228
229 FGAPI void    FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) );
230 FGAPI void    FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) );
231
232 /*
233  * GLUT API macro definitions -- the display mode definitions
234  */
235 #define  GLUT_CAPTIONLESS                   0x0400
236 #define  GLUT_BORDERLESS                    0x0800
237 #define  GLUT_SRGB                          0x1000
238
239 #ifdef __cplusplus
240     }
241 #endif
242
243 /*** END OF FILE ***/
244
245 #endif /* __FREEGLUT_EXT_H__ */