Can't find a version of GLUT that works
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?
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.)
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.
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.
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]
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]
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement