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 / Simple Tier 1 Debug UI

Author
Message
Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 16th Aug 2011 07:20 Edited at: 16th Aug 2011 07:21
Here's a simple debug UI for Tier 1 apps who may want to watch their performance. It's similiar to a popular XNA component that divides the time taken up for different operations into a colored bar.



To use, plop the files from the archive into your project directory, then add #include "debug.agc" to the top of your source and then use these commands:



More specific instructions for each command are in the comments above the function declarations.

An example of how to set it up:



Make sure to call UpdateDebug() in your loop. The values shown in the bar are averaged over a full second and are proportional to the total amount of time taken to do the various tasks during that second. Also, the text sometimes overlaps - but I'll leave that as an excercise to the user to fix (perhaps with a key instead of placing the text in the bar?)

It uses sprites and text objects with depths ranging from 0 to 3. You may have to be careful to make sure they don't interfere with your game.

Maybe somebody will find this useful, maybe not. I like it a little better than having a bunch of Print statements in the upper left corner showing nonsensical numbers

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Aug 2011 10:03
Very good, I'll use it myself!

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2024-04-25 17:31:51
Your offset time is: 2024-04-25 17:31:51