starrysky 发表于 2006-8-3 21:47

[分享]OpenGL的一些资源

<P>有时候当你在程序中引用glut.h时,会出现出错的提示,这是因为与glut.h相关的文件不全,下面给出的是最基本的文件<br>[attach]10483[/attach]<br><br></P><br>
[align=right][color=#000066][此贴子已经被作者于2007-9-23 16:30:50编辑过][/color][/align]

starrysky 发表于 2006-8-3 21:53

<P>FAQ for glut<BR><BR>--</P>
<P>Q1:  I've tried to use the "mkmkfiles.imake" script to generate<BR>     Makefiles so I can build GLUT, but it doesn't seem to work.  What<BR>     should I try?</P>
<P>A1:  While Imakefiles are supposted to be system independent (hence<BR>     the "I"), the commands to translate Imakefiles into Makefiles<BR>     varies from system to system.  The X Consortium provides a command<BR>     called "xmkmf", but vendors do not put this command in a<BR>     consistent place.  The "mkmkfiles.imake" script tries its best to<BR>     generate Makefiles, but may get confused by different vendors<BR>     configurations that I am not aware of.</P>
<P>     It is also possible the imake configuration files (typically<BR>     located at /usr/lib/X11/config) are buggy or from a very old<BR>     version of X.</P>
<P>     SGI users can benefit from using the "mkmkfile.sgi" script that<BR>     uses SGI's parallel make, though "mkmkfiles.imake" should work<BR>     too.</P>
<P>--</P>
<P>Q2:  GLUT needs improved menus, dialog boxes, scrollbars, text<BR>     entry fields, etc. to be useful to me.  What should I do?</P>
<P>A2:  GLUT does not pretend to be a full-featured graphical user<BR>     interface toolkit.</P>
<P>     You _could_ write these sorts of GUI objects using GLUT and OpenGL<BR>     if you needed to.  The other alternative is to use Motif or<BR>     whatever full featured toolkit you have.</P>
<P>     A little toolkit called micro-UI uses OpenGL for rendering and is<BR>     based on GLUT.  The toolkit was developed by Tom Davis.  See the<BR>     README.mui file the accompanies GLUT 3.5 and up.</P>
<P>--</P>
<P>Q3:  What new things are in GLUT 3.0?</P>
<P>A3:  See README.glut3 or read The OpenGL Utility (GLUT) Programming<BR>     Interface document.</P>
<P>--</P>
<P>Q4:  Is there a version of GLUT for Windows NT or Windows 95?</P>
<P>A4:  As of GLUT 3.5, GLUT now builds for both Win32 and X11 window<BR>     systems.  Much thanks to Nate Robins.  See the README.win file<BR>     contained in GLUT 3.5 for details.  GLUT 3.6 improved the Win32<BR>     GLUT support considerably.</P>
<P>--</P>
<P>Q5:  Is there a version of GLUT for OS/2?</P>
<P>A5:  Yes.  I believe a version based on GLUT 2.x is distributed on an<BR>     OS/2 OpenGL developer's CD-ROM.</P>
<P>     You may have reasonable luck porting the Win32 version of the<BR>     GLUT 3.6 distribution to OS/2.  If you manage to do this, please<BR>     contact me.</P>
<P>--</P>
<P>Q6:  Is there a version of GLUT for the Power Macintosh?</P>
<P>A6:  Conix Graphics supplies GLUT 3.5 with their Macintosh OpenGL<BR>     implementation.  See <a href="http://www.conix3d.com" target="_blank" >http://www.conix3d.com</A>.</P>
<P>     Was told by Template Graphics that an incomplete version of<BR>     GLUT had been developed for their OpenGL product for the Power<BR>     Macintosh.  I am not sure if it was ever completed or made<BR>     available.</P>

<P>--</P>
<P>Q7:  I'm hesitant about upgrading to GLUT 3.0 since I've got things<BR>     working will with GLUT 2.3.  Is the transition painful?</P>
<P>A7:  I do not believe so.  There are two changes worth noting that<BR>     _may_ affect programs you have written.</P>
<P>     First, you need a display callback registered before your display<BR>     your windows on the screen.  It did not make sense for this to not<BR>     be true.  In all likeihood, this should not affect your GLUT<BR>     programs if they written well.</P>
<P>     Second, you can no longer change, create, or destroy menus while<BR>     pop-up menus are in use.  Before, you could do this, but it meant<BR>     a menu might be changed while in use.  It was near impossible to<BR>     describe what should happen in the case of menus being changed<BR>     while in use that was likely to be portable to the way other<BR>     window systems handled menus, so I made the practice illegal.</P>
<P>     You can register a menu status callback to know when menus become<BR>     used and unused to avoid changing menus while they are in use.</P>
<P>     For more details about what has changed, see the CHANGES file.</P>
<P>--</P>
<P>Q8:  So how do I use GLUT and Motif together?</P>
<P>A8:  You don't.  To make GLUT simple and easy-to-program, GLUT<BR>     supplies its own event processing loop.  This makes it nearly<BR>     impossible to combine GLUT and Motif.  If you want Motif, you<BR>     probably want a full-featured toolkit, and you ship skip GLUT and<BR>     implement your application directly in Motif.</P>
<P>--</P>
<P>Q9:  I have a bunch of simple OpenGL programs using the aux toolkit<BR>     descibed in the OpenGL Programming Guide (the "red" book).  Is<BR>     there an easy way to convert them to GLUT?</P>
<P>A9:  In the progs/redbook directory, there is a script named<BR>     aux2glut.sed  It will give you a good start at converting simple<BR>     aux calls to their GLUT equivalents.  It is a good start, but<BR>     you'll still have to hand edit some things.</P>
<P>     Here's a usage example:</P>
<P>     sed -f aux2glut.sed &lt; aux_prog. &gt; glut_prog.c</P>
<P>     Note that the second edition of the OpenGL Programming Guide uses<BR>     GLUT and not the aux toolkit.</P>
<P>--</P>
<P>Q10: I have IRIX 6.2 (or 6.1) and I'd like to write GLUT programs<BR>     run in true 64-bit and/or benefit from the recent, faster MIPS<BR>     processors.  How do I build GLUT to support these newer<BR>     application binary interfaces (ABIs)?</P>
<P>A10: See README.irix6</P>
<P>--</P>
<P>Q11: I'd like to write FORTRAN programs using GLUT and OpenGL.  How<BR>     do I use GLUT with FORTRAN?</P>
<P>A11: GLUT does have a FORTRAN language binding.</P>
<P>     For instructions for building a binding library for Silicon<BR>     Graphics workstations, see README.fortran</P>
<P>     If you want to use GLUT and OpenGL or Mesa on with Fortran on<BR>     non-SGI systems, I recommend that you check, William Mitchell's<BR>     f90gl home page: <a href="http://math.nist.gov/f90gl/" target="_blank" >http://math.nist.gov/f90gl/</A></P>
<P>--</P>
<P>Q12: I'd like to use the sophisticated input devices that GLUT<BR>     supports.  What should I know about this?</P>
<P>A12: GLUT uses the X Input extension to talk to these devices.  Because<BR>     the X Input extension gives a framework for supporting input<BR>     devices, but does not manadate how particular devices are<BR>     supported, it is possible that each vendor supports the same input<BR>     devices differently.</P>
<P>     GLUT as implemented supports SGI's means of advertising the<BR>     tablet, dial &amp; button box, and Spaceball devices.  I am not sure<BR>     how other vendors support these devices.  For the details of SGI's<BR>     support for these devices, see README.xinput  Since there is no<BR>     benefit in each vendor supporting these same devices in a<BR>     different an incompatible way, I encourage other vendors to<BR>     implement their devices in this same manner.</P>
<P>--</P>
<P>Q13: Can I use GLUT and Open Inventor?</P>
<P>A13: Yes.  See the README.inventor file.  Also, some source code<BR>     examples can be found at progs/inventor</P>
<P>     Because the Open Inventor development enviornment is not supported<BR>     on all systems, the Inventor example programs are not built by<BR>     default, and the Makefile there only support SGI systems.</P>
<P>--</P>
<P>Q14: I have Sun workstation, and it is supposed to support overlays.<BR>     So why does GLUT not use them?</P>
<P>A14: GLUT uses the SERVER_OVERLAY_VISUALS convention that advertises<BR>     overlay visuals.  Most major workstation vendors support this<BR>     convention (DEC, HP, IBM, SGI), but Sun only support the<BR>     SERVER_OVERLAY_VISUALS in their latest Creator 3D hardware.</P>
<P>--</P>
<P>Q15: The stroke font used for GLUT looks familar.  Where did it come<BR>     from?</P>
<P>A15: The data for the "stroke roman" font is lifted from the X11R5<BR>     PEX sample implementation.<BR></P>

starrysky 发表于 2006-8-3 21:54

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

starrysky 发表于 2006-8-3 21:54

<P>--</P>
<P>Q31:  What is new in GLUT 3.4?</P>
<P>A31:  GLUT 3.4 is an incremental release. An Ada binding for SGI<BR>      machines is included along with an Ada example.  Many new sample<BR>      programs. Several such as dinoshade.c demonstrate real-time<BR>      rendering techniques relevant for games. Examples using Sam<BR>      Leffler's libtiff library for loading, drawing and writing TIFF<BR>      image files. GLUT version of the facial animation "geoview"<BR>      decibed in the Parke and Water's book "Computer Facial<BR>      Animation". New API interfaces to be made part of the GLUT 4 API<BR>      update (not yet fully finalized though). glutInitDisplayMode for<BR>      example. Improved portability and a few bug fixes.<BR><BR><BR>--</P>
<P>Q32:  I installed SGI's Cosmo3D beta and GLUT, and I'm having problems<BR>      compiling GLUT programs.  What gives?</P>
<P>A32:  Unfortunately, SGI's Cosmo3D beta images install a DSO for GLUT<BR>      (libglut.so) that does not fully implement the GLUT API and lacks<BR>      some of the newer GLUT 3.4 entrypoints as well.  The problem is<BR>      that a DSO takes preferenc over an archive when you compile with<BR>      an option like "-lglut".  While the Cosmo3D beta installs a<BR>      libglut.so, my GLUT distribution and images only build and<BR>      install an archive.  There are a couple of solutions:</P>
<P>      1)  Explicitly link your GLUT programs with libglut.a (the<BR>      archive version of GLUT).  For example, put "/usr/lib/libglut.a"<BR>      on your compile line instead of "-lglut".</P>
<P>      2)  You can convert the GLUT 3.4 archive into a DSO:</P>
<P>        su<BR>        cd /usr/lib<BR>        mv libglut.so libglut.so.cosmo<BR>        cc -32 -o libglut.so -shared -all libglut.a<BR>        cd /usr/lib32<BR>        mv libglut.so libglut.so.cosmo<BR>        cc -n32 -o libglut.so -shared -all libglut.a</P>
<P>      The new DSO generated from the GLUT 3.4 DSO should be<BR>      compatible with the old Cosmo version.  This will mean that<BR>      all the GLUT programs you build will need the libglut.so on<BR>      the machine they run on.</P>
<P>      3)  Remove the Cosmo3D beta.</P>
<P>--</P>
<P>Q33:  What is new in GLUT 3.5?</P>
<P>A33:  The most significant change with GLUT 3.5 is unifying the X<BR>      Window System and Win32 versions of GLUT into a single source<BR>      code distribution.  Henk Kok contributed several cool new demos<BR>      (rollercoaster, chess, opengl_logo). All the demos build cleanly<BR>      under Win32. Lots of bug fixes.  Interesting new OpenGL rendering<BR>      techniques are demonstrated in a number of new examples:<BR>      movelight, dinoshade, halomagic, rendereps, movelight, shadowfun,<BR>      torus_test, underwater, texfont, reflectdino.</P>
<P>--</P>
<P>Q34:  How do I use the precompiled Win32 GLUT DLLs with Borland compilers?</P>
<P>A34:  The "implib" command should let you generate a GLUT.LIB that works<BR>      with Borland compilers from the precompiled GLUT.DLL  Here is an<BR>      example:</P>
<P>        C:\&gt;implib C:\GLUT\LIB\GLUT.LIB C:\WINDOWS\SYSTEM\GLUT.DLL</P>
<P>      After this, then link C:\GLUT\LIB\GLUT.LIB to your project<BR>      <BR>      Suggested by Carter &lt;<a href="mailto:carter@extremezone.com" target="_blank" >carter@extremezone.com</A>&gt;.</P>
<P>--</P>
<P>Q35:  Are there any C++ wrappers for GLUT?</P>
<P>A35:  Yes, George Stetten (<a href="mailto:stetten@acpub.duke.edu" target="_blank" >stetten@acpub.duke.edu</A>) of Duke University has<BR>      made available the GlutMaster C++ wrapper classes.  See:</P>
<P>    <a href="http://www.duke.edu/~stetten/GlutMaster/GlutMaster.html" target="_blank" >http://www.duke.edu/~stetten/GlutMaster/GlutMaster.html</A><BR>    <a href="http://www.duke.edu/~stetten/GlutMaster/README.txt" target="_blank" >http://www.duke.edu/~stetten/GlutMaster/README.txt</A></P>
<P>--</P>
<P>Q36:  How do you avoid the Console window appearing when you compiler a<BR>      Win32 GLUT application with Microsoft compilers?</P>
<P>A36:  Try using the following Microsoft Visual C compiler flags:</P>
<P>    /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup</P>
<P>      These are linker options... if main or wmain are defined, MSVC<BR>      build a CONSOLE app by default; hence the need for<BR>      /SUBSYSTEM:WINDOWS. if /SUBSYSTEM:WINDOWS is defined, MSVC<BR>      expects WinMain or wWinMain to be defined; hence the need to<BR>      /ENTRY:mainCRTStartup (eg the entry point is the usual C main).</P>
<P>      stdout/stderr are [apparently] not "attached"; output via printf<BR>      is simply "eaten" unless redirected at the command-line or by a<BR>      parent program.</P>
<P>      Information thanks to Jean-David Marrow (<a href="mailto:jd@riverbed.com" target="_blank" >jd@riverbed.com</A>).</P>
<P>--</P>
<P>Q37:  What is new in GLUT 3.6?</P>
<P>A37:  GLUT 3.6 adds/improves the following:</P>
<P>      o  Win32 GLUT performance improvements.</P>
<P>      o  Win32 GLUT confromance improvements.</P>
<P>      o  Linas Vepstas's GLE Tubing &amp; Extrusions Library is<BR>     included with GLUT, including nroff man pages and<BR>     demo programs.</P>
<P>      o  More GLUT-based OpenGL demos and examples (and bug<BR>     fixes to existing demos and examples).</P>
<P>      o  glutPostWindowRedisplay and glutPostWindowOverlayRedisplay<BR>     entry points added for posting redisplays on non-current<BR>     windows (for faster multi-window updates).</P>
<P>      o  Bug fixes and minor functionality improvements to Tom Davis's<BR>     micro-UI GLUT-based user interface toolkit.</P>
<P>      See the "CHANGES" file that accompanies GLUT 3.6 for a fuller<BR>      list of changes.</P>
<P>--</P>
<P>Q38:  On my IRIX 6.3 SGI O2 workstation, why do I get errors about<BR>      "glXChannelRectSyncSGIX" being unresolved building certain GLUT<BR>      examples?</P>
<P>A38:  The original IRIX 6.3 release for the O2 workstation accidently<BR>      advertised support for the dynamic video resize extension supported<BR>      on SGI's high-end InfiniteReality graphics system.  This confuses<BR>      GLUT into providing its dynamic video resize sub-API.</P>
<P>      This problem is fixed by patch 1979 (and its successor patches).<BR>      Because patch 1979 (and its successor patches) also help O2's<BR>      OpenGL rendering performance, I strongly recommend requesting<BR>      the latest O2 OpenGL patch from SGI customer support.</P>
<P>      Once the patch is installed, your build errors will be resolved.</P>
<P>--</P>
<P>Q39:  Using GLUT with Microsoft OpenGL 1.1 and compiling GLUT with<BR>      Borland compilers causes GLUT applications to generates floating<BR>      point exceptions.  What can be done?</P>
<P>A39:  Under certain conditions (e.g. while rendering solid surfaces<BR>      with lighting enabled) MS libraries cause some illegal operations<BR>      like floating point overflow or division by zero. The default<BR>      behaviour of Microsoft compilers is to mask (ignore) floating<BR>      point exceptions, while Borland compilers do not.  A function of<BR>      Borland run-time library allows to mask exceptions.  Modify<BR>      glut_init.c by adding the following lines to the function<BR>      __glutOpenWin32Connection.</P>
<P>#ifdef __BORLANDC__<BR>#include &lt;float.h&gt;<BR>  _control87(MCW_EM,MCW_EM);<BR>#endif</P>
<P>      With this modification, compiling the GLUT library with your<BR>      Borland compilers and using GLUT with Microsoft OpenGL should<BR>      work fine.</P>
<P>      GLUT 3.7 will have this change already included in the GLUT<BR>      library source code distribution.</P>
<P>      This advice comes from Pier Giorgio Esposito (<a href="mailto:mc2172@mclink.it" target="_blank" >mc2172@mclink.it</A>).</P>
<P>--</P>
<P>Q40:  Using GLUT with SGI OpenGL for Windows and compiling with<BR>      Borland compilers results in linking problems.  What can be<BR>      done?</P>
<P>A40:  Some care must be taken when linking GLUT.DLL or programs<BR>      that use it with Borland compilers.  The import library<BR>      IMPORT32.LIB already contains the functions exported by<BR>      the Microsoft OpenGL libraries, thus SGI OpenGL import<BR>      libraries must be listed _before_ import32 in the Borland<BR>      tlink command line.</P>
<P>      This advice comes from Pier Giorgio Esposito (<a href="mailto:mc2172@mclink.it" target="_blank" >mc2172@mclink.it</A>).</P>
<P>--</P>
<P>Q41:  What is GameGLUT?</P>
<P>A41:  GameGLUT is a set of API extension to GLUT to be released in<BR>      GLUT 3.7.  These extensions provide keyboard release callbacks,<BR>      disabling of keyboard auto repeat, joystick callbacks, and full<BR>      screen resolution setting.</P>
<P>--</P>
<P>- Mark<BR></P>

jig 发表于 2006-8-3 22:00

UP,十分感谢

starrysky 发表于 2006-8-3 22:06

份内事,应该的,平时我做的贡献比较少[em04]

一笔苍穹 发表于 2006-8-10 14:22

支持大大~~

卧龙孔明 发表于 2008-5-25 17:31

请教一下:
为什么我在网上下载的glut包内只有1个dll,1 个头文件,1个def文件,1个lib
与楼主提供的包内文件差许多

tiancifox 发表于 2008-8-29 15:14

谢谢

flyue 发表于 2008-8-29 18:17

还不如直接发个连接,我知道glut经常更新的

页: [1]

编程论坛