Sign in to follow this  

Can't find a version of GLUT that works

This topic is 4342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If it flicker, it's surely that you're not using double buffering

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this