Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Timing Graph - Code Sample

Author
Message
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 22nd Feb 2013 00:11
Requested in http://forum.thegamecreators.com/?m=forum_view&t=203658&b=41

This is code to display a graph on screen showing the frame rate for the last couple of hundred frames.



Its a snippet from an existing project so uses some globals which contain information from system calls. These should be apparent from the name or how they are used.

Call this at the start of the app.



Then call this at the end of every loop.



It's part of a thing I'm doing for the Community Wiki

The contents of the global GMain should be apparent, but here's the definition in case you want to duplicate it;



it is set each loop with a call to


I'll let you figure out GDisplay yourself.

NB:
The size of the graph is the shorter of the two resolution mesurements, so for a 640 x 480 display ( or a 480 x 640 display ) it will draw it 480 wide.

That way you don't have to move or resize it if the orientation of the device changes
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 22nd Feb 2013 02:18
Excellent Marl. Thank you very much for the share. Love the break down and cleanness of the code too.

Login to post a reply

Server time is: 2024-05-02 17:34:41
Your offset time is: 2024-05-02 17:34:41