Constant motion

Started by
6 comments, last by Sean_Berry 20 years, 5 months ago
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
Advertisement
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]
----------------------------------------------------"Plant a tree. Remove a Bush" -A bumper sticker I saw.
What #include do I need to use the timeGetTime(); function?

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
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
P.S. I''m using Dev C++, and MingW32.


Thanks again,
Sean Berry
Make sure you included the lib with an
-lwmm
or
-lwmm32

You should also have at least one space between your included libs. It should look like this, then:
-lopengl32
-lglu32
-lwmm

This topic is closed to new replies.

Advertisement