Another World - Hires Version

Posted by Kaya Kupferschmidt • Monday, April 17. 2006 • Category: Gaming
For all those of you who remember the fantastic game "Another World" by Eric Chahi from 1991, there is a new hi-res version out for Windows. You can download a shareware version and upgrade it to the full game for only 7 EUR! Don't miss that opportunity, at least you should check out the free version in order to get an impression of one of most atmospheric games from the old days.

VBOs or Display Lists

Posted by Kaya Kupferschmidt • Tuesday, April 11. 2006 • Category: OpenGL
Today, there was the question if VBOs are really as fast as display lists in OpenGL. Normally one would expect that VBOs should be at least as good as the old methods, but it seems that depending on the batch size and on the number of batches, the opposite might be true. I found a page with a small tool for measuring performance. At least on NVidia cards, VBOs do not seem to be the ideal solution for static geometry, whereas on ATI ther performance of VBOs should be almost equal to display lists.

So maybe I have to include another render path in Magnum using display lists...

New cast operators with additional features

Posted by Kaya Kupferschmidt • Friday, April 7. 2006 • Category: C++
C++ already has a rich set of casting operatos, ranging from old-style C casts, over static_cast, dynamic_cast and the almost-never-to-be-used reinterpret_cast. Sometimes it might be convenient to have something similar like a dynamic_cast but with another behaviour if the cast fails. For example one might want to get an exception if a specific cast is not possible.

It turns out that this is pretty easy using templates with the following code

template<class T,class S> T* throwing_cast(S* s) {
   T* result = dynamic_cast<T>(s);
   if (!result)
     throw bad_cast_exception();
   return result;
}

ClassA* a = new ClassB();
ClassB* b = throwing_cast<ClassB>(a);

But we still can do better than this, because we might want to configure which exception should be thrown on a casting failure. The code above can be easily modified to:

Continue reading "New cast operators with additional features"


A Simple Sidebar