freeglut_ext.h 10 KB

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