Added FREEGLUT_VERSION_1_3.
[freeglut] / doc / freeglut_user_interface.html
1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2 <html>
3 <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5    <meta name="Author" content="John F. Fay">
6    <meta name="GENERATOR" content="Mozilla/4.77 [en] (Windows NT 5.0; U) [Netscape]">
7    <title>FREEGLUT Application Program Interface</title>
8 </head>
9 <body>
10
11 <dl>
12 <center>
13 <h1>
14 The Open-Source</h1></center>
15
16 <center>
17 <h1>
18 OpenGL Utility Toolkit</h1></center>
19
20 <center>
21 <h1>
22 (freeglut)</h1></center>
23
24 <center>
25 <h1>
26 Application Programming Interface</h1></center>
27 </dl>
28
29 <center>
30 <h1>
31 Version 4.0</h1></center>
32
33 <center>
34 <h2>
35 The freeglut Programming Consortium</h2></center>
36
37 <center>
38 <h2>
39 November, 2002</h2></center>
40
41 <p><br>OpenGL is a trademark of Silicon Graphics, Inc. X Window System
42 is a trademark of X Consortium, Inc.&nbsp; Spaceball is a registered trademark
43 of Spatial Systems Inc.
44 <br>The authors have taken care in preparation of this documentation but
45 make no expressed or implied warranty of any kind and assumes no responsibility
46 for errors or omissions. No liability is assumed for incidental or consequential
47 damages in connection with or arising from the use of information or programs
48 contained herein.
49 <br>&nbsp;
50 <h1>
51 1.0&nbsp;<a NAME="Contents"></a> Contents</h1>
52 1.0&nbsp; <a href="#Contents">Contents</a>
53 <p>2.0&nbsp; <a href="#Introduction">Introduction</a>
54 <p>3.0&nbsp; <a href="#Background">Background</a>
55 <blockquote>3.1&nbsp; Design Philosophy
56 <br>3.2&nbsp; Conventions
57 <br>3.3&nbsp; Terminology
58 <br>3.4&nbsp; Differences from GLUT 3.7</blockquote>
59
60 <p><br>4.0&nbsp; <a href="#Initialization">Initialization Functions</a>
61 <blockquote>4.1&nbsp; glutInit
62 <br>4.2&nbsp; glutInitWindowPosition, glutInitWindowSize
63 <br>4.3&nbsp; glutInitDisplayMode
64 <br>4.4&nbsp; glutInitDisplayString</blockquote>
65
66 <p><br>5.0&nbsp; <a href="#EventProcessing">Event Processing Functions</a>
67 <blockquote>5.1&nbsp; glutMainLoop
68 <br>5.2&nbsp; glutMainLoopEvent
69 <br>5.3&nbsp; glutLeaveMainLoop</blockquote>
70
71 <p><br>6.0&nbsp; <a href="#Window">Window Functions</a>
72 <blockquote>6.1&nbsp; glutCreateWindow
73 <br>6.2&nbsp; glutCreateSubwindow
74 <br>6.3&nbsp; glutDestroyWindow
75 <br>6.4&nbsp; glutSetWindow, glutGetWindow
76 <br>6.5&nbsp; glutSetWindowTitle, glutSetIconTitle
77 <br>6.6&nbsp; glutReshapeWindow
78 <br>6.7&nbsp; glutPositionWindow
79 <br>6.8&nbsp; glutShowWindow, glutHideWindow, glutIconifyWindow
80 <br>6.9&nbsp; glutPushWindow, glutPopWindow
81 <br>6.10&nbsp; glutFullScreen</blockquote>
82
83 <p><br>7.0&nbsp; <a href="#Display">Display Functions</a>
84 <blockquote>7.1&nbsp; glutPostRedisplay
85 <br>7.2&nbsp; glutPostWindowRedisplay
86 <br>7.3&nbsp; glutSwapBuffers</blockquote>
87
88 <p><br>8.0&nbsp; <a href="#MouseCursor">Mouse Cursor Functions</a>
89 <blockquote>8.1&nbsp; glutSetCursor
90 <br>8.2&nbsp; glutWarpPointer</blockquote>
91
92 <p><br>9.0&nbsp; <a href="#Overlay">Overlay Functions</a>
93 <blockquote>9.1&nbsp; glutEstablishOverlay
94 <br>9.2&nbsp; glutRemoveOverlay
95 <br>9.3&nbsp; glutUseLayer
96 <br>9.4&nbsp; glutPostOverlayRedisplay
97 <br>9.5&nbsp; glutPostWindowOverlayRedisplay
98 <br>9.6&nbsp; glutShowOverlay, glutHideOverlay</blockquote>
99
100 <p><br>10.0&nbsp; <a href="#Menu">Menu Functions</a>
101 <blockquote>10.1&nbsp; glutCreateMenu
102 <br>10.2&nbsp; glutDestroyMenu
103 <br>10.3&nbsp; glutGetMenu, glutSetMenu
104 <br>10.4&nbsp; glutAddMenuEntry
105 <br>10.5&nbsp; glutAddSubMenu
106 <br>10.6&nbsp; glutChangeToMenuEntry
107 <br>10.7&nbsp; glutChangeToSubMenu
108 <br>10.8&nbsp; glutRemoveMenuItem
109 <br>10.9&nbsp; glutAttachMenu, glutDetachMenu</blockquote>
110
111 <p><br>11.0&nbsp; <a href="#GlobalCallback">Global Callback Registration
112 Functions</a>
113 <blockquote>11.1&nbsp; glutTimerFunc
114 <br>11.2&nbsp; glutIdleFunc</blockquote>
115
116 <p><br>12.0&nbsp; <a href="#WindowCallback">Window-Specific Callback Registration
117 Functions</a>
118 <blockquote>12.1&nbsp; glutDisplayFunc
119 <br>12.2&nbsp; glutOverlayDisplayFunc
120 <br>12.3&nbsp; glutReshapeFunc
121 <br>12.4&nbsp; glutCloseFunc
122 <br>12.5&nbsp; glutKeyboardFunc
123 <br>12.6&nbsp; glutSpecialFunc
124 <br>12.7&nbsp; glutKeyboardUpFunc
125 <br>12.8&nbsp; glutSpecialUpFunc
126 <br>12.9&nbsp; glutMouseFunc
127 <br>12.10&nbsp; glutMotionFunc, glutPassiveMotionFunc
128 <br>12.11&nbsp; glutVisibilityFunc
129 <br>12.12&nbsp; glutEntryFunc
130 <br>12.13&nbsp; glutJoystickFunc
131 <br>12.14&nbsp; glutSpaceballMotionFunc
132 <br>12.15&nbsp; glutSpaceballRotateFunc
133 <br>12.16&nbsp; glutSpaceballButtonFunc
134 <br>12.17&nbsp; glutButtonBoxFunc
135 <br>12.18&nbsp; glutDialsFunc
136 <br>12.19&nbsp; glutTabletMotionFunc
137 <br>12.20&nbsp; glutTabletButtonFunc
138 <p>12.21&nbsp; glutMenuStatusFunc
139 <br>12.22&nbsp; glutWindowStatusFunc</blockquote>
140
141 <p><br>13.0&nbsp; <a href="#StateSetting">State Setting and Retrieval Functions</a>
142 <blockquote>13.1&nbsp; glutSetOption
143 <br>13.2&nbsp; glutGet
144 <br>13.3&nbsp; glutDeviceGet
145 <br>13.4&nbsp; glutGetModifiers
146 <br>13.5&nbsp; glutLayerGet
147 <br>13.6&nbsp; glutExtensionSupported
148 <br>13.7&nbsp; glutGetProcAddress</blockquote>
149
150 <p><br>14.0&nbsp; <a href="#FontRendering">Font Rendering Functions</a>
151 <blockquote>14.1&nbsp; glutBitmapCharacter
152 <br>14.2&nbsp; glutBitmapString
153 <br>14.3&nbsp; glutBitmapWidth
154 <br>14.4&nbsp; glutBitmapLength
155 <br>14.5&nbsp; glutBitmapHeight
156 <br>14.6&nbsp; glutStrokeCharacter
157 <br>14.7&nbsp; glutStrokeString
158 <br>14.8&nbsp; glutStrokeWidth
159 <br>14.9&nbsp; glutStrokeLength
160 <br>14.10&nbsp; glutStrokeHeight</blockquote>
161
162 <p><br>15.0&nbsp; <a href="#GeometricObject">Geometric Object Rendering
163 Functions</a>
164 <blockquote>15.1&nbsp; glutWireSphere, glutSolidSphere
165 <br>15.2&nbsp; glutWireTorus, glutSolidTorus
166 <br>15.3&nbsp; glutWireCone, glutSolidCone
167 <br>15.4&nbsp; glutWireCube, glutSolidCube
168 <br>15.5&nbsp; glutWireTetrahedron, glutSolidTetrahedron
169 <br>15.6&nbsp; glutWireOctahedron, glutSolidOctahedron
170 <br>15.7&nbsp; glutWireDodecahedron, glutSolidDodecahedron
171 <br>15.8&nbsp; glutWireIcosahedron, glutSolidIcosahedron
172 <br>15.9&nbsp; glutWireRhombicDodecahedron, glutSolidRhombicDodecahedron
173 <br>15.10&nbsp; glutWireTeapot, glutSolidTeapot</blockquote>
174
175 <p><br>16.0&nbsp; <a href="#GameMode">Game Mode Functions</a>
176 <blockquote>16.1&nbsp; glutGameModeString
177 <br>16.2&nbsp; glutEnterGameMode, glutLeaveGameMode
178 <br>16.3&nbsp; glutGameModeGet</blockquote>
179
180 <p><br>17.0&nbsp; <a href="#VideoResize">Video Resize Functions</a>
181 <blockquote>17.1&nbsp; glutVideoResizeGet
182 <br>17.2&nbsp; glutSetupVideoResizing, glutStopVideoResizing
183 <br>17.3&nbsp; glutVideoResize
184 <br>17.4&nbsp; glutVideoPan</blockquote>
185
186 <p><br>18.0&nbsp; <a href="#ColorMap">Color Map Functions</a>
187 <blockquote>18.1&nbsp; glutSetColor, glutGetColor
188 <br>18.2&nbsp; glutCopyColormap</blockquote>
189
190 <p><br>19.0&nbsp; <a href="#Miscellaneous">Miscellaneous Functions</a>
191 <blockquote>19.1&nbsp; glutIgnoreKeyRepeat, glutSetKeyRepeat
192 <br>19.2&nbsp; glutForceJoystickFunc
193 <br>19.3&nbsp; glutReportErrors</blockquote>
194
195 <p><br>20.0&nbsp; <a href="#UsageNotes">Usage Notes</a>
196 <p>21.0&nbsp; <a href="#ImplementationNotes">Implementation Notes</a>
197 <p>22.0&nbsp; <a href="#GLUT_State">GLUT State</a>
198 <p>23.0&nbsp; <a href="#Freeglut.h_Header">"freeglut.h" Header File</a>
199 <p>24.0&nbsp; <a href="#References">References</a>
200 <p>25.0&nbsp; <a href="#Index">Index</a>
201 <br>&nbsp;
202 <br>&nbsp;
203 <h1>
204 2.0&nbsp;<a NAME="Introduction"></a> Introduction</h1>
205 &nbsp;
206 <h1>
207 3.0&nbsp;<a NAME="Background"></a> Background</h1>
208 The OpenGL programming world owes a tremendous debt to Mr. Mark J. Kilgard
209 for writing the OpenGL Utility Toolkit, or GLUT.&nbsp; The GLUT library
210 of functions allows an application programmer to create, control, and manipulate
211 windows independent of what operating system the program is running on.&nbsp;
212 By hiding the dependency on the operating system from the application programmer,
213 he allowed people to write truly portable OpenGL applications.
214 <p>&nbsp;&nbsp;&nbsp; Mr. Kilgard copyrighted his library and gave it a
215 rather unusual license.&nbsp; Under his license, people are allowed freely
216 to copy and distribute the libraries and the source code, but they are
217 not allowed to modify it.&nbsp; For a long time this did not matter because
218 the GLUT library worked so well and because Mr. Kilgard was releasing updates
219 on a regular basis.&nbsp; But with the passage of time, people started
220 wanting some slightly different behaviours in their windowing system.&nbsp;
221 When Mr. Kilgard stopped supporting the GLUT library in 1999, having moved
222 on to bigger and better things, this started to become a problem.
223 <p>&nbsp;&nbsp;&nbsp; In December 1999, Mr. Pawel Olzsta started work on
224 an open-source clone of the GLUT library.&nbsp; This open-source clone,
225 which does not use any of the GLUT source code, has evolved into the present
226 <i>freeglut</i>
227 library.&nbsp; This documentation specifies the application program interface
228 to the <i>freeglut</i> library.
229 <h2>
230 3.1&nbsp; Design Philosophy</h2>
231
232 <h2>
233 3.2&nbsp; Conventions</h2>
234
235 <h2>
236 3.3&nbsp; Terminology</h2>
237
238 <h2>
239 3.4&nbsp; Differences from GLUT 3.7</h2>
240 Since the <i>freeglut</i> library was developed in order to update GLUT,
241 it is natural that there will be some differences between the two.&nbsp;
242 Each function in the API notes any differences between the GLUT and the
243 <i>freeglut</i>
244 function behaviours.&nbsp; The important ones are summarized here.
245 <h3>
246 3.4.1&nbsp; glutMainLoop Behaviour</h3>
247 One of the commonest complaints about the GLUT library was that once an
248 application called "<tt>glutMainLoop</tt>", it never got control back.&nbsp;
249 There was no way for an application to loop in GLUT for a while, possibly
250 as a subloop while a specific window was open, and then return to the calling
251 function.&nbsp; A new function, "<tt>glutMainLoopEvent</tt>", has been
252 added to allow this functionality.&nbsp; Another function, "<tt>glutLeaveMainLoop</tt>",
253 has also been added to allow the application to tell freeglut to clean
254 up and close down.
255 <h3>
256 3.4.2&nbsp; Action on Window Closure</h3>
257 Another difficulty with GLUT, especially with multiple-window programs,
258 is that if the user clicks on the "x" in the window header the application
259 exits immediately.&nbsp; The application programmer can now set an option,
260 "<tt> GLUT_ACTION_ON_WINDOW_CLOSE</tt>", to specify whether execution should
261 continue, whether GLUT should return control to the main program, or whether
262 GLUT should simply exit (the default).
263 <h3>
264 3.4.3&nbsp; String Rendering</h3>
265 New functions have been added to render full character strings (including
266 carriage returns) rather than rendering one character at a time.&nbsp;
267 More functions return the widths of character strings and the font heights,
268 in pixels for bitmapped fonts and in OpenGL units for the stroke fonts.
269 <h3>
270 3.4.4&nbsp; Geometry Rendering</h3>
271 Two functions have been added to render a wireframe and a solid rhombic
272 dodecahedron.
273 <h3>
274 3.4.5&nbsp; Extension Function Queries</h3>
275 glutGetProcAddress is a wrapper for the glXGetProcAddressARB and
276 wglGetProcAddress functions.
277 <h1>
278
279
280
281
282 4.0&nbsp;<a NAME="Initialization"></a> Initialization Functions</h1>
283
284 <h2>
285 4.1&nbsp; glutInit</h2>
286
287 <h2>
288 4.2&nbsp; glutInitWindowPosition, glutInitWindowSize</h2>
289 The "<tt>glutInitWindowPosition</tt> " and "<tt>glutInitWindowSize</tt>"
290 functions specify a desired position and size for windows that <i>freeglut</i>
291 will create in the future.
292 <p><b>Usage</b>
293 <p><tt>void glutInitWindowPosition ( int x, int y ) ;</tt>
294 <br><tt>void glutInitWindowSize ( int width, int height ) ;</tt>
295 <p><b>Description</b>
296 <p>The "<tt>glutInitWindowPosition</tt> " and "<tt>glutInitWindowSize</tt>"
297 functions specify a desired position and size for windows that <i>freeglut</i>
298 will create in the future.&nbsp; The position is measured in pixels from
299 the upper left hand corner of the screen, with "x" increasing to the right
300 and "y" increasing towards the bottom of the screen.&nbsp; The size is
301 measured in pixels.&nbsp; <i>Freeglut</i> does not promise to follow these
302 specifications in creating its windows, it certainly makes an attempt to.
303 <p>The position and size of a window are a matter of some subtlety.&nbsp;
304 Most windows have a usable area surrounded by a border and with a title
305 bar on the top.&nbsp; The border and title bar are commonly called "decorations."&nbsp;
306 The position of the window unfortunately varies with the operating system.&nbsp;
307 On Linux, it is the coordinates of the upper left-hand corner of its decorations.&nbsp;
308 On Windows, it is the coordinates of the upper left hand corner of its
309 usable interior.&nbsp; For both operating systems, the size of the window
310 is the size of the usable interior.
311 <p>Windows has some additional quirks which the application programmer
312 should know about.&nbsp; First, the minimum y-coordinate of a window decoration
313 is zero.&nbsp; (This is a feature of <i>freeglut</i> and can be adjusted
314 if so desired.)&nbsp; Second, there appears to be a minimum window width
315 on Windows which is 104 pixels.&nbsp; The user may specify a smaller width,
316 but the Windows system calls ignore it.&nbsp; It is also impossible to
317 make a window narrower than this by dragging on its corner.
318 <p><b>Changes From GLUT</b>
319 <p>For some reason, GLUT is not affected by the 104-pixel minimum window
320 width.&nbsp; If the user clicks on the corner of a window which is narrower
321 than this amount, the window will immediately snap out to this width, but
322 the application can call "<tt>glutReshapeWindow</tt> " and make a window
323 narrower again.
324 <h2>
325 4.3&nbsp; glutInitDisplayMode</h2>
326
327 <h2>
328 4.4&nbsp; glutInitDisplayString</h2>
329
330 <h1>
331 5.0&nbsp;<a NAME="EventProcessing"></a> Event Processing Functions</h1>
332 After an application has finished initializing its windows and menus, it
333 enters an event loop.&nbsp; Within this loop, <i>freeglut</i> polls the
334 data entry devices (keyboard, mouse, etc.) and calls the application's
335 appropriate callbacks.
336 <p>In GLUT, control never returned from the event loop (as invoked by the
337 "<tt>glutMainLoop</tt>" function) to the calling function.&nbsp; This prevented
338 an application from having re-entrant code, in which GLUT could be invoked
339 from within a callback, and it prevented the application from doing any
340 post-processing (such as freeing allocated memory) after GLUT had closed
341 down.&nbsp; <i>Freeglut</i> allows the application programmer to specify
342 more direct control over the event loop by means of two new functions.&nbsp;
343 The first, "<tt>glutMainLoopEvent</tt>", processes a single iteration of
344 the event loop and allows the application to use a different event loop
345 controller or to contain re-entrant code.&nbsp; The second, "<tt>glutLeaveMainLoop</tt>",
346 causes the event loop to exit nicely; this is preferable to the application's
347 calling "<tt>exit</tt>" from within a GLUT callback.
348 <h2>
349 5.1&nbsp; glutMainLoop</h2>
350 The "<tt>glutMainLoop</tt>" function enters the event loop.
351 <p><b>Usage</b>
352 <p><tt>void glutMainLoop ( void ) ;</tt>
353 <p><b>Description</b>
354 <p>The&nbsp; "<tt>glutMainLoop</tt>" function causes the program to enter
355 the window event loop.&nbsp; An application should call this function at
356 most once.&nbsp; It will call any application callback functions as required
357 to process mouse clicks, mouse motion, key presses, and so on.
358 <p><b>Changes From GLUT</b>
359 <p>In GLUT, there was absolutely no way for the application programmer
360 to have control return from the "<tt>glutMainLoop</tt> " function to the
361 calling function.&nbsp; <i>Freeglut</i> allows the programmer to force
362 this by setting the "<tt>GLUT_ACTION_ON_WINDOW_CLOSE</tt>" option and invoking
363 the "<tt>glutLeaveMainLoop</tt>" function from one of the callbacks.&nbsp;
364 Stopping the program this way is preferable to simply calling "<tt>exit</tt>
365 " from within a callback because this allows <i>freeglut</i> to free allocated
366 memory and otherwise clean up after itself.&nbsp; (I know I just said this,
367 but I think it is important enough that it bears repeating.)
368 <h2>
369 5.2&nbsp; glutMainLoopEvent</h2>
370 The "<tt>glutMainLoopEvent</tt>" function processes a single iteration
371 in the <i>freeglut</i> event loop.
372 <p><b>Usage</b>
373 <p><tt>void glutMainLoopEvent ( void ) ;</tt>
374 <p><b>Description</b>
375 <p>The&nbsp; "<tt>glutMainLoopEvent</tt> " function causes <i>freeglut</i>
376 to process one iteration's worth of events in its event loop.&nbsp; This
377 allows the application to control its own event loop and still use the
378 <i>freeglut</i>
379 windowing system.
380 <p><b>Changes From GLUT</b>
381 <p>GLUT does not include this function.
382 <h2>
383 5.3&nbsp; glutLeaveMainLoop</h2>
384 The "<tt>glutLeaveMainLoop</tt>" function causes <i>freeglut</i> to stop
385 its event loop.
386 <p><b>Usage</b>
387 <p><tt>void glutLeaveMainLoop ( void ) ;</tt>
388 <p><b>Description</b>
389 <p>The&nbsp; "<tt>glutLeaveMainLoop</tt> " function causes <i>freeglut</i>
390 to stop the event loop.&nbsp; If the "<tt> GLUT_ACTION_ON_WINDOW_CLOSE</tt>"
391 option has been set to "<tt>GLUT_ACTION_CONTINUE_EXECUTION</tt> ", control
392 will return to the function which called "<tt>glutMainLoop</tt> "; otherwise
393 the application will exit.
394 <p>If the application has two nested calls to "<tt>glutMainLoop</tt>" and
395 calls "<tt>glutLeaveMainLoop</tt>", the behaviour of <i>freeglut</i> is
396 undefined.&nbsp; It may leave only the inner nested loop or it may leave
397 both loops.&nbsp; If the reader has a strong preference for one behaviour
398 over the other he should contact the <i>freeglut</i> Programming Consortium
399 and ask for the code to be fixed.
400 <p><b>Changes From GLUT</b>
401 <p>GLUT does not include this function.
402 <h1>
403 6.0&nbsp;<a NAME="Window"></a> Window Functions</h1>
404
405 <h2>
406 6.1&nbsp; glutCreateWindow</h2>
407
408 <h2>
409 6.2&nbsp; glutCreateSubwindow</h2>
410
411 <h2>
412 6.3&nbsp; glutDestroyWindow</h2>
413
414 <h2>
415 6.4&nbsp; glutSetWindow, glutGetWindow</h2>
416
417 <h2>
418 6.5&nbsp; glutSetWindowTitle, glutSetIconTitle</h2>
419
420 <h2>
421 6.6&nbsp; glutReshapeWindow</h2>
422
423 <h2>
424 6.7&nbsp; glutPositionWindow</h2>
425
426 <h2>
427 6.8&nbsp; glutShowWindow, glutHideWindow, glutIconifyWindow</h2>
428
429 <h2>
430 6.9&nbsp; glutPushWindow, glutPopWindow</h2>
431
432 <h2>
433 6.10&nbsp; glutFullScreen</h2>
434
435 <h1>
436 7.0&nbsp;<a NAME="Display"></a> Display Functions</h1>
437
438 <h2>
439 7.1&nbsp; glutPostRedisplay</h2>
440
441 <h2>
442 7.2&nbsp; glutPostWindowRedisplay</h2>
443
444 <h2>
445 7.3&nbsp; glutSwapBuffers</h2>
446
447 <h1>
448 8.0&nbsp;<a NAME="MouseCursor"></a> Mouse Cursor Functions</h1>
449
450 <h2>
451 8.1&nbsp; glutSetCursor</h2>
452
453 <h2>
454 8.2&nbsp; glutWarpPointer</h2>
455
456 <h1>
457 9.0&nbsp;<a NAME="Overlay"></a> Overlay Functions</h1>
458 <i>Freeglut</i> does not allow overlays, although it does "answer the mail"
459 with function stubs so that GLUT-based programs can compile and link against
460 <i>freeglut</i>
461 without modification.&nbsp; If the reader needs overlays, he should contact
462 the <i>freeglut</i> Programming Consortium and ask for them to be implemented.&nbsp;
463 He should also be prepared to assist in the implementation.
464 <h2>
465 9.1&nbsp; glutEstablishOverlay</h2>
466 The "<tt>glutEstablishOverlay</tt>" function is not implemented in <i>freeglut</i>.
467 <p><b>Usage</b>
468 <p><tt>void glutEstablishOverlay ( void ) ;</tt>
469 <p><b>Description</b>
470 <p>The "<tt>glutEstablishOverlay</tt>" function is not implemented in <i>freeglut</i>.
471 <p><b>Changes From GLUT</b>
472 <p>GLUT implements this function.
473 <h2>
474 9.2&nbsp; glutRemoveOverlay</h2>
475 The "<tt>glutRemoveOverlay</tt>" function is not implemented in <i>freeglut</i>.
476 <p><b>Usage</b>
477 <p><tt>void glutRemoveOverlay ( void ) ;</tt>
478 <p><b>Description</b>
479 <p>The "<tt>glutRemoveOverlay</tt>" function is not implemented in <i>freeglut</i>.
480 <p><b>Changes From GLUT</b>
481 <p>GLUT implements this function.
482 <h2>
483 9.3&nbsp; glutUseLayer</h2>
484 The "<tt>glutUseLayer</tt>" function is not implemented in <i>freeglut</i>.
485 <p><b>Usage</b>
486 <p><tt>void glutUseLayer (&nbsp; GLenum layer ) ;</tt>
487 <p><b>Description</b>
488 <p>The "<tt>glutUseLayer</tt>" function is not implemented in <i>freeglut</i>.
489 <p><b>Changes From GLUT</b>
490 <p>GLUT implements this function.
491 <h2>
492 9.4&nbsp; glutPostOverlayRedisplay</h2>
493 The "<tt>glutPostOverlayRedisplay</tt> " function is not implemented in
494 <i>freeglut</i>.
495 <p><b>Usage</b>
496 <p><tt>void glutPostOverlayRedisplay ( void ) ;</tt>
497 <p><b>Description</b>
498 <p>The "<tt>glutPostOverlayRedisplay</tt> " function is not implemented
499 in <i>freeglut</i>.
500 <p><b>Changes From GLUT</b>
501 <p>GLUT implements this function.
502 <h2>
503 9.5&nbsp; glutPostWindowOverlayRedisplay</h2>
504 The "<tt>glutPostWindowOverlayRedisplay</tt> " function is not implemented
505 in <i>freeglut</i>.
506 <p><b>Usage</b>
507 <p><tt>void glutPostWindowOverlayRedisplay ( int window ) ;</tt>
508 <p><b>Description</b>
509 <p>The "<tt>glutPostWindowOverlayRedisplay</tt> " function is not implemented
510 in <i>freeglut</i>.
511 <p><b>Changes From GLUT</b>
512 <p>GLUT implements this function.
513 <h2>
514 9.6&nbsp; glutShowOverlay, glutHideOverlay</h2>
515 The "<tt>glutShowOverlay</tt>" and "<tt>glutHideOverlay</tt>" functions
516 are not implemented in <i>freeglut</i> .
517 <p><b>Usage</b>
518 <p><tt>void glutShowOverlay( void ) ;</tt>
519 <br><tt>void glutHideOverlay( void ) ;</tt>
520 <p><b>Description</b>
521 <p>The "<tt>glutShowOverlay</tt>" and "<tt>glutHideOverlay</tt>" functions
522 are not implemented in <i>freeglut</i> .
523 <p><b>Changes From GLUT</b>
524 <p>GLUT implements these functions.
525 <h1>
526 10.0&nbsp;<a NAME="Menu"></a> Menu Functions</h1>
527
528 <h2>
529 10.1&nbsp; glutCreateMenu</h2>
530
531 <h2>
532 10.2&nbsp; glutDestroyMenu</h2>
533
534 <h2>
535 10.3&nbsp; glutGetMenu, glutSetMenu</h2>
536
537 <h2>
538 10.4&nbsp; glutAddMenuEntry</h2>
539
540 <h2>
541 10.5&nbsp; glutAddSubMenu</h2>
542
543 <h2>
544 10.6&nbsp; glutChangeToMenuEntry</h2>
545
546 <h2>
547 10.7&nbsp; glutChangeToSubMenu</h2>
548
549 <h2>
550 10.8&nbsp; glutRemoveMenuItem</h2>
551
552 <h2>
553 10.9&nbsp; glutAttachMenu, glutDetachMenu</h2>
554
555 <h1>
556 11.0&nbsp;<a NAME="GlobalCallback"></a> Global Callback Registration Functions</h1>
557
558 <h2>
559 11.1&nbsp; glutTimerFunc</h2>
560
561 <h2>
562 11.2&nbsp; glutIdleFunc</h2>
563 The "<tt>glutIdleFunc</tt>" function sets the global idle callback. <i>Freeglut</i>
564 calls the idle callback when there are no inputs from the user.
565 <p><b>Usage</b>
566 <p><tt>void glutIdleFunc ( void (*func) ( void ) ) ;</tt>
567 <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The new global idle callback function
568 <p><b>Description</b>
569 <p>The&nbsp; "<tt>glutIdleFunc</tt>" function specifies the function that
570 <i>freeglut</i>
571 will call to perform background processing tasks such as continuous animation
572 when window system events are not being received.&nbsp; If enabled, this
573 function is called continuously from <i>freeglut</i> while no events are
574 received.&nbsp; The callback function has no parameters and returns no
575 value.&nbsp; <i>Freeglut</i> does not change the <i>current window</i>
576 or the <i>current menu</i> before invoking the idle callback; programs
577 with multiple windows or menus must explicitly set the <i>current window</i>
578 and <i>current menu</i> and not rely on its current setting.
579 <br>&nbsp;&nbsp;&nbsp; The amount of computation and rendering done in
580 an idle callback should be minimized to avoid affecting the program's interactive
581 response.&nbsp; In general, no more than a single frame of rendering should
582 be done in a single invocation of an idle callback.
583 <br>&nbsp;&nbsp;&nbsp; Calling "<tt>glutIdleFunc</tt>" with a NULL argument
584 disables the call to an idle callback.
585 <p><b>Changes From GLUT</b>
586 <p>Application programmers should note that if they have specified the
587 "continue execution" action on window closure, <i>freeglut</i> will continue
588 to call the idle callback after the user has closed a window by clicking
589 on the "x" in the window header bar.&nbsp; If the idle callback renders
590 a particular window (this is considered bad form but is frequently done
591 anyway), the programmer should supply a window closure callback for that
592 window which changes or disables the idle callback.
593 <h1>
594 12.0&nbsp;<a NAME="WindowCallback"></a> Window-Specific Callback Registration
595 Functions</h1>
596
597 <h2>
598 12.1&nbsp; glutDisplayFunc</h2>
599
600 <h2>
601 12.2&nbsp; glutOverlayDisplayFunc</h2>
602
603 <h2>
604 12.3&nbsp; glutReshapeFunc</h2>
605
606 <h2>
607 12.4&nbsp; glutCloseFunc</h2>
608
609 <h2>
610 12.5&nbsp; glutKeyboardFunc</h2>
611
612 <h2>
613 12.6&nbsp; glutSpecialFunc</h2>
614 The "<tt>glutSpecialFunc</tt>" function sets the window's special key press
615 callback. <i>Freeglut</i> calls the special key press callback when the
616 user presses a special key.
617 <p><b>Usage</b>
618 <p><tt>void glutSpecialFunc ( void (*func) ( int key, int x, int y ) )
619 ;</tt>
620 <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's new special key press callback
621 function
622 <br><tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The key whose press triggers the
623 callback
624 <br><tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The x-coordinate of
625 the mouse relative to the window at the time the key is pressed
626 <br><tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The y-coordinate of
627 the mouse relative to the window at the time the key is pressed
628 <p><b>Description</b>
629 <p>The&nbsp; "<tt>glutSpecialFunc</tt>" function specifies the function
630 that <i>freeglut</i> will call when the user presses a special key on the
631 keyboard.&nbsp; The callback function has one argument:&nbsp; the name
632 of the function to be invoked ("called back") at the time at which the
633 special key is pressed.&nbsp; The function returns no value.&nbsp; <i>Freeglut</i>
634 sets the <i>current window</i> to the window which is active when the callback
635 is invoked.&nbsp; "Special keys" are the function keys, the arrow keys,
636 the Page Up and Page Down keys, and the Insert key.&nbsp; The Delete key
637 is considered to be a regular key.
638 <br>&nbsp;&nbsp;&nbsp; Calling "<tt>glutSpecialUpFunc</tt>" with a NULL
639 argument disables the call to the window's special key press callback.
640 <p>&nbsp;&nbsp;&nbsp; The "<tt>key</tt>" argument may take one of the following
641 defined constant values:
642 <ul>
643 <li>
644 <tt>GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
645 - F1 through F12 keys</li>
646
647 <li>
648 <tt>GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
649 - Page Up and Page Down keys</li>
650
651 <li>
652 <tt>GLUT_KEY_HOME, GLUT_KEY_END</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
653 - Home and End keys</li>
654
655 <li>
656 <tt>GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN</tt> - arrow
657 keys</li>
658
659 <li>
660 <tt>GLUT_KEY_INSERT</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
661 - Insert key</li>
662 </ul>
663 <b>Changes From GLUT</b>
664 <p>None.
665 <h2>
666 12.7&nbsp; glutKeyboardUpFunc</h2>
667 The "<tt>glutKeyboardUpFunc</tt>" function sets the window's key release
668 callback. <i>Freeglut</i> calls the key release callback when the user
669 releases a key.
670 <p><b>Usage</b>
671 <p><tt>void glutKeyboardUpFunc ( void (*func) ( unsigned char key, int
672 x, int y ) ) ;</tt>
673 <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's new key release callback
674 function
675 <br><tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The key whose release triggers
676 the callback
677 <br><tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The x-coordinate of
678 the mouse relative to the window at the time the key is released
679 <br><tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The y-coordinate of
680 the mouse relative to the window at the time the key is released
681 <p><b>Description</b>
682 <p>The&nbsp; "<tt>glutKeyboardUpFunc</tt>" function specifies the function
683 that <i>freeglut</i> will call when the user releases a key from the keyboard.&nbsp;
684 The callback function has one argument:&nbsp; the name of the function
685 to be invoked ("called back") at the time at which the key is released.&nbsp;
686 The function returns no value.&nbsp; <i>Freeglut</i> sets the <i>current
687 window</i> to the window which is active when the callback is invoked.
688 <br>&nbsp;&nbsp;&nbsp; While <i>freeglut</i> checks for upper or lower
689 case letters, it does not do so for non-alphabetical characters.&nbsp;
690 Nor does it account for the Caps-Lock key being on.&nbsp; The operating
691 system may send some unexpected characters to <i>freeglut</i>, such as
692 "8" when the user is pressing the Shift key.&nbsp; <i>Freeglut</i> also
693 invokes the callback when the user releases the Control, Alt, or Shift
694 keys, among others.&nbsp; Releasing the Delete key causes this function
695 to be invoked with a value of 127 for "<tt>key</tt>".
696 <br>&nbsp;&nbsp;&nbsp; Calling "<tt>glutKeyboardUpFunc</tt>" with a NULL
697 argument disables the call to the window's key release callback.
698 <p><b>Changes From GLUT</b>
699 <p>This function is not implemented in GLUT versions before Version 4.&nbsp;
700 It has been designed to be as close to GLUT as possible.&nbsp; Users who
701 find differences should contact the <i>freeglut</i> development team to
702 have them fixed.
703 <h2>
704 12.8&nbsp; glutSpecialUpFunc</h2>
705 The "<tt>glutSpecialUpFunc</tt>" function sets the window's special key
706 release callback. <i>Freeglut</i> calls the special key release callback
707 when the user releases a special key.
708 <p><b>Usage</b>
709 <p><tt>void glutSpecialUpFunc ( void (*func) ( int key, int x, int y )
710 ) ;</tt>
711 <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's new special key release
712 callback function
713 <br><tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The key whose release triggers
714 the callback
715 <br><tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The x-coordinate of
716 the mouse relative to the window at the time the key is released
717 <br><tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The y-coordinate of
718 the mouse relative to the window at the time the key is released
719 <p><b>Description</b>
720 <p>The&nbsp; "<tt>glutSpecialUpFunc</tt>" function specifies the function
721 that <i>freeglut</i> will call when the user releases a special key from
722 the keyboard.&nbsp; The callback function has one argument:&nbsp; the name
723 of the function to be invoked ("called back") at the time at which the
724 special key is released.&nbsp; The function returns no value.&nbsp; <i>Freeglut</i>
725 sets the <i>current window</i> to the window which is active when the callback
726 is invoked.&nbsp; "Special keys" are the function keys, the arrow keys,
727 the Page Up and Page Down keys, and the Insert key.&nbsp; The Delete key
728 is considered to be a regular key.
729 <br>&nbsp;&nbsp;&nbsp; Calling "<tt>glutSpecialUpFunc</tt>" with a NULL
730 argument disables the call to the window's special key release callback.
731 <p>&nbsp;&nbsp;&nbsp; The "<tt>key</tt>" argument may take one of the following
732 defined constant values:
733 <ul>
734 <li>
735 <tt>GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
736 - F1 through F12 keys</li>
737
738 <li>
739 <tt>GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
740 - Page Up and Page Down keys</li>
741
742 <li>
743 <tt>GLUT_KEY_HOME, GLUT_KEY_END</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
744 - Home and End keys</li>
745
746 <li>
747 <tt>GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN</tt> - arrow
748 keys</li>
749
750 <li>
751 <tt>GLUT_KEY_INSERT</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
752 - Insert key</li>
753 </ul>
754 <b>Changes From GLUT</b>
755 <p>This function is not implemented in GLUT versions before Version 4.&nbsp;
756 It has been designed to be as close to GLUT as possible.&nbsp; Users who
757 find differences should contact the <i>freeglut</i> development team to
758 have them fixed.
759 <h2>
760 12.9&nbsp; glutMouseFunc</h2>
761
762 <h2>
763 12.10&nbsp; glutMotionFunc, glutPassiveMotionFunc</h2>
764
765 <h2>
766 12.11&nbsp; glutVisibilityFunc</h2>
767
768 <h2>
769 12.12&nbsp; glutEntryFunc</h2>
770
771 <h2>
772 12.13&nbsp; glutJoystickFunc</h2>
773
774 <h2>
775 12.14&nbsp; glutSpaceballMotionFunc</h2>
776
777 <h2>
778 12.15&nbsp; glutSpaceballRotateFunc</h2>
779
780 <h2>
781 12.16&nbsp; glutSpaceballButtonFunc</h2>
782
783 <h2>
784 12.17&nbsp; glutButtonBoxFunc</h2>
785
786 <h2>
787 12.18&nbsp; glutDialsFunc</h2>
788
789 <h2>
790 12.19&nbsp; glutTabletMotionFunc</h2>
791
792 <h2>
793 12.20&nbsp; glutTabletButtonFunc</h2>
794
795 <h2>
796 12.21&nbsp; glutMenuStatusFunc</h2>
797
798 <h2>
799 12.22&nbsp; glutWindowStatusFunc</h2>
800
801 <h1>
802 13.0&nbsp;<a NAME="StateSetting"></a> State Setting and Retrieval Functions</h1>
803
804 <h2>
805 13.1&nbsp; glutSetOption</h2>
806
807 <h2>
808 13.2&nbsp; glutGet</h2>
809
810 <p>
811 The following state variables may be queried with glutGet.
812 The returned value is an integer.
813 </p>
814
815 <p>
816 These queries are with respect to the current window:
817 </p>
818
819 <ul>
820 <li>GLUT_WINDOW_X - window X position
821 <li>GLUT_WINDOW_Y - window Y position
822 <li>GLUT_WINDOW_WIDTH - window width
823 <li>GLUT_WINDOW_HEIGHT - window height
824 <li>GLUT_WINDOW_BUFFER_SIZE - number of color or color index bits per pixel
825 <li>GLUT_WINDOW_STENCIL_SIZE - number of bits per stencil value
826 <li>GLUT_WINDOW_DEPTH_SIZE - number of bits per depth value
827 <li>GLUT_WINDOW_RED_SIZE - number of bits per red value
828 <li>GLUT_WINDOW_GREEN_SIZE - number of bits per green value
829 <li>GLUT_WINDOW_BLUE_SIZE - number of bits per blue value
830 <li>GLUT_WINDOW_ALPHA_SIZE - number of bits per alpha value
831 <li>GLUT_WINDOW_ACCUM_RED_SIZE - number of red bits in the accumulation buffer
832 <li>GLUT_WINDOW_ACCUM_GREEN_SIZE - number of green bits in the accumulation buffer
833 <li>GLUT_WINDOW_ACCUM_BLUE_SIZE - number of blue bits in the accumulation buffer
834 <li>GLUT_WINDOW_ACCUM_ALPHA_SIZE - number of alpha bits in the accumulation buffer
835 <li>GLUT_WINDOW_DOUBLEBUFFER - 1 if the color buffer is double buffered, 0 otherwise
836 <li>GLUT_WINDOW_RGBA - 1 if the color buffers are RGB[A], 0 for color index
837 <li>GLUT_WINDOW_PARENT - parent window ID
838 <li>GLUT_WINDOW_NUM_CHILDREN - number of child windows
839 <li>GLUT_WINDOW_COLORMAP_SIZE - number of entries in the window's colormap
840 <li>GLUT_WINDOW_NUM_SAMPLES - number of samples per pixel if using multisampling
841 <li>GLUT_WINDOW_STEREO - 1 if the window supports stereo, 0 otherwise
842 <li>GLUT_WINDOW_CURSOR - current cursor
843 <li>GLUT_WINDOW_FORMAT_ID - on Windows, return the pixel format number of the current window
844 </ul>
845
846 <p>
847 These queries do not depend on the current window.
848 </p>
849
850 <ul>
851 <li>GLUT_SCREEN_WIDTH - width of the screen in pixels
852 <li>GLUT_SCREEN_HEIGHT - height of the screen in pixels
853 <li>GLUT_SCREEN_WIDTH_MM - width of the screen in millimeters
854 <li>GLUT_SCREEN_HEIGHT_MM - height of the screen in millimeters
855 <li>GLUT_MENU_NUM_ITEMS - number of items in the current menu
856 <li>GLUT_DISPLAY_MODE_POSSIBLE - return 1 if the current display mode is supported, 0 otherwise
857 <li>GLUT_INIT_WINDOW_X - X position last set by glutInitWindowPosition
858 <li>GLUT_INIT_WINDOW_Y - Y position last set by glutInitWindowPosition
859 <li>GLUT_INIT_WINDOW_WIDTH - width last set by glutInitWindowSize
860 <li>GLUT_INIT_WINDOW_HEIGHT - height last set by glutInitWindowSize
861 <li>GLUT_INIT_DISPLAY_MODE - display mode last set by glutInitDisplayMode
862 <li>GLUT_ELAPSED_TIME - time (in milliseconds) elapsed since glutInit or glutGet(GLUT_ELAPSED_TIME) was first called
863 <li>GLUT_INIT_STATE - ?
864 <li>GLUT_VERSION - Return value will be X*10000+Y*100+Z where X is the
865     major version, Y is the minor version and Z is the patch level.
866     This query is only supported in FreeGLUT (version 1.3 or later).
867 </ul>
868
869
870
871 <h2>
872 13.3&nbsp; glutDeviceGet</h2>
873
874 <h2>
875 13.4&nbsp; glutGetModifiers</h2>
876
877 <h2>
878 13.5&nbsp; glutLayerGet</h2>
879
880 <h2>
881 13.6&nbsp; glutExtensionSupported</h2>
882
883 <h2>
884 13.7&nbsp; glutGetProcAddress</h2>
885 <p>
886 <tt>glutGetProcAddress</tt> returns a pointer to a named GL or FreeGLUT function.
887 </p>
888 <p><b>Usage</b>
889 <p><tt>void *glutGetProcAddress ( const char *procName ) ;</tt>
890 <p><tt>procName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>Name of
891 an OpenGL or GLUT function.
892 </p>
893 <p><b>Description</b>
894 <p><tt>glutGetProcAddress</tt> is useful for dealing with OpenGL extensions.
895 If an application calls OpenGL extension functions directly, that application
896 will only link/run with an OpenGL library that supports the extension.
897 By using a function pointer returned from glutGetProcAddress(), the
898 application will avoid this hard dependency and be more portable and
899 interoperate better with various implementations of OpenGL.
900 </p>
901 <p>
902 Both OpenGL functions and FreeGLUT functions can be queried with this function.
903 Since WGL returns context-dependent function pointers, glutGetProcAddress
904 should be queried per FreeGLUT window.
905 </p>
906 <p>
907 <b>NOTE</b>: this function is not supported in GLUT.
908 </p>
909
910
911
912 <h1>
913 14.0&nbsp;<a NAME="FontRendering"></a> Font Rendering Functions</h1>
914 <i>Freeglut</i> supports two types of font rendering:&nbsp; bitmap fonts,
915 which are rendered using the "<tt>glBitmap</tt>" function call, and stroke
916 fonts, which are rendered as sequences of OpenGL line segments.&nbsp; Because
917 they are rendered as bitmaps, the bitmap fonts tend to render more quickly
918 than stroke fonts, but they are less flexible in terms of scaling and rendering.&nbsp;
919 Bitmap font characters are positioned with calls to the "<tt>glRasterPos*</tt>
920 " functions while stroke font characters use the OpenGL transformations
921 to position characters.
922 <p>&nbsp;&nbsp;&nbsp; It should be noted that <i>freeglut</i> fonts are
923 similar but not identical to GLUT fonts.&nbsp; At the moment, <i>freeglut</i>
924 fonts do not support the "`" (backquote) and "|" (vertical line) characters;
925 in their place it renders asterisks.
926 <p>&nbsp;&nbsp;&nbsp; <i>Freeglut</i> supports the following bitmap fonts:
927 <ul>
928 <li>
929 <tt>GLUT_BITMAP_8_BY_13</tt> - A variable-width font with every character
930 fitting in a rectangle of 13 pixels high by at most 8 pixels wide.</li>
931
932 <li>
933 <tt>GLUT_BITMAP_9_BY_15</tt> - A variable-width font with every character
934 fitting in a rectangle of 15 pixels high by at most 9 pixels wide.</li>
935
936 <li>
937 <tt>GLUT_BITMAP_TIMES_ROMAN_10</tt> - A 10-point variable-width Times Roman
938 font.</li>
939
940 <li>
941 <tt>GLUT_BITMAP_TIMES_ROMAN_24</tt> - A 24-point variable-width Times Roman
942 font.</li>
943
944 <li>
945 <tt>GLUT_BITMAP_HELVETICA_10</tt> - A 10-point variable-width Helvetica
946 font.</li>
947
948 <li>
949 <tt>GLUT_BITMAP_HELVETICA_12</tt> - A 12-point variable-width Helvetica
950 font.</li>
951
952 <li>
953 <tt>GLUT_BITMAP_HELVETICA_18</tt> - A 18-point variable-width Helvetica
954 font.</li>
955 </ul>
956 <i>Freeglut</i> calls "<tt>glRasterPos4v</tt>" to advance the cursor by
957 the width of a character and to render carriage returns when appropriate.&nbsp;
958 It does not use any display lists in it rendering in bitmap fonts.
959 <p>&nbsp;&nbsp;&nbsp; <i>Freeglut</i> supports the following stroke fonts:
960 <ul>
961 <li>
962 <tt>GLUT_STROKE_ROMAN</tt> - A proportionally-spaced Roman Simplex font</li>
963
964 <li>
965 <tt>GLUT_STROKE_MONO_ROMAN</tt> - A fixed-width Roman Simplex font</li>
966 </ul>
967 <i>Freeglut</i> does not use any display lists in its rendering of stroke
968 fonts.&nbsp; It calls "<tt>glTranslatef</tt>" to advance the cursor by
969 the width of a character and to render carriage returns when appropriate.
970 <h2>
971 14.1&nbsp; glutBitmapCharacter</h2>
972 The "<tt>glutBitmapCharacter</tt>" function renders a single bitmapped
973 character in the <i>current window</i> using the specified font.
974 <p><b>Usage</b>
975 <p><tt>void glutBitmapCharacter ( void *font, int character ) ;</tt>
976 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The bitmapped
977 font to use in rendering the character
978 <br><tt>character&nbsp;&nbsp; </tt>The ASCII code of the character to be
979 rendered
980 <p><b>Description</b>
981 <p>The&nbsp; "<tt>glutBitmapCharacter</tt> " function renders the given
982 character in the specified bitmap font.&nbsp; <i>Freeglut</i> automatically
983 sets the necessary pixel unpack storage modes and restores the existing
984 modes when it has finished.&nbsp; Before the first call to "<tt>glutBitMapCharacter</tt>
985 " the application program should call "<tt>glRasterPos*</tt>" to set the
986 position of the character in the window.&nbsp; The "<tt>glutBitmapCharacter</tt>"
987 function advances the cursor position as part of its call to "<tt>glBitmap</tt>"
988 and so the application does not need to call "<tt>glRasterPos*</tt>" again
989 for successive characters on the same line.
990 <p><b>Changes From GLUT</b>
991 <p>Nonexistent characters are rendered as asterisks.&nbsp; The rendering
992 position in <i>freeglut</i> is apparently off from GLUT's position by a
993 few pixels vertically and one or two pixels horizontally.
994 <h2>
995 14.2&nbsp; glutBitmapString</h2>
996 The "<tt>glutBitmapString</tt>" function renders a string of bitmapped
997 characters in the <i>current window</i> using the specified font.
998 <p><b>Usage</b>
999 <p><tt>void glutBitmapString ( void *font, char *string ) ;</tt>
1000 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The bitmapped font to use
1001 in rendering the character string
1002 <br><tt>string&nbsp;&nbsp;&nbsp; </tt>String of characters to be rendered
1003 <p><b>Description</b>
1004 <p>The&nbsp; "<tt>glutBitmapString</tt> " function renders the given character
1005 string in the specified bitmap font.&nbsp; <i>Freeglut</i> automatically
1006 sets the necessary pixel unpack storage modes and restores the existing
1007 modes when it has finished.&nbsp; Before calling "<tt>glutBitMapString</tt>"
1008 the application program should call "<tt>glRasterPos*</tt>" to set the
1009 position of the string in the window.&nbsp; The "<tt>glutBitmapString</tt>"
1010 function handles carriage returns.&nbsp; Nonexistent characters are rendered
1011 as asterisks.
1012 <p><b>Changes From GLUT</b>
1013 <p>GLUT does not include this function.
1014 <h2>
1015 14.3&nbsp; glutBitmapWidth</h2>
1016 The "<tt>glutBitmapWidth</tt>" function returns the width in pixels of
1017 a single bitmapped character in the specified font.
1018 <p><b>Usage</b>
1019 <p><tt>int glutBitmapWidth ( void *font, int character ) ;</tt>
1020 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The bitmapped
1021 font to use in calculating the character width
1022 <br><tt>character&nbsp;&nbsp; </tt>The ASCII code of the character
1023 <p><b>Description</b>
1024 <p>The&nbsp; "<tt>glutBitmapWidth</tt>" function returns the width of the
1025 given character in the specified bitmap font.&nbsp; Because the font is
1026 bitmapped, the width is an exact integer.
1027 <p><b>Changes From GLUT</b>
1028 <p>Nonexistent characters return the width of an asterisk.
1029 <h2>
1030 14.4&nbsp; glutBitmapLength</h2>
1031 The "<tt>glutBitmapLength</tt>" function returns the width in pixels of
1032 a string of bitmapped characters in the specified font.
1033 <p><b>Usage</b>
1034 <p><tt>int glutBitmapLength ( void *font, char *string ) ;</tt>
1035 <p><tt>font&nbsp;&nbsp;&nbsp; </tt>The bitmapped font to use in calculating
1036 the character width
1037 <br><tt>string&nbsp; </tt>String of characters whose width is to be calculated
1038 <p><b>Description</b>
1039 <p>The&nbsp; "<tt>glutBitmapLength</tt> " function returns the width in
1040 pixels of the given character string in the specified bitmap font.&nbsp;
1041 Because the font is bitmapped, the width is an exact integer:&nbsp; the
1042 return value is identical to the sum of the character widths returned by
1043 a series of calls to "<tt>glutBitmapWidth</tt>".&nbsp; The width of nonexistent
1044 characters is counted to be the width of an asterisk.
1045 <p>&nbsp;&nbsp;&nbsp; If the string contains one or more carriage returns,
1046 <i>freeglut</i>
1047 calculates the widths in pixels of the lines separately and returns the
1048 largest width.
1049 <p><b>Changes From GLUT</b>
1050 <p>GLUT does not include this function.
1051 <h2>
1052 14.5&nbsp; glutBitmapHeight</h2>
1053 The "<tt>glutBitmapHeight</tt>" function returns the height in pixels of
1054 the specified font.
1055 <p><b>Usage</b>
1056 <p><tt>int glutBitmapHeight ( void *font ) ;</tt>
1057 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The bitmapped
1058 font to use in calculating the character height
1059 <p><b>Description</b>
1060 <p>The&nbsp; "<tt>glutBitmapHeight</tt> " function returns the height of
1061 a character in the specified bitmap font.&nbsp; Because the font is bitmapped,
1062 the height is an exact integer.&nbsp; The fonts are designed such that
1063 all characters have (nominally) the same height.
1064 <p><b>Changes From GLUT</b>
1065 <p>GLUT does not include this function.
1066 <h2>
1067 14.6&nbsp; glutStrokeCharacter</h2>
1068 The "<tt>glutStrokeCharacter</tt>" function renders a single stroke character
1069 in the <i>current window</i> using the specified font.
1070 <p><b>Usage</b>
1071 <p><tt>void glutStrokeCharacter ( void *font, int character ) ;</tt>
1072 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The stroke font
1073 to use in rendering the character
1074 <br><tt>character&nbsp;&nbsp; </tt>The ASCII code of the character to be
1075 rendered
1076 <p><b>Description</b>
1077 <p>The&nbsp; "<tt>glutStrokeCharacter</tt> " function renders the given
1078 character in the specified stroke font.&nbsp; Before the first call to
1079 "<tt>glutStrokeCharacter</tt>" the application program should call the
1080 OpenGL transformation (positioning and scaling) functions to set the position
1081 of the character in the window.&nbsp; The "<tt>glutStrokeCharacter</tt>
1082 " function advances the cursor position by a call to "<tt>glTranslatef</tt>
1083 " and so the application does not need to call the OpenGL positioning functions
1084 again for successive characters on the same line.
1085 <p><b>Changes From GLUT</b>
1086 <p>Nonexistent characters are rendered as asterisks.
1087 <h2>
1088 14.7&nbsp; glutStrokeString</h2>
1089 The "<tt>glutStrokeString</tt>" function renders a string of characters
1090 in the <i>current window</i> using the specified stroke font.
1091 <p><b>Usage</b>
1092 <p><tt>void glutStrokeString ( void *font, char *string ) ;</tt>
1093 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The stroke font to use in
1094 rendering the character string
1095 <br><tt>string&nbsp;&nbsp;&nbsp; </tt>String of characters to be rendered
1096 <p><b>Description</b>
1097 <p>The&nbsp; "<tt>glutStrokeString</tt> " function renders the given character
1098 string in the specified stroke font.&nbsp; Before calling "<tt>glutStrokeString</tt>"
1099 the application program should call the OpenGL transformation (positioning
1100 and scaling) functions to set the position of the string in the window.&nbsp;
1101 The "<tt>glutStrokeString</tt> " function handles carriage returns.&nbsp;
1102 Nonexistent characters are rendered as asterisks.
1103 <p><b>Changes From GLUT</b>
1104 <p>GLUT does not include this function.
1105 <h2>
1106 14.8&nbsp; glutStrokeWidth</h2>
1107 The "<tt>glutStrokeWidth</tt>" function returns the width in pixels of
1108 a single character in the specified stroke font.
1109 <p><b>Usage</b>
1110 <p><tt>int glutStrokeWidth ( void *font, int character ) ;</tt>
1111 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The stroke font
1112 to use in calculating the character width
1113 <br><tt>character&nbsp;&nbsp; </tt>The ASCII code of the character
1114 <p><b>Description</b>
1115 <p>The&nbsp; "<tt>glutStrokeWidth</tt>" function returns the width of the
1116 given character in the specified stroke font.&nbsp; Because the font is
1117 a stroke font, the width is actually a floating-point number; the function
1118 rounds it to the nearest integer for the return value.
1119 <p><b>Changes From GLUT</b>
1120 <p>Nonexistent characters return the width of an asterisk.
1121 <h2>
1122 14.9&nbsp; glutStrokeLength</h2>
1123 The "<tt>glutStrokeLength</tt>" function returns the width in pixels of
1124 a string of characters in the specified stroke font.
1125 <p><b>Usage</b>
1126 <p><tt>int glutStrokeLength ( void *font, char *string ) ;</tt>
1127 <p><tt>font&nbsp;&nbsp;&nbsp; </tt>The stroke font to use in calculating
1128 the character width
1129 <br><tt>string&nbsp; </tt>String of characters whose width is to be calculated
1130 <p><b>Description</b>
1131 <p>The&nbsp; "<tt>glutStrokeLength</tt> " function returns the width in
1132 pixels of the given character string in the specified stroke font.&nbsp;
1133 Because the font is a stroke font, the width of an individual character
1134 is a floating-point number.&nbsp; <i>Freeglut</i> adds the floating-point
1135 widths and rounds the funal result to return the integer value.&nbsp; Thus
1136 the return value may differ from the sum of the character widths returned
1137 by a series of calls to "<tt>glutStrokeWidth</tt> ".&nbsp; The width of
1138 nonexistent characters is counted to be the width of an asterisk.
1139 <p>&nbsp;&nbsp;&nbsp; If the string contains one or more carriage returns,
1140 <i>freeglut</i>
1141 calculates the widths in pixels of the lines separately and returns the
1142 largest width.
1143 <p><b>Changes From GLUT</b>
1144 <p>GLUT does not include this function.
1145 <h2>
1146 14.10&nbsp; glutStrokeHeight</h2>
1147 The "<tt>glutStrokeHeight</tt>" function returns the height in pixels of
1148 the specified font.
1149 <p><b>Usage</b>
1150 <p><tt>GLfloat glutStrokeHeight ( void *font ) ;</tt>
1151 <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The stroke font
1152 to use in calculating the character height
1153 <p><b>Description</b>
1154 <p>The&nbsp; "<tt>glutStrokeHeight</tt> " function returns the height of
1155 a character in the specified stroke font.&nbsp; The application programmer
1156 should note that, unlike the other <i>freeglut</i> font functions, this
1157 one returns a floating-point number.&nbsp; The fonts are designed such
1158 that all characters have (nominally) the same height.
1159 <p><b>Changes From GLUT</b>
1160 <p>GLUT does not include this function.
1161 <h1>
1162 15.0&nbsp;<a NAME="GeometricObject"></a> Geometric Object Rendering Functions</h1>
1163 <i>Freeglut</i> includes eighteen routines for generating easily-recognizable
1164 3-d geometric objects.&nbsp; These routines are effectively the same ones
1165 that are included in the GLUT library, and reflect the functionality available
1166 in the <i>aux</i> toolkit described in the <i>OpenGL Programmer's Guide</i>
1167 .&nbsp; They are included to allow programmers to create with a single
1168 line of code a three-dimensional object which can be used to test a variety
1169 of OpenGL functionality.&nbsp; None of the routines generates a display
1170 list for the object which it draws.&nbsp; The functions generate normals
1171 appropriate for lighting but, except for the teapon functions, do not generate
1172 texture coordinates.
1173 <h2>
1174 15.1&nbsp; glutWireSphere, glutSolidSphere</h2>
1175 The "<tt>glutWireSphere</tt>" and "<tt>glutSolidSphere</tt>" functions
1176 draw a wireframe and solid sphere respectively.
1177 <p><b>Usage</b>
1178 <p><tt>void glutWireSphere ( GLdouble dRadius, GLint slices, GLint stacks
1179 ) ;</tt>
1180 <p><tt>void glutSolidSphere ( GLdouble dRadius, GLint slices, GLint stacks
1181 ) ;</tt>
1182 <p><tt>dRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired radius
1183 of the sphere
1184 <p><tt>slices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1185 number of slices (divisions in the longitudinal direction) in the sphere
1186 <p><tt>stacks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1187 number of stacks (divisions in the latitudinal direction) in the sphere.&nbsp;
1188 The number of points in this direction, including the north and south poles,
1189 is <tt>stacks+1</tt>
1190 <p><b>Description</b>
1191 <p>The "<tt>glutWireSphere</tt>" and "<tt> glutSolidSphere</tt>" functions
1192 render a sphere centered at the origin of the modeling coordinate system.&nbsp;
1193 The north and south poles of the sphere are on the positive and negative
1194 Z-axes respectively and the prime meridian crosses the positive X-axis.
1195 <p><b>Changes From GLUT</b>
1196 <p>None that we know of.
1197 <h2>
1198 15.2&nbsp; glutWireTorus, glutSolidTorus</h2>
1199 The "<tt>glutWireTorus</tt>" and "<tt>glutSolidTorus</tt>" functions draw
1200 a wireframe and solid torus (donut shape) respectively.
1201 <p><b>Usage</b>
1202 <p><tt>void glutWireTorus ( GLdouble dInnerRadius, GLdouble dOuterRadius,
1203 GLint nSides, GLint nRings ) ;</tt>
1204 <p><tt>void glutSolidTorus ( GLdouble dInnerRadius, GLdouble dOuterRadius,
1205 GLint nSides, GLint nRings ) ;</tt>
1206 <p><tt>dInnerRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
1207 desired inner radius of the torus, from the origin to the circle defining
1208 the centers of the outer circles
1209 <p><tt>dOuterRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
1210 desired outer radius of the torus, from the center of the outer circle
1211 to the actual surface of the torus
1212 <p><tt>nSides&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1213 number of segments in a single outer circle of the torus
1214 <p><tt>nRings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1215 number of outer circles around the origin of the torus
1216 <p><b>Description</b>
1217 <p>The "<tt>glutWireTorus</tt>" and "<tt> glutSolidTorus</tt>" functions
1218 render a torus centered at the origin of the modeling coordinate system.&nbsp;
1219 The torus is circularly symmetric about the Z-axis and starts at the positive
1220 X-axis.
1221 <p><b>Changes From GLUT</b>
1222 <p>None that we know of.
1223 <h2>
1224 15.3&nbsp; glutWireCone, glutSolidCone</h2>
1225 The "<tt>glutWireCone</tt>" and "<tt>glutSolidCone</tt>" functions draw
1226 a wireframe and solid cone respectively.
1227 <p><b>Usage</b>
1228 <p><tt>void glutWireCone ( GLdouble base, GLdouble height, GLint slices,
1229 GLint stacks ) ;</tt>
1230 <p><tt>void glutSolidCone ( GLdouble base, GLdouble height, GLint slices,
1231 GLint stacks ) ;</tt>
1232 <p><tt>base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
1233 desired radius of the base of the cone
1234 <p><tt>height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1235 height of the cone
1236 <p><tt>slices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1237 number of slices around the base of the cone
1238 <p><tt>stacks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1239 number of segments between the base and the tip of the cone (the number
1240 of points, including the tip, is <tt>stacks + 1</tt>)
1241 <p><b>Description</b>
1242 <p>The "<tt>glutWireCone</tt>" and "<tt> glutSolidCone</tt>" functions
1243 render a right circular cone with a base centered at the origin and in
1244 the X-Y plane and its tip on the positive Z-axis.&nbsp; The wire cone is
1245 rendered with triangular elements.
1246 <p><b>Changes From GLUT</b>
1247 <p>None that we know of.
1248 <h2>
1249 15.4&nbsp; glutWireCube, glutSolidCube</h2>
1250 The "<tt>glutWireCube</tt>" and "<tt>glutSolidCube</tt>" functions draw
1251 a wireframe and solid cube respectively.
1252 <p><b>Usage</b>
1253 <p><tt>void glutWireCube ( GLdouble dSize ) ;</tt>
1254 <p><tt>void glutSolidCube ( GLdouble dSize ) ;</tt>
1255 <p><tt>dSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1256 length of an edge of the cube
1257 <p><b>Description</b>
1258 <p>The "<tt>glutWireCube</tt>" and "<tt> glutSolidCube</tt>" functions
1259 render a cube of the desired size, centered at the origin.&nbsp; Its faces
1260 are normal to the coordinate directions.
1261 <p><b>Changes From GLUT</b>
1262 <p>None that we know of.
1263 <h2>
1264 15.5&nbsp; glutWireTetrahedron, glutSolidTetrahedron</h2>
1265 The "<tt>glutWireTetrahedron</tt>" and "<tt>glutSolidTetrahedron</tt>"
1266 functions draw a wireframe and solid tetrahedron (four-sided Platonic solid)
1267 respectively.
1268 <p><b>Usage</b>
1269 <p><tt>void glutWireTetrahedron ( void ) ;</tt>
1270 <p><tt>void glutSolidTetrahedron ( void ) ;</tt>
1271 <p><b>Description</b>
1272 <p>The "<tt>glutWireTetrahedron</tt>" and "<tt>glutSolidTetrahedron</tt>"
1273 functions render a tetrahedron whose corners are each a distance of one
1274 from the origin.&nbsp; The length of each side is 2/3 sqrt(6).&nbsp; One
1275 corner is on the positive X-axis and another is in the X-Y plane with a
1276 positive Y-coordinate.
1277 <p><b>Changes From GLUT</b>
1278 <p>None that we know of.
1279 <h2>
1280 15.6&nbsp; glutWireOctahedron, glutSolidOctahedron</h2>
1281 The "<tt>glutWireOctahedron</tt>" and "<tt>glutSolidOctahedron</tt>" functions
1282 draw a wireframe and solid octahedron (eight-sided Platonic solid) respectively.
1283 <p><b>Usage</b>
1284 <p><tt>void glutWireOctahedron ( void ) ;</tt>
1285 <p><tt>void glutSolidOctahedron ( void ) ;</tt>
1286 <p><b>Description</b>
1287 <p>The "<tt>glutWireOctahedron</tt>" and "<tt>glutSolidOctahedron</tt>"
1288 functions render an octahedron whose corners are each a distance of one
1289 from the origin.&nbsp; The length of each side is sqrt(2).&nbsp; The corners
1290 are on the positive and negative coordinate axes.
1291 <p><b>Changes From GLUT</b>
1292 <p>None that we know of.
1293 <h2>
1294 15.7&nbsp; glutWireDodecahedron, glutSolidDodecahedron</h2>
1295 The "<tt>glutWireDodecahedron</tt>" and "<tt>glutSolidDodecahedron</tt>"
1296 functions draw a wireframe and solid dodecahedron (twelve-sided Platonic
1297 solid) respectively.
1298 <p><b>Usage</b>
1299 <p><tt>void glutWireDodecahedron ( void ) ;</tt>
1300 <p><tt>void glutSolidDodecahedron ( void ) ;</tt>
1301 <p><b>Description</b>
1302 <p>The "<tt>glutWireDodecahedron</tt>" and "<tt>glutSolidDodecahedron</tt>"
1303 functions render a dodecahedron whose corners are each a distance of sqrt(3)
1304 from the origin.&nbsp; The length of each side is sqrt(5)-1.&nbsp; There
1305 are twenty corners; interestingly enough, eight of them coincide with the
1306 corners of a cube with sizes of length 2.
1307 <p><b>Changes From GLUT</b>
1308 <p>None that we know of.
1309 <h2>
1310 15.8&nbsp; glutWireIcosahedron, glutSolidIcosahedron</h2>
1311 The "<tt>glutWireIcosahedron</tt>" and "<tt>glutSolidIcosahedron</tt>"
1312 functions draw a wireframe and solid icosahedron (twenty-sided Platonic
1313 solid) respectively.
1314 <p><b>Usage</b>
1315 <p><tt>void glutWireIcosahedron ( void ) ;</tt>
1316 <p><tt>void glutSolidIcosahedron ( void ) ;</tt>
1317 <p><b>Description</b>
1318 <p>The "<tt>glutWireIcosahedron</tt>" and "<tt>glutSolidIcosahedron</tt>"
1319 functions render an icosahedron whose corners are each a unit distance
1320 from the origin.&nbsp; The length of each side is slightly greater than
1321 one.&nbsp; Two of the corners lie on the positive and negative X-axes.
1322 <p><b>Changes From GLUT</b>
1323 <p>None that we know of.
1324 <h2>
1325 15.7&nbsp; glutWireRhombicDodecahedron, glutSolidRhombicDodecahedron</h2>
1326 The "<tt>glutWireRhombicDodecahedron</tt>" and "<tt>glutSolidRhombicDodecahedron</tt>
1327 " functions draw a wireframe and solid rhombic dodecahedron (twelve-sided
1328 semi-regular solid) respectively.
1329 <p><b>Usage</b>
1330 <p><tt>void glutWireRhombicDodecahedron ( void ) ;</tt>
1331 <p><tt>void glutSolidRhombicDodecahedron ( void ) ;</tt>
1332 <p><b>Description</b>
1333 <p>The "<tt>glutWireRhombicDodecahedron</tt> " and "<tt>glutSolidRhombicDodecahedron</tt>"
1334 functions render a rhombic dodecahedron whose corners are at most a distance
1335 of one from the origin.&nbsp; The rhombic dodecahedron has faces which
1336 are identical rhombuses (rhombi?) but which have some vertices at which
1337 three faces meet and some vertices at which four faces meet.&nbsp; The
1338 length of each side is sqrt(3)/2.&nbsp; Vertices at which four faces meet
1339 are found at (0, 0, <u>+</u>1) and (<u> +</u>sqrt(2)/2, <u>+</u>sqrt(2)/2,
1340 0).
1341 <p><b>Changes From GLUT</b>
1342 <p>GLUT does not include these functions.
1343 <h2>
1344 15.10&nbsp; glutWireTeapot, glutSolidTeapot</h2>
1345 The "<tt>glutWireTeapot</tt>" and "<tt>glutSolidTeapot</tt>" functions
1346 draw a wireframe and solid teapot respectively.
1347 <p><b>Usage</b>
1348 <p><tt>void glutWireTeapot ( GLdouble dSize ) ;</tt>
1349 <p><tt>void glutSolidTeapot ( GLdouble dSize ) ;</tt>
1350 <p><tt>dSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt>The desired
1351 size of the teapot
1352 <p><b>Description</b>
1353 <p>The "<tt>glutWireTeapot</tt>" and "<tt> glutSolidTeapot</tt>" functions
1354 render a teapot of the desired size, centered at the origin.&nbsp; This
1355 is the famous OpenGL teapot [add reference].
1356 <p><b>Changes From GLUT</b>
1357 <p>None that we know of.
1358 <h1>
1359 16.0&nbsp;<a NAME="GameMode"></a> Game Mode Functions</h1>
1360
1361 <h2>
1362 16.1&nbsp; glutGameModeString</h2>
1363
1364 <h2>
1365 16.2&nbsp; glutEnterGameMode, glutLeaveGameMode</h2>
1366
1367 <h2>
1368 16.3&nbsp; glutGameModeGet</h2>
1369
1370 <h1>
1371 17.0&nbsp;<a NAME="VideoResize"></a> Video Resize Functions</h1>
1372
1373 <h2>
1374 17.1&nbsp; glutVideoResizeGet</h2>
1375
1376 <h2>
1377 17.2&nbsp; glutSetupVideoResizing, glutStopVideoResizing</h2>
1378
1379 <h2>
1380 17.3&nbsp; glutVideoResize</h2>
1381
1382 <h2>
1383 17.4&nbsp; glutVideoPan</h2>
1384
1385 <h1>
1386 18.0&nbsp;<a NAME="ColorMap"></a> Color Map Functions</h1>
1387
1388 <h2>
1389 18.1&nbsp; glutSetColor, glutGetColor</h2>
1390
1391 <h2>
1392 18.2&nbsp; glutCopyColormap</h2>
1393
1394 <h1>
1395 19.0&nbsp;<a NAME="Miscellaneous"></a> Miscellaneous Functions</h1>
1396
1397 <h2>
1398 19.1&nbsp; glutIgnoreKeyRepeat, glutSetKeyRepeat</h2>
1399
1400 <h2>
1401 19.2&nbsp; glutForceJoystickFunc</h2>
1402
1403 <h2>
1404 19.3&nbsp; glutReportErrors</h2>
1405
1406 <h1>
1407 20.0&nbsp;<a NAME="UsageNotes"></a> Usage Notes</h1>
1408
1409 <p>
1410 The following environment variables are recognized by FreeGLUT:
1411 </p>
1412 <ul>
1413 <li>GLUT_FPS - specifies a time interval (in milliseconds) for
1414 reporting framerate messages to stderr.  For example, if FREEGLUT_FPS
1415 is set to 5000, every 5 seconds a message will be printed to stderr
1416 showing the current frame rate.  The frame rate is measured by
1417 counting the number of times glutSwapBuffers() is called over the time
1418 interval.
1419 </ul>
1420
1421
1422 <h1>
1423 21.0&nbsp;<a NAME="ImplementationNotes"></a> Implementation Notes</h1>
1424
1425 <h1>
1426 22.0&nbsp;<a NAME="GLUT_State"></a> GLUT State</h1>
1427
1428 <h1>
1429 23.0&nbsp;<a NAME="Freeglut.h_Header"></a> "freeglut.h" Header File</h1>
1430
1431 <p>
1432 FreeGLUT users should normally just include GL/glut.h in their programs.
1433 Programs which need FreeGLUT-specific functions should also include
1434 GL/freeglut_ext.h as follows:
1435 </p>
1436
1437 <pre>
1438 #include &lt;GL/glut.h&gt;
1439 #ifdef FREEGLUT
1440 #include &lt;GL/freeglut_ext.h&gt;
1441 #endif
1442 </pre>
1443
1444 <p>
1445 Compile-time FreeGLUT version testing can be done as follows:
1446 </p>
1447
1448 <pre>
1449 #ifdef FREEGLUT_VERSION_1_3
1450   code specific to FreeGLUT 1.3 or later here
1451 #endif
1452 </pre>
1453
1454 <p>
1455 In future releases, FREEGLUT_VERSION_1_4, FREEGLUT_VERSION_1_5, etc will
1456 be defined.  This scheme mimics OpenGL conventions.
1457 </p>
1458
1459 <p>
1460 The FreeGLUT version can be queried at runtime by calling
1461 glutGet(GLUT_VERSION).
1462 The result will be X*10000+Y*100+Z where X is the major version, Y is the
1463 minor version and Z is the patch level.
1464 </p>
1465 <p>
1466 This may be used as follows:
1467 </p>
1468
1469 <pre>
1470 if (glutGet(GLUT_VERSION) < 10300) {
1471     printf("Sorry, you need FreeGLUT version 1.3.0 or later to run this program.\n");
1472     exit(1);
1473 }
1474 </pre>
1475
1476
1477 <h1>
1478 24.0&nbsp;<a NAME="References"></a> References</h1>
1479
1480 <h1>
1481 25.0&nbsp;<a NAME="Index"></a> Index</h1>
1482 &nbsp;
1483 <p>&nbsp;
1484 <br>&nbsp;
1485 <br>&nbsp;
1486 <br>&nbsp;
1487 <br>&nbsp;
1488 <br>&nbsp;
1489 <br>&nbsp;
1490 <br>&nbsp;
1491 <br>&nbsp;
1492 <br>&nbsp;
1493 <br>&nbsp;
1494 <br>&nbsp;
1495 <br>&nbsp;
1496 <br>&nbsp;
1497 <br>&nbsp;
1498 <br>&nbsp;
1499 <br>&nbsp;
1500 <br>&nbsp;
1501 <br>&nbsp;
1502 <br>&nbsp;
1503 <br>&nbsp;
1504 <br>&nbsp;
1505 <br>&nbsp;
1506 </body>
1507 </html>