Friday, December 11, 2009

Small snippets

There are small snippets that can be used very well...
One is a simple software interrupt:

__asm int 3;

The second is more evolved, but if used correctly can wield to know everything about your code:

#define Stringize( L ) #L
#define MakeString( M, L ) M(L)
#define $Line MakeString( Stringize, __LINE__ )
#define Reminder __FILE__ "(" $Line ") : Reminder: "

so if you use the #pragma comment (Reminder ": TODO/HACK/FIXME") under MSVC compilers you will see the message in the output window, and with a double-click on it, you'll be teleported on where the code is written, so you can keep track of all the stuff you have to change...during compilation time!

Really useful, small and smart ;)

P.S. A really simple profiler is born, now I'm writing my math library from scratch, so to see some eye-candy you have to wait some days!
Next steps include:
  • Basic math library (with future support for SSE)
  • Input handling (mouse, keyboard)
  • Camera and Frustum classes
  • Debug draw (lines, spheres, cubes)
  • System coherence tests (project/unproject, world/view/screen space tests)
In the meantime I'm designing the structure of the engine with all its new systems/parts, and after those steps I'll began coding all of that!

Stay tuned ;)

No comments: