GLUT for Win32 README --------------------VERSION/INFO: This is GLUT for Win32 version 3.7.6 as of Nov 8th 2001.

See the COPYRIGHT section for distribution and copyright notices. Send all bug reports and questions for this version of GLUT to Nate Robins []. For more information about GLUT for Win32, see the web page: or subscribe to the GLUT for Win32 mailing list by sending e-mail to with "subscribe glut" in the body of the message. For general information about GLUT, see the GLUT web page: and be sure to chec the GLUT FAQ first for any questions that you may have: COMPILING/INSTALLATION: o Precompiled versions of the DLL and import library can be found on the GLUT for Win32 web page mentioned above. o Microsoft Developer Studio 6 wor space and project files have been included in the source code distribution. To build the glut dll: First, open Microsoft Developer Studio. Then, select File -> Open Wor space and find the glut.dsw file in the file dialog and double-clic on it. Finally, select Build -> Build glut32.dll. When the build is finished, it will copy: glut32.dll to %WinDir%\System, glut32.lib to $(MSDevDir)\..\..\VC98\lib, and glut.h to $(MSDevDir)\..\..\VC98\include\GL. Additional wor space files have been included in the progs, test and lib directories to build the progs, tests and libs respectively. BORLAND NOTES: From what I understand, Borland supplies a utility that converts Microsoft Visual C++ .libs into Borland compatible files. Therefore, the best method for Borland users is probably to get the precompiled versions of the library and convert the library. To create an import library for Borland from the DLLs, use the following command (from a command prompt): IMPLIB glut32.lib glut32.dll If IMPLIB crashes when called this way, try IMPLIB glut32.lib glut32.def using the glut32.def file in this distribution.






Therefore. Then. but it gives the user the most flexibility in positioning. Bugs and unsupported features are outlined in the UNSUPPORTED/BUGS section. the window is placed relative to window space at 0. 0). This behaviour is acceptable under the current GLUT specification. Those are outlined here. nor are there any plans to implement it in the near future. f90gl.\VC98\include\GL directory. glutPositionWindow: Win32 has two different coordinate systems for windows.ico". and contains installation instructions and usage examples.       . create an icon named "glut.\. This will cause the window decorations (title bar and left edge) to be OFF-SCREEN.rc file to your project if you are using Microsoft Developer Studio. -sync. IMPLEMENTATION DEPENDENT DIFFERENCES: There are a few differences between the Win32 version of GLUT and the X11 version of GLUT. The Fortran 90 interface. can be obtained at http://math.rc file with the following: rc /r glut and lin the resulting glut. you can use the resource name GLUT_ICON. Alternatively. 0. This will cause the window to be opened in the upper left corner with all the decorations showing. if the user specifies glutInitWindowPosition(0. MISC NOTES: o Overlay support is not] has put considerable effort into getting GLUT to wor with different compilers for Fortran 90. -indirect. glutSetWindowTitle: There is no separation between Icon title and Window title in Win32. o To customize the windows icon. If you glutPositionWindow(0. o glutSetIconTitle.res file into your executable (just li e you would an object file). o glutInitWindowPosition. you can simply add the glut. 0). and create a file called glut. GLUT for Win32 will place the window CLIENT area at 0. He indicates that you should copy the f90glut.. just build GLUT as usual.FORTRAN NOTES: Bill Mitchell [william. 0. One is in terms of client space and the other is the whole window space (including the decorations). Note that MOST of these differences are allowed by the GLUT specification. o glutInit: The following command line options have no meaning (and are ignored) in GLUT for Win32: -display.h file to your $(MSDevDir)\.. -direct. For example.rc that contains the following: GLUT_ICON ICON glut. setting an icon title in Win32 has no effect.ico then compile the glut.nist.

For the most part. Especially so with popup the LEFT mouse button must be used to select from the menu. This causes all animation to stop when a menu is active (in general. This is probably o ay. Therefore. the drawing will not show up until after the menu has finished. Therefore. That is. though. even if a window is fully obscured. however. A program called "Twea UI" is provided by Microsoft which can be used to change the focus policy in Win32 to "focus follows mouse". glutTablet*. Notable exceptions are the GLUT_CURSOR_INFO & GLUT_CURSOR_SPRAY which use the crosshair cursor and the GLUT_CURSOR_CYCLE which uses the 'no' or 'destroy' cursor in Win32. This is the case in GLUT for Win32. glutButtonBox*. in GLUT for Win32. If the timer callbac draws into the rendering context. this is probably o ay). cursors may be different on different platforms. a mouse button must be clic ed outside the window (or in another window). but not necessarily the shape. Specifically. a mouse button must be clic ed in it. Hidden or Shown state. the "window manager" in Win32 uses a "clic to focus" policy. Li ewise.o glutSetCursor: As indicated in the GLUT specification. glutDials*: None of the special input devices are supported at this time. when attaching the menu to the middle mouse button. in order for a window to loose focus. the visibility of a GLUT window is only reflected by its Iconic. o glutEntryFunc: Window Focus is handled differently in Win32 and X. in order for a window to receive focus. Therefore. UNSUPPORTED/BUGS: o glutAttachMenu: Win32 only li es to wor with left and right mouse buttons.                       . Timer functions will still fire. It is available from the Microsoft Web Pages: http://www. the Enter and Leave notification provided by GLUT may behave differently in the Win32 and in X11 versions. o glutVisibilityFunc: Win32 seems to be unable to determine if a window is fully Win32 will find a (hopefully) good match between them. o glutIdleFunc + menus: The glut idle function will NOT be called when a menu is active. That is. it is still "visible". There is never any sharing of colormaps. o glutSpaceball*. so even if there are two windows with totally different colors in their colormaps. There is a viable wor around for this. the cursors will match the meaning. since Win32 merges the logical palette and the physical palette anyway.htm o glutCopyColormap: GLUT for Win32 always copies the colormap.

Than s to Michael Wimmer for pointing this out & providing the fix. This fixes a problem with Win32 because the list of availabe Visuals (Pixelformats) changes after a change in displaymode.3+ for X11 is currently unimplemented (this is probably o . some drawing can be done.o When resizing or moving a GLUT for Win32 window. I put in a bit of a ludgy wor around for those that absolutely can't have the weird lines.g.0). '01) x Released 3. o The video resizing capabilities of GLUT 3. I doubt that this will ever be part of GLUT for Win32. if an idle function is registered. and also being "nice" to other processes. Otherwise. '01) x Changed fullscreen mode from TOPMOST bac to simply TOP. (Oct 3. (Oct 3. '01) x Added code to prevent CPU spi ing when no idle function is registered. since (it turns out) many people use windows atop a GLUT window. Therefore. any GLUI app) wouldn't get the callbac correctly. It should probably be limited to a color buffer clear. since it really isn't part of the spec until 4. I believe that this stri es the best balance betweeen GLUT being fast. Passing 0 as a pixelformat index to DescribePixelFormat gives                                     . '01) x Fixed bug in glutEnterGameMode() that caused new windows to not be in "fullscreen" mode. no updating is performed. spi e CPU so that the idle function gets all the attention it needs and if this is a problem on the program side. so multiple window apps (e. Reload visuals each time they are queried. so they got window decorations. This causes the window to leave "trac s" on the screen when getting bigger or when previously obscured parts are being revealed. so they got window decorations. A hac could simply change the resolution of the des top. CHANGES/FIXES: (Nov 8. '01) x Fixed bug in motion callbac handler which wasn't setting the current window. The reshape callbac is called multiple times for reshapes. Than s to James Wright for reporting this bug. in the reshape callbac . '01) x Fixed bug in getVisualInfoFromString(): visuals not reloaded on display mode change. (Nov 8. (Oct 4.. '01) x Fixed bug in XGetVisualInfo(): pixelformats enumerated incorrectly. The problem occurs when switching to gamemode and bac . (Nov 8. since there is no hardware to support it.6 (Nov 8. (Oct 4. '01) x Fixed bug in glutEnterGameMode() that caused new windows to not be in "fullscreen" mode.7. the user can stic a sleep() in their idle function.

Than s to Michael Wimmer for pointing this out & providing the fix. but should be AND. Than s to Ke oa Proudfoot for bringing this to my attention. '00) x Added Developer Studio 6 project and wor space files for pretty much everything (the stuff left out was usually unix specific).. '00) x Added data files for the advanced & advanced97 programs. '01) x Fixed noof example program to use RAND_MAX instead of assumed max of 2147483647. (Sep 28. (Now it loo s _much_ better!) (Sep 22. Than s to Michael Wimmer for pointing this out & providing the fix. The test was OpenGL support OR draw to window.unpredictible results (e. the submenu wouldn't be updated properly. (Dec 12.0. added a new one. modified up events (i. (Dec 12. (Sep 23. (Sep 28. '01) x Subwindows nested arbitrarily deep get their eyboard callbac s correctly now.                       .dll and always reports 0 as the last available pixelformat index). (Sep 28.e. '01) x Fixed malloc(0) bug in Win32 version of XGetVisualInfo. '01) x Fixed sunlight example program. '01) x Major rewrite of the window procedure code to clean it up and ma e way for other bug fixes. (Oct 3. (Sep 28. SHIFT-2) are now reported correctly. (Jan 22. '01) x The ey repeat ignore flag is now honored correctly.raw data file was corrupt. (Sep 28. the window will always be on top (this essentially disables alt-tabbing). globe. '01) x Fixed zcomposite example program to print message if overlay support is not found (instead of crashing). (Sep 28. '01) x Fixed glutChangeToSubMenu()/glutChangeToMenuEntry() bug where if you went bac and forth between a submenu and a plain entry.g. '01) x Key presses are now reported more accurately and fully.. '01) x glutFullScreen() now sets the window as TOPMOST. (Sep 28. this fails on the Voodoo opengl32. in particular. '01) x glutSetIconTitle() is now a nop. '01) x Fixed bug in glXGetConfig(): pixelformats enumerated incorrectly. (Sep 22. therefore.

                                        .if you now. '00) x Fixed several compilation problems & corrupt files. '00) x Corrected corrupt duc . We now have a DLL! (Apr 25. (Sept 26. x Than s to Bruce Silberman and Chris Vale for their help with this. we can. but a special ey callbac was). and a search function to grab a menu item given the unique identifier. x Fixed this by forcing a default palette in modes that aren't Truecolor in order to 'simulate' it. '00) x Added mui DLL project file (than s to DMWeldy@ugsolutions. Than s to Bill Volz & Daniel Azuma. (Nov 8. but what good will it do?).           (May 18.iv file. Than s to Michael Keeley. '00) x Fixed subwindow eyboard callbac s. (Sept 27. We now have a DLL! (Apr 24. '00) x Fixed Delete ey bug (crash when no eyboard callbac was registered. Than s to Kent Bowling ( ent_bowling@hotmail. x Than s to Bruce Silberman and Chris Vale for their help with this. let me now). (Dec 6. (May 22. '97) x Added returns to KEY_DOWN etc messages so that the F10 ey doesn't toggle the system menu anymore. Than s to Jon Wille e for finding this problem. '00) x Fixed compiler support for lcc. (Sept 9. '00) x Fixed bug in processWor List that could cause a hang.(Dec 7. '97) o Palette is incorrect for modes other than TrueColor. Than s to Alexander Stohr for bringing these to my attention and providing detailed fixes. (May 21. '97) o DLL version of the library is coming (as soon as I figure out how to do it -. but I guess we can't argue with Microsoft ( '00) x Fixed submenu problem (sometimes the menu callbac was not called for valid items). The applications program shouldn't have to do this IMHO. '97) o A few minor bug fixes here and there. '97) o Menus don't wor under Windows 95 x Fixed! Added a unique identifier to each menu for finding this bug. (Oct 16. (Apr 7. Than s to Gordon for bringing this to my attention and debugging fixes.

'97) o glutTimerFunc: Currently. there is no select() call). glutGetHWND: In order to support additional dialog boxes.           of   . That is. (Mar 11. Wasn't chec ing for a null colormap. glutIdleFunc: Menu's are modal in Win32. GLUT for Win32 programs busy waits when there is an outstanding timer event (i. but I plan to fix it just because I can't bear the thought of a busy wait. x Too these out to preserve GLUT portability.. and a host of other Win32 dependent structures. (Mar 6. New code structure allows for EASY merging! o In Win32. now relative to window (client area) origin (which is what they're supposed to be). '97) x Fixed the glutWarpPointer() coordinates. x Fixed this by chec ing whether the cursor is in a child window or not. '97) o glutGetHDC. '97) o glutCreateMenu. Therefore. wgl fonts. x Fixed! I've put in a timer function that fires every millisecond while a menu is up. The visibility callbac subwindows wasn't being called. '97) x Fixed subwindow visibility. '97) x Fixed a bug in the WM_QUERYNEWPALETTE message. (Apr 2. x Added a timer event and a wait in the main loop. I haven't found this to be a problem. if an idle function exists. (Mar 11.3 GLUT for X11 into 3. (Feb 28 '97)   (Mar 11.e. (Mar 13. then de-ref'd it. This fixes the CPU spi e. (Mar 7 '97) x Fixed minor bugs trac ed down by the example programs. the parent gets the right to set the cursor of any of its children. The second (glutGetHWND) returns handle to the current window. '97) x Merged 3. a child windows cursor will 'blin ' between its cursor and its parent.ide file for Borland users. (Mar 11. Oops. it will not be called while processing a menu. now it is. The first (glutGetHDC) returns a handle to the current windows device context. '97) x Added glut. Therefore.(Apr 2.2 GLUT for Win32. two functions have been added that operate on the current window in GLUT. they don't allow any messages to be processed while they are up. The timer function handles idle and timer events only (which should be the only functions that are firing when a menu is up anyway). Were relative to the screen.

o GLUT for Win32 supports color index mode ONLY in a paletted display mode (i. The result is a much more stable version that passes ALL (!) (except overlay) the tests provided by Mar . x Fixed this in the re-write. 256 or 16 color mode). o Kenny: Also. li e most users. See the sphere. but when the left-button is pressed I detach it to give the right-button new meaning.. No more middle mouse button stays selected until pressed and released again. I re-implemented most of glut trying to stic with the structure layed out by Mar . o GLUT for Win32 emulates a middle mouse button by chec ing if both mouse buttons are down. Fixed.exe program. Also. I attached the menu to the right-button. sometimes a GPF occurs. x Fixed by the Feb 28 re-write. When I do this. Perhaps it would be a good idea to emulate the middle mouse button (if not present) with a ey? (9/15/96) o Added code to accept a user defined icon. I clic off of the menu to ma e it disappear. (9/12/96) o When a submenu is attached to a menu. x Fixed. Therefore I decided that it would be best to "get bac to the roots". o Some multiple window (not subwindow) functionality is messed up. If you can get a color index visual (pixel format) you can use color index mode. (Feb 28 '97) o Quite a few bugs (and incompatibilities) were being caused by the structure that I used in the previous port of GLUT. In addition.o On initial bringup apps are getting 2 display callbac s. (9/11/96) o If the alt ey is pressed with more than one other modifier ey it acts as if it is stuc -. x Fixed.e. x Fixed. if I pop-up the menu and I don't want to select anything. this new structure will allow future enhancements by Mar to be integrated much more quic ly into the Win32 version. This causes a lot of problems with the menu and other multiple mouse button things. x Fixed by the Fev 28 re-write. so that the most recently fixed appear at the top of the list. I'm now ordering the bugs in reverse. I get a GLUT error and the program terminates because I am altering the menu attachment from within the button press while the menu is active. one little problem. Needed to finish the menu when the user presses the button.                                 . (9/8/96) o Changed the glutGetModifiers code to produce an error if not called in the core input callbac s. not just when a button is released. If no icon is provided. Needed to set the submenu before referencing it's members. a default icon is loaded.

edu) for the fix to this one. o Alt modifier ey doesn't wor with eyboard callbac . This is only really a problem when moving above or to the left of the window. Put in a chec for a parent. (9/8/96) x Limitation of the Win32 API o Fixed the entry functions. you get co-ords in the range 0 +/.. You can add a sleep() to the end of your render loop if you would li e to yeild to other processes and you don't care too much about the speed of your rendering loop. (9/8/96) x I don't now if this is avoidable. (12/9/96) o One (minor) difference came up between the X version of glut and the nt one which you should now about. (glutMotionFunc. this is a limitation of the Win32 api. eg dragging one pixel ABOVE the window will give :under x11 : y = -1 under nt : y = 2^16 -1 x Put in fix provided by Shane Clauson.(9/19/96) o Shane: Command line options seem to be screwed up. (9/8/96) x Probably o ay. If you have Hardware that supports OpenGL (li e a 3Dpro card. and so was the gldebug command line. because the glut spec says that these eys can be intercepted by the system (which the alt ey is. It is not a new problem.2^15. but a wor around is being searched for. and it concerns co-ords returned to the pointer callbac s. since it won't be rendering in software. x Than s to Gary (grc@maple. (9/11/96) o If a window is fully obscured by another window. the visibility callbac is NOT called. The geometry command line was bro en.. and if none is there.rutgers. o Timer functions are messed up.) (9/11/96) (11/17/96) o glutRemoveMenuItem() not wor ing properly. Therefore. (12/17/96) o Idle functions not wor ing properly for multiple windows. As far as I can tell. x Than s to Joseph Galbraith for the fix to this one. the mouse must be pressed outside of the window to get a GLUT_LEFT message and then pressed inside the window for a GLUT_ENTERED message.civeng.. o Idle function suc s up all processor cycles. under NT you get 0. (9/13) x Fixed. If you have a tight rendering loop. It was loo ing for the parent of the current window and GPF'ing if there wasn't a parent. in most Win32 systems. it may be that the processor time is going to be suc ed up no matter what. They only wor if the eyboard focus changes. x Fixed this by posting an idle message to every window in the window list when idle. or GLint card) then this should be less of a problem. use the child. glutMouseFunc) Under X. o Fixed a bug in the default glut reshape.2^16.                                                   .

but increases performance for my particular app (a rendering engine on the end of a pipleine with a stream of graphics updates) by a couple of orders of magnitude ! ) (9/8/96) x Added code to coalesce redisplays. o Multiple glutPostRedisplay() calls are NOT being combined.). and many others. the client (opengl) area is smaller than 100x100. Added code to subtract the decoration size on glutGet() and add the decoration size on glutReshapeWindow(). THANKS: Special than s to the following people for extensive testing. fixes and help: Alexander Stohr Shane Clauson Kenny Hoff Richard Readings Paul McQuesten Philip Winston JaeWoo Ahn Joseph Galbraith Paula Higgins Sam Fortin Chris Vale Bill Mitchell and of course.(12/18/96) o glutSetCursor() was misbehaving (lthomas@cco. That is.. Therefore. Now sets the cursor whenever a WM_MOUSEMOVE message is COPYRIGHT: The OpenGL Utility Tool it distribution for Win32 (Windows NT &                   . then the WHOLE window (not just the client area) is 100x100. suggestions.caltech. (9/8/96) x Fixed. if I say ma e a window 100x100. Every idle cycle. because the WM_SETCURSOR event resets the cursor even when in the decoration area. a redisplay is posted. To get round the "coalesce" problem on glutPostRedisplay. The glutPostRedisplay() call is just a stub that sets a flag. The numbers don't ta e into account the window decorations. if they need it. x Win32 requires that the hCursor member of the window class be set to NULL when the class is registered or whenever the mouse is moved. the original author of GLUT: Mar Kilgard.. (er . o Geometry is not being handled quite right. a chec is made to see which windows need redisplay. and to handle image_dirty with a single glutPostRedisplay in the idle callbac when required. the easiest solution is to roll-your-own coalesce by eeping a global "dirty" flag in the app (eg replace all calls to glutPostRedisplay with image_dirty=TRUE. the original cursor is replaced (go figure!).

EITHER EXPRESS OR IMPLIED. GLUT for Win32 is Copyright 1997 by Nate Robins and is not in the public domain. It is provided without guarantee or warrantee expressed or implied.   OpenGL (R) is a registered trademar of Silicon Graphics. Inc. THIS SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. but it is freely distributable without licensing fees. Kilgard. INCLUDING. The original source code for GLUT is Copyright 1997 by Mar J. THE IMPLIED WARRANTIES OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Kilgard. BUT NOT LIMITED TO. Kilgard by Nate Robins.Windows 95) contains source code modified from the original source code for GLUT version 3. It was ported with the permission of Mar J.       .3 which was developed by Mar J.

Sign up to vote on this title
UsefulNot useful