Can't find a version of GLUT that works

Started by
5 comments, last by CGameProgrammer 18 years, 2 months ago
A while ago I wrote a program using GLUT on an older system of mine. I copied the binary and source code to my new computer and ran the binary, and it worked perfectly. But when I tried recompiling the code on the new system, I got a GLUT linker error about glutInitWithExit not being defined. I don't have the old system anymore so I couldn't copy the glut files I'd been using on it, but downloading the "latest" (2001) glut files from Nate's site online still made the error, oddly. The only way to make it go away was to revert to an older Glut build from 1998, but now the drawing function callback is only called when the window gets repainted (like by being minimized than redisplayed, or dragged so it overlaps the edge of the screen, then dragged back) as opposed to being called every frame like it was before. Does anyone have glut files from 2001 that actually work?
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Advertisement
Actually you can get past that by recallling display I have the same (ish) refresh problem.

I didn't know it was glut that was doing that, but thankyou. (98 version, dont have the 2001 sorry.)
Oh, after further debugging I see it's actually the timer function that isn't being called. Hm. glutPostRedisplay() is called in the timer function to update the display; when I inserted a call to it in the keyboard function, and pressed various keys, it updated the display.

I changed the timer delay from 0 to 1 and now it's being called, but the image flickers onscreen for some reason. What a pain.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
If it flicker, it's surely that you're not using double buffering
I am using double-buffering and again it worked correctly when I built it using a different version of GLUT.

EDIT: Specifically it flickers when I both move the mouse and hold down a keyboard key.

EDIT AGAIN: OK, I found the problem. Well the 1998 GLUT is just weird but the reason I had problems with the 2001 build was WinZip was unzipping into a subfolder it created instead of the directory I specified, lol. So once I installed it correctly, things worked as they should. I feel silly.

[Edited by - CGameProgrammer on January 29, 2006 1:53:45 AM]
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
maybe you're swapping the buffers too much.

one swap per loop in a double buffered window is what you want

if it flickers when you use input, you probably have it posting redisplay at the end of your input functions in glut.

well actually, if i remember, it should redraw everything when you use postredisplay in glut... but i dont really remember, its been a long time.
|aaap.penopticon.com| My website, including game projects. Collaboration/comments are welcome, please visit :)
Problem found. I edited my above post... er, 12 seconds before I wrote it? Forums are messed up.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement