<h1> OpenGL Utility Toolkit</h1>
</center>
<center>
-<h1> (freeglut)</h1>
+<h1> (<i>freeglut</i> 2.0.0)</h1>
</center>
<center>
<h1> Application Programming Interface</h1>
</center>
<center>
-<h2> The freeglut Programming Consortium</h2>
+<h2> The <i>freeglut</i> Programming Consortium</h2>
</center>
<center>
-<h2> November, 2002</h2>
+<h2> July, 2003</h2>
</center>
<p><br>
as a subloop while a specific window was open, and then return to the calling
function. A new function, "<tt>glutMainLoopEvent</tt>", has been added
to allow this functionality. Another function, "<tt>glutLeaveMainLoop</tt>
-", has also been added to allow the application to tell freeglut to clean
+", has also been added to allow the application to tell <i>freeglut</i> to clean
up and close down.
<h3> 3.4.2 Action on Window Closure</h3>
Another difficulty with GLUT, especially with multiple-window programs,
to Silicon Graphics hardware have not been implemented. Most or all
of the new callbacks are listed in the GLUT Version 4 "glut.h" header file
but did not make it into the documentation. The new callbacks consist
-of regular and special key release callbacks, a joystick callback, a menu
-state callback (with one argument, distinct from the menu status callback
-which has three arguments), and a window status callback <br>
- (also with one argument). Unsupported callbacks are the three Spaceball
-callbacks, the ButtonBox callback, the Dials callback, and the two Tablet
+of regular and special key release callbacks, a joystick callback, a window
+status callback, window closure callbacks, a menu closure callback, and a
+mouse wheel callback. Unsupported callbacks are the three Spaceball
+callbacks, the ButtonBox callback, and the two Tablet
callbacks. If the user has a need for an unsupported callback he should
contact the <i>freeglut</i> development team.<br>
<h3>3.4.5 Geometry Rendering<br>
</h3>
- Two functions have been added to render a wireframe and a solid rhombic
-dodecahedron.
+ Functions have been added to render a wireframe and a solid rhombic
+dodecahedron, a cylinder, and a Sierpinski sponge.
<h3> 3.4.5 Extension Function Queries</h3>
glutGetProcAddress is a wrapper for the glXGetProcAddressARB and wglGetProcAddress
functions.
<h2> 13.2 glutGet</h2>
+
+<p>
+The following state variables may be queried with "<tt>glutGet</tt>".
+The returned value is an integer.
+</p>
+
+<p>
+These queries are with respect to the current window:
+</p>
+
+<ul>
+<li>GLUT_WINDOW_X - window X position
+<li>GLUT_WINDOW_Y - window Y position
+<li>GLUT_WINDOW_WIDTH - window width
+<li>GLUT_WINDOW_HEIGHT - window height
+<li>GLUT_WINDOW_BUFFER_SIZE - number of color or color index bits per pixel
+<li>GLUT_WINDOW_STENCIL_SIZE - number of bits per stencil value
+<li>GLUT_WINDOW_DEPTH_SIZE - number of bits per depth value
+<li>GLUT_WINDOW_RED_SIZE - number of bits per red value
+<li>GLUT_WINDOW_GREEN_SIZE - number of bits per green value
+<li>GLUT_WINDOW_BLUE_SIZE - number of bits per blue value
+<li>GLUT_WINDOW_ALPHA_SIZE - number of bits per alpha value
+<li>GLUT_WINDOW_ACCUM_RED_SIZE - number of red bits in the accumulation buffer
+<li>GLUT_WINDOW_ACCUM_GREEN_SIZE - number of green bits in the accumulation buffer
+<li>GLUT_WINDOW_ACCUM_BLUE_SIZE - number of blue bits in the accumulation buffer
+<li>GLUT_WINDOW_ACCUM_ALPHA_SIZE - number of alpha bits in the accumulation buffer
+<li>GLUT_WINDOW_DOUBLEBUFFER - 1 if the color buffer is double buffered, 0 otherwise
+<li>GLUT_WINDOW_RGBA - 1 if the color buffers are RGB[A], 0 for color index
+<li>GLUT_WINDOW_PARENT - parent window ID
+<li>GLUT_WINDOW_NUM_CHILDREN - number of child windows
+<li>GLUT_WINDOW_COLORMAP_SIZE - number of entries in the window's colormap
+<li>GLUT_WINDOW_NUM_SAMPLES - number of samples per pixel if using multisampling
+<li>GLUT_WINDOW_STEREO - 1 if the window supports stereo, 0 otherwise
+<li>GLUT_WINDOW_CURSOR - current cursor
+<li>GLUT_WINDOW_FORMAT_ID - on Windows, return the pixel format number of the current window
+</ul>
+
+<p>
+These queries do not depend on the current window.
+</p>
+
+<ul>
+<li>GLUT_SCREEN_WIDTH - width of the screen in pixels
+<li>GLUT_SCREEN_HEIGHT - height of the screen in pixels
+<li>GLUT_SCREEN_WIDTH_MM - width of the screen in millimeters
+<li>GLUT_SCREEN_HEIGHT_MM - height of the screen in millimeters
+<li>GLUT_MENU_NUM_ITEMS - number of items in the current menu
+<li>GLUT_DISPLAY_MODE_POSSIBLE - return 1 if the current display mode is supported, 0 otherwise
+<li>GLUT_INIT_WINDOW_X - X position last set by glutInitWindowPosition
+<li>GLUT_INIT_WINDOW_Y - Y position last set by glutInitWindowPosition
+<li>GLUT_INIT_WINDOW_WIDTH - width last set by glutInitWindowSize
+<li>GLUT_INIT_WINDOW_HEIGHT - height last set by glutInitWindowSize
+<li>GLUT_INIT_DISPLAY_MODE - display mode last set by glutInitDisplayMode
+<li>GLUT_ELAPSED_TIME - time (in milliseconds) elapsed since glutInit or glutGet(GLUT_ELAPSED_TIME) was first called
+<li>GLUT_INIT_STATE - ?
+<li>GLUT_VERSION - Return value will be X*10000+Y*100+Z where X is the
+ major version, Y is the minor version and Z is the patch level.
+ This query is only supported in <i>freeglut</i> (version 2.0.0 or later).
+</ul>
+
+
<h2> 13.3 glutDeviceGet</h2>
<h2> 13.4 glutGetModifiers</h2>
<h2> 13.7 glutGetProcAddress</h2>
<p><tt>glutGetProcAddress</tt> returns
-a pointer to a named GL or FreeGLUT function. </p>
+a pointer to a named GL or <i>freeglut</i> function. </p>
<p><b>Usage</b></p>
<p><tt>void *glutGetProcAddress ( const
char *procName ) ;</tt></p>
that supports the extension. By using a function pointer returned from glutGetProcAddress(),
the application will avoid this hard dependency and be more portable and interoperate
better with various implementations of OpenGL. </p>
- <p> Both OpenGL functions and FreeGLUT
+ <p> Both OpenGL functions and <i>freeglut</i>
functions can be queried with this function. </p>
- <p><b>NOTE</b>: this function is not supported
-in GLUT. </p>
+ <p><b>Changes From GLUT</b> </p>
+
+ <p>GLUT does not include this function.
+ </p>
+
<h1> 14.0 <a name="FontRendering"></a>
Font Rendering Functions</h1>
<i>Freeglut</i> supports two types of font rendering: bitmap fonts,
<h1> 21.0 <a name="ImplementationNotes"></a>
Implementation Notes</h1>
- <h1> 22.0 <a name="GLUT_State"></a>
- GLUT State</h1>
-
- <h1> 23.0 <a name="Freeglut.h_Header"></a>
- "freeglut.h" Header File</h1>
-
- <h1> 24.0 <a name="References"></a>
- References</h1>
-
- <h1> 25.0 <a name="Index"></a>
- Index</h1>
-
- <p> <br>
+<h1> 22.0 <a name="GLUT_State"></a>
+GLUT State</h1>
+
+<h1> 23.0 <a name="Freeglut.h_Header"></a>
+"freeglut.h" Header File</h1>
+
+
+<p>
+Application programmers who are porting their GLUT programs to <i>freeglut</i> may continue
+to include <tt><GL/glut.h></tt> in their programs.
+Programs which use the <i>freeglut</i>-specific extensions to GLUT should include
+<tt><GL/freeglut.h></tt>. One possible arrangement is as follows:
+</p>
+
+<pre>
+#ifdef FREEGLUT
+#include <GL/freeglut_ext.h>
+#else
+#include <GL/glut.h>
+#endif
+</pre>
+
+<p>
+Compile-time <i>freeglut</i> version testing can be done as follows:
+</p>
+
+<pre>
+#ifdef FREEGLUT_VERSION_2_0
+ code specific to freeglut 2.0 or later here
+#endif
+</pre>
+
+<p>
+In future releases, FREEGLUT_VERSION_2_1, FREEGLUT_VERSION_2_2, etc will
+be defined. This scheme mimics OpenGL conventions.
+</p>
+
+<p>
+The <i>freeglut</i> version can be queried at runtime by calling
+glutGet(GLUT_VERSION).
+The result will be X*10000+Y*100+Z where X is the major version, Y is the
+minor version and Z is the patch level.
+</p>
+<p>
+This may be used as follows:
+</p>
+
+<pre>
+if (glutGet(GLUT_VERSION) < 20001) {
+ printf("Sorry, you need freeglut version 2.0.1 or later to run this program.\n");
+ exit(1);
+}
+</pre>
+
+
+
+<h1> 24.0 <a name="References"></a>
+References</h1>
+
+<h1> 25.0 <a name="Index"></a>
+Index</h1>
+
+<p> <br>
<br>
<br>
<br>