After spending 4 hours trying to debug my first performance issue manually I was able to solve it in 10 minutes after creating a new IScreenElement implementation called ProfilingScreenElement.
It's a singleton (can't use it more than once but the fact that I can get away using it without having to new up a new one in the classes I'm debugging is worth it) and has 2 public methods on it Start() and Stop().
Internally it's got a reference to a StopWatch that it uses to distinguish the amount of time that passed since Start and Stop were called then renders it to the screen on Render() just like the other IScreenElement implementations.
Very useful as I can plug it in now whenever I have performance problems in the future, and it wouldn't have been so easy to add without the decoupled and extensible engine Mike and Rez preach.
Thanks!
It's a singleton (can't use it more than once but the fact that I can get away using it without having to new up a new one in the classes I'm debugging is worth it) and has 2 public methods on it Start() and Stop().
Internally it's got a reference to a StopWatch that it uses to distinguish the amount of time that passed since Start and Stop were called then renders it to the screen on Render() just like the other IScreenElement implementations.
Very useful as I can plug it in now whenever I have performance problems in the future, and it wouldn't have been so easy to add without the decoupled and extensible engine Mike and Rez preach.
Thanks!
-bullgoose