Constant motion
Hi all,
How would I keep the rotation of my objects consistent regardless of the machine?
Even on one machine, my triangles move faster in full screen mode than in windowed.
How do I fix this?
A time function?
Thanks,
Sean Berry
Well, a simple way of doing it is the following:
glRotatef(timeGetTime()/100.0f,0,1,0);
What this does is make it so that the triangles movement depends on the time elapsed, rather than the value of a variable. The function timGetTime returns the time ellapsed in milliseconds. I divided it by 100 so it wouldn't go too fast.
[edited by - tHiSiSbOb on October 24, 2003 5:30:15 PM]
glRotatef(timeGetTime()/100.0f,0,1,0);
What this does is make it so that the triangles movement depends on the time elapsed, rather than the value of a variable. The function timGetTime returns the time ellapsed in milliseconds. I divided it by 100 so it wouldn't go too fast.
[edited by - tHiSiSbOb on October 24, 2003 5:30:15 PM]
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
What #include do I need to use the timeGetTime(); function?
Thanks,
Sean Berry
Thanks,
Sean Berry
I tried #include <time.h>, but I still get that bugger of an error.....
[Linker error] undefined reference to ''timeGetTime@0''
Rock and Roll,
Sean Berry
[Linker error] undefined reference to ''timeGetTime@0''
Rock and Roll,
Sean Berry
You have to add the appropriate .lib file to your project. I think it''s wmm.lib or wmm32.lib or something like that.
Awesome, that worked for the compilation.
But this sailor isn''t out of the storm.
When I run the .exe, I get this familiar error.
The procedure entry point SetPixelFormat could not be located in the dynamic link library winmm.dll
Any ideas?
Thanks forum viewers,
Sean Berry
But this sailor isn''t out of the storm.
When I run the .exe, I get this familiar error.
The procedure entry point SetPixelFormat could not be located in the dynamic link library winmm.dll
Any ideas?
Thanks forum viewers,
Sean Berry
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement