Removing some errant tabs, fixing ticket #2137721, and adding special-key capability...
[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
42 /*
43  * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
44  */
45 #define GLUT_ACTION_EXIT                         0
46 #define GLUT_ACTION_GLUTMAINLOOP_RETURNS         1
47 #define GLUT_ACTION_CONTINUE_EXECUTION           2
48
49 /*
50  * Create a new rendering context when the user opens a new window?
51  */
52 #define GLUT_CREATE_NEW_CONTEXT                  0
53 #define GLUT_USE_CURRENT_CONTEXT                 1
54
55 /*
56  * Direct/Indirect rendering context options (has meaning only in Unix/X11)
57  */
58 #define GLUT_FORCE_INDIRECT_CONTEXT              0
59 #define GLUT_ALLOW_DIRECT_CONTEXT                1
60 #define GLUT_TRY_DIRECT_CONTEXT                  2
61 #define GLUT_FORCE_DIRECT_CONTEXT                3
62
63 /*
64  * GLUT API Extension macro definitions -- the glutGet parameters
65  */
66 #define  GLUT_INIT_STATE                    0x007C
67
68 #define  GLUT_ACTION_ON_WINDOW_CLOSE        0x01F9
69
70 #define  GLUT_WINDOW_BORDER_WIDTH           0x01FA
71 #define  GLUT_WINDOW_HEADER_HEIGHT          0x01FB
72
73 #define  GLUT_VERSION                       0x01FC
74
75 #define  GLUT_RENDERING_CONTEXT             0x01FD
76 #define  GLUT_DIRECT_RENDERING              0x01FE
77
78 #define  GLUT_FULL_SCREEN                   0x01FF
79
80 /*
81  * New tokens for glutInitDisplayMode.
82  * Only one GLUT_AUXn bit may be used at a time.
83  * Value 0x0400 is defined in OpenGLUT.
84  */
85 #define  GLUT_AUX                           0x1000
86
87 #define  GLUT_AUX1                          0x1000
88 #define  GLUT_AUX2                          0x2000
89 #define  GLUT_AUX3                          0x4000
90 #define  GLUT_AUX4                          0x8000
91
92 /*
93  * Context-related flags, see freeglut_state.c
94  */
95 #define  GLUT_INIT_MAJOR_VERSION            0x0200
96 #define  GLUT_INIT_MINOR_VERSION            0x0201
97 #define  GLUT_INIT_FLAGS                    0x0202
98
99 /*
100  * Flags for glutInitContextFlags, see freeglut_init.c
101  */
102 #define  GLUT_DEBUG                         0x0001
103 #define  GLUT_FORWARD_COMPATIBLE            0x0002
104
105 /*
106  * Process loop function, see freeglut_main.c
107  */
108 FGAPI void    FGAPIENTRY glutMainLoopEvent( void );
109 FGAPI void    FGAPIENTRY glutLeaveMainLoop( void );
110 FGAPI void    FGAPIENTRY glutExit         ( void );
111
112 /*
113  * Window management functions, see freeglut_window.c
114  */
115 FGAPI void    FGAPIENTRY glutFullScreenToggle( void );
116
117 /*
118  * Window-specific callback functions, see freeglut_callbacks.c
119  */
120 FGAPI void    FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) );
121 FGAPI void    FGAPIENTRY glutCloseFunc( void (* callback)( void ) );
122 FGAPI void    FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) );
123 /* A. Donev: Also a destruction callback for menus */
124 FGAPI void    FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) );
125
126 /*
127  * State setting and retrieval functions, see freeglut_state.c
128  */
129 FGAPI void    FGAPIENTRY glutSetOption ( GLenum option_flag, int value );
130 FGAPI int *   FGAPIENTRY glutGetModeValues(GLenum mode, int * size);
131 /* A.Donev: User-data manipulation */
132 FGAPI void*   FGAPIENTRY glutGetWindowData( void );
133 FGAPI void    FGAPIENTRY glutSetWindowData(void* data);
134 FGAPI void*   FGAPIENTRY glutGetMenuData( void );
135 FGAPI void    FGAPIENTRY glutSetMenuData(void* data);
136
137 /*
138  * Font stuff, see freeglut_font.c
139  */
140 FGAPI int     FGAPIENTRY glutBitmapHeight( void* font );
141 FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font );
142 FGAPI void    FGAPIENTRY glutBitmapString( void* font, const unsigned char *string );
143 FGAPI void    FGAPIENTRY glutStrokeString( void* font, const unsigned char *string );
144
145 /*
146  * Geometry functions, see freeglut_geometry.c
147  */
148 FGAPI void    FGAPIENTRY glutWireRhombicDodecahedron( void );
149 FGAPI void    FGAPIENTRY glutSolidRhombicDodecahedron( void );
150 FGAPI void    FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
151 FGAPI void    FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
152 FGAPI void    FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
153 FGAPI void    FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
154
155 /*
156  * Extension functions, see freeglut_ext.c
157  */
158 typedef void (*GLUTproc)();
159 FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName );
160
161 /*
162  * Joystick functions, see freeglut_joystick.c
163  */
164 /* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */
165 /* If you have a serious need for these functions in your application, please either
166  * contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net,
167  * switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's
168  * "js" library.
169  */
170 int     glutJoystickGetNumAxes( int ident );
171 int     glutJoystickGetNumButtons( int ident );
172 int     glutJoystickNotWorking( int ident );
173 float   glutJoystickGetDeadBand( int ident, int axis );
174 void    glutJoystickSetDeadBand( int ident, int axis, float db );
175 float   glutJoystickGetSaturation( int ident, int axis );
176 void    glutJoystickSetSaturation( int ident, int axis, float st );
177 void    glutJoystickSetMinRange( int ident, float *axes );
178 void    glutJoystickSetMaxRange( int ident, float *axes );
179 void    glutJoystickSetCenter( int ident, float *axes );
180 void    glutJoystickGetMinRange( int ident, float *axes );
181 void    glutJoystickGetMaxRange( int ident, float *axes );
182 void    glutJoystickGetCenter( int ident, float *axes );
183
184 /*
185  * Initialization functions, see freeglut_init.c
186  */
187 FGAPI void    FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion );
188 FGAPI void    FGAPIENTRY glutInitContextFlags( int flags );
189
190 #ifdef __cplusplus
191     }
192 #endif
193
194 /*** END OF FILE ***/
195
196 #endif /* __FREEGLUT_EXT_H__ */