1 pixel image
1 pixel image

Code blog.

Here you will be able to download free source code, read about some of our coding experiences and learn some handy hints. The archives normally contain source in a mixture of C, Objective-C and C++, XML datafiles, required graphics and sounds and occasionally a Doxygen config file.

We use (and recommend) OpenGL and TinyXML, a great light XML parser.


1 pixel image
1 pixel image
most recent

August 2004

email jeroen
 1  2  3  4  5  6  7  8  9  10  11  12  13  15  16  17  18  19  20  21  22  23  24  25 26 27 28 29  30  31
1 pixel image
1 pixel image

Porting simple materials code.

26 August 2004

Porting from VisualC++.Net to Xcode.

Before our mantra of "Standards for everything" we used Direct3D8 for our graphics and DirectX for everything else. We were fairly carefull not to mix DirectX/3D with anything that didn't need it. Now we use OpenGL for our graphics so a lot of code needs to be ported from Direct3D8 to OpenGL. We have a small amount of experience with OpenGL, but it's been a while since we wrote anything with it.

Until recently we have been moving only our platform independent code into Xcode, with some minor GCC strictness issues. Visual C really lets you get away with quite a bit. So now we have event handlers, scripts objects, resource loading, state machines and trigger systems "ported". But, no graphics, no sound.

So we have started moving some of the graphics code across. This looked like a daunting task, and it is, but not as nasty as first thought. The first thing we have moved across are our menu drawing code and simple materials code.

Simple materials.

Using Direct3D8 our materials code was spread over 3 simple files: header, materials handling and DirectX common. The DirectX common code file was elimintated and the header and materials handling were significantly reduced in source code size.

Simple materials handling using OpenGL is much cleaner. No device contexts to look after, no directx device checking, just a few calls to glMaterialfv().

So, moving from proprietary to standard for this simple bit of code allowed us to reduce the source code size for this class by about 40%!

Menu drawing.

This is where it gets fun. With Direct3D we were using simple meshes to draw our menus with, now we use GLU quadrics. Nothing more to be said, very simple, no mesh data hanging around, and much cleaner source. When the menu code has been fully ported and "prettied up" it will be released for free as a simple illustration of circular menus (or menu discs, if you prefer).




  

Archive

  May 2007
  April 2007
  ...
  2006? Oh, we missed it.
  ...
  October 2005
  September 2005
  August 2005
  July 2005
  June 2005
  May 2005
  April 2005
  March 2005
  February 2005
  January 2005
  December 2004
  November 2004
  October 2004
  September 2004
  August 2004