![]() |
|
OpenGL ES, C++, and sprite animation - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Game Programming Fundamentals (/forum-7.html) +--- Thread: OpenGL ES, C++, and sprite animation (/thread-8329.html) |
OpenGL ES, C++, and sprite animation - pchukwura - Nov 18, 2010 08:59 AM Just wondering what is recommended for maintaining a steady framerate with sprite animation ? The only thing that looks useful is the clock() and CLOCKS_PER_SEC macro. My theory would be to:
Would this be a correct assumption? I'm trying to stick to C/C++ as much as possible so the core engine wouldn't be tied to the platform, which is why i'm avoiding the usage of NSDate, NSTimeInterval and such. Thanks! RE: OpenGL ES, C++, and sprite animation - ThemsAllTook - Nov 18, 2010 09:06 AM Here are two articles that might help. RE: OpenGL ES, C++, and sprite animation - pchukwura - Nov 18, 2010 09:18 AM (Nov 18, 2010 09:06 AM)ThemsAllTook Wrote: Here are two articles that might help. Awesome! This seems to be exactly what i'm looking for. And very fast response btw.
RE: OpenGL ES, C++, and sprite animation - OneSadCookie - Nov 18, 2010 09:25 AM To be very clear, clock() is useless. There's no cross-platform high-resolution timer. The sacredsoftware tutorial ThemsAllTook linked has a list of some options, but it seems to be missing mach_absolute_time which is the best option for Mac OS X and iOS, though certainly not the easiest. RE: OpenGL ES, C++, and sprite animation - ThemsAllTook - Nov 18, 2010 09:37 AM (Nov 18, 2010 09:25 AM)OneSadCookie Wrote: it seems to be missing mach_absolute_time which is the best option for Mac OS X and iOS Yikes, need to fix that. Thanks for pointing it out. RE: OpenGL ES, C++, and sprite animation - pchukwura - Nov 18, 2010 09:54 AM So i guess it seems (as someone pointed out in a similar post on another board) that time is one of those things that should be platform specific, and recommended I create an interface specifically for the time on that platform. I guess this makes the most sense, considering all platforms and devices would perform differently when it comes to something as precise as time. RE: OpenGL ES, C++, and sprite animation - ThemsAllTook - Nov 18, 2010 10:05 AM Here's the one I use (returned units are in seconds): Code: #if defined(__APPLE__) |