--
Q16: I read in the NOTICE file that you are writing a book on
programming OpenGL for the X Window System. Where can I get it?
A16: My book titled "Programming OpenGL for the X Window System" was
released in August of 1996. The book is published by
Addison-Wesley and the ISBN is 0-201-48359-9. If you have seen
the "red" and "blue" OpenGL books, this book looks very similar,
but has a green cover. More information can be found at:
http://reality.sgi.com/mjk_asd/OpenGLforX.html
http://aw.com/devpress/titles/48359.html
The book includes a tutorial chapter introducing the entire GLUT
API. Another chapter uses GLUT-based examples to explain various
OpenGL rendering features. An appedix describes the GLUT API
in detail. If you use GLUT, this book will be very helpful.
A Japanese translation is also available now (ISBN4-7952-9703-7).
--
Q17: You mention an unnamed bu "very large window system software
vendor" as the reason portable GLUT programs should not directly
include <GL/gl.h> and <GL/glu.h> directly. What's the vendor and
what are the details?
A17: Microsoft. It's version of <GL/gl.h> requires <windows.h> to be
included before <GL/gl.h> can be included because of Microsoft
function declaration conventions. Sigh.
--
Q18: I want my GLUT program to read and send information over a socket
to some other program. How do I do this in in GLUT?
A18: You can not do it currently. I am considering such support for
a possible GLUT 4.0. I'd like to have a portable solution.
What you'd like is a callback that would tell you when a socket is
ready for reading and writing. I'm hoping to find a way to
support this in an operating system independent manner. Does
anyone know of a good portable interface for networked bytestream
connections?
For now, you've got the source code to GLUT and you could hack it
into GLUT for whatever particular interface your operating system
provides.
--
Q19: Where's the best place to ask questions about GLUT or OpenGL? Can
I just email them to you?
A19: While I may try to return email if I have time, the best place
is the comp.graphics.api.opengl newsgroup. This gives a lot more
people a chance to answer your question and you'll probably get an
answer much faster than sending me email. Plus, I may not know
the answer though someone on the "net" may know it.
--
Q20: My workstation doesn't have OpenGL. Where can I get a free copy
to use with GLUT?
A20: OpenGL is licensed by Silicon Graphics and is not available as
"free" or "public domain" software, but workstation vendors
typically bundle OpenGL software with their workstation. However,
there is a package called Mesa written by Brian Paul at the
University of Wisconsin that implements the OpenGL API. (To be
branded as "OpenGL", an implementation must be licensed _and_ pass
the Architectural Review Board's conformance suite, so Mesa is not
an official "OpenGL" implementation.) Mesa does work with GLUT.
Mesa 2.5 and beyond include GLUT with the Mesa source code
distribution.
--
Q21: I hear GLUT 3.0 has overlay support. Where is an example?
A21: Look at progs/examples/zoomdino.c for an example of using overlays
for rubber-banding and display of a help message, both in the
overlays. Also, test/over_test.c exercises all of the overlay
routines.
--
Q22: I get BadMatch X protocol errors when I run GLUT programs. What gives?
A22: There is a bug in the Solaris 2.4 and 2.5 implementation of
XmuLookupStandardColormap (fixed in Solaris 2.6). When you compile GLUT
on Solaris 2.4 or 2.5, please apply the following patch and compile
with -DSOLARIS_2_4_BUG to workaround the problem. See the comment in
the patch below. This code is already in GLUT 3.1.
*** glut_win.c Wed Apr 24 14:06:08 1996
--- glut_win.c.bad Wed Apr 24 14:03:58 1996
***************
*** 398,414 ****
case TrueColor:
case DirectColor:
*colormap = NULL; /* NULL if RGBA */
- #ifndef SOLARIS_2_4_BUG
- /* Solaris 2.4 has a bug in its XmuLookupStandardColormap
- implementation. Please compile your Solaris 2.4 version
- of GLUT with -DSOLARIS_2_4_BUG to work around this bug.
- The symptom of the bug is that programs will get a
- BadMatch error from X_CreateWindow when creating a GLUT
- window because Solaris 2.4 creates a corrupted
- RGB_DEFAULT_MAP property. Note that this workaround
- prevents Colormap sharing between applications, perhaps
- leading unnecessary colormap installations or colormap
- flashing. */
status = XmuLookupStandardColormap(__glutDisplay,
vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP,
/* replace */ False, /* retain */ True);
--- 398,403 ----
***************
*** 423,429 ****
return;
}
}
- #endif
/* If no standard colormap but TrueColor, just make a
private one. */
/* XXX Should do a better job of internal sharing for
--- 412,417 ----
--
Q23: What is new in GLUT 3.1?
A23: GLUT 3.1 is largely a maintence release. There are some new programs, a
few minor GLUT library bug fixes, but mostly GLUT 3.1 is to make sure GLUT
builds cleanly on various platforms like SunOS, HP/UX, Solaris, and Linux.
See the CHANGES file included in the distribution for more details.
--
Q24: How do I make Linux shared libraries for GLUT?
A24: Peter F. Martone (pmarton@mailbox.bgsu.edu) has written some
instructions for making a Linux shared library for GLUT. You can grab
the instructions for doing so from
http://pizza.bgsu.edu/cgi-bin/cgiwrap/~pmarton/makeMainIndex
--
Q25: What is new in GLUT 3.2?
A25: Like GLUT 3.1, GLUT 3.2 is a maintence release. Along with bug
fixes to the core GLUT library, many new GLUT example programs
have been added. The portability of the examples has been
improved so that most should build using Windows 95 and NT.
Also, GLUT API man pages are now included. See the CHANGES file
included in the distribution for more details.
--
Q26: I've heard GLUT 3.2 has man pages. How do I use them?
A26: Please see the README.man file for details. The easiest way for
SGI users to get the man pages is to install the "glut_dev.man.glut"
subsystem included with the pre-compiled SGI GLUT images.
--
Q27: What is the MESA_SWAP_HACK in GLUT 3.2? How does it help Mesa
users avoid excessive window redraws?
A27: The GLX specification states that the state of a window's back
color buffer after a glXSwapBuffers is undefined. However, the
freeware Mesa implementation of the OpenGL API always leaves
the back buffer with its previous contents (ie, it simply
"copies" the back buffer contents to the front buffer).
Because Mesa lacks hardware acceleration and is often slow to
redraw a window, this presents the opportunity to speed
redrawing a window damaged by window system interactions by
simply calling glXSwapBuffers again.
If you set the MESA_SWAP_HACK enviornment variable, GLUT 3.2
will try to repair double buffered windows not otherwise
needing a redisplay because of glutPostRedisplay by calling
glXSwapBuffers when Mesa is the OpenGL implementation being
used and the last display callback called glutSwapBuffers.
In general, this means if you see MESA_SWAP_HACK when using
Mesa, double buffered GLUT programs will redraw very quickly
after being damaged but still operate well if they've been
correctly written to use glutPostRedisplay to trigger
application required redraws.
I encourage all Mesa users to set the MESA_SWAP_HACK environment
variable.
--
Q28: I try to run the examples in progs/advanced but they don't work
for lack of image files. Where can I get those files?
A28: Yes, the image files these examples use are large and were
seperated out from the main GLUT source code distribution.
Get the glut_data.tar.gz file from where you got your
GLUT distribution. Untar these data files over your glut
distribution so the "data" directory is at the same level
as "progs". Then do a "make links" in the progs/advanced
directory to make symbolic links.
See the progs/advanced/README file for more details.
--
Q29: Why doesn't GLUT programs compiled on IRIX 6.4 or 6.3 work
earlier releases?
A29: First, SGI never guarantees that an executable built on a later
IRIX release will work on an earlier release. Sometimes it works;
more often than not it does not. GLUT takes advantage of a new X
optimization in IRIX 6.3 called "fast atoms". This optimization
lets X clients determine common atom values without an X server
round-trip. This helps X performance.
If you compile the GLUT library on an IRIX 6.3 or IRIX 6.4
machine, the library will support fast atoms. This will mean that
if you run executables linked against the "fast atom enabled"
version of the GLUT library, you'll get a run-time link error
saying something like:
17062:glut_example: rld: Fatal Error: attemped access to
unresolvable symbol in projtex: _XSGIFastInternAtom
Do not be alarmed. If you want, you can recompile the GLUT
library with the -DNO_FAST_ATOMS and get a version of the library
that doesn't have the support so that GLUT executables built with
a library compiled without "fast atoms" can work on earlier IRIX
releases. Note that even if you do compile with -DNO_FAST_ATOMS,
there is still no guarantee that an IRIX executable compiled on a
newer release will actually work on an older release (but at
least you'll have a chance!).
Note that the precompiled images lack "fast atoms" support so
they will work fine with IRIX releases before IRIX 6.3 and 6.4.
--
Q30: Can I get a version of GLUT for the Power Macintosh?
A30: Conix Graphics has released a port of GLUT
3.2 I believe. Try checking the Conix Graphics web site
http://www.conix3d.com for current info.