Delegates In C++

I recently reached the point in a framework’s development where I required a solution for delegates. I could have turned to Don Clugston’s delegates on codeproject.com but I paused for thought. You see – while I do subscribe to the mentality of more typing for the sake of clarity, I must confess that I find C++’s template syntax unwieldy and wordy.

The thought I had was this; can you have a delegates solution in C++ that does not require any template syntax to use?

// Example delegate using "void MyObj::Method(int, int)"
Delegate delegate = createDelegate(&myObj, &MyObj::Method);
delegate(1, 2);

Well, you can. What follows is an explanation and some source code of how so.

Continue reading

  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
Posted in C++, Source Code | Tagged , , , , , | 4 Comments

The Icabod Projection Matrix

Icabod has spent many an evening extolling the virtues of his alternative projection matrix to me and has since posted details about it on his blog. I can see the benefits it brings – intuitive parameters to a matrix that gives much more control to a camera system. I’ll leave it to Icabod to expand on that and explain why his matrix is an improvement over the traditional approaches to projections.

So without further ado here it is the Icabod Projection Matrix, albeit with stereoscopic eye separation omitted and in a somewhat cramped state;

Continue reading

  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • Slashdot
Posted in Maths, Rendering | Tagged , , , | Leave a comment