Walking through the doldrums of programming

There are many times when my programming seems to produce very little results.  This is usually when I’m doing some core work.  Not glamorous, not on the surface, often times, not particularly visible.  Right now I’m going through one of those phases.

I am making various improvements to the visualization system.  The core 2D UI routines are getting quite a lot of attention.  For one, I am wanting to make it possible to easily visualize massive amounts of data.  Anything from charting performance logs over time, to mapping out star information, or molecular structures.  In order to do this, I have had to change the fundamentals of the scene structures.  Simply having lists of items it not good enough.  I need to be able to easily partition them in space, for rapid culling.  Just like is done in games, I am flurting with things like Octrees, K-d trees, and the like.

Then there’s the mundane transformation matrix.  At first, I was relying on transformation routines in the underlying graphics calls.  Well, that doesn’t quite give you the control you want.  Since doing matrix/vector math is not actually that hard, I’ve switched to handling it all within the program itself.  This has a couple of advantages.  One, it allows me to completely control transforms.  Everything from what type of transforms are available, to how they’re stored in memory, how they cascade with objects in the scene graph, etc.

The other advantage of this approach is that it fits more nicely with being able to switch to OpenGL ES on platforms that support that.  OpenGL does not have native support for transforms.  That all gets hoisted off to client code.  So, by preparing for that innevitability now, I’ll save myself some headache later on.

I have also been contemplating the underlying widget library.  I want to be as cross platform as possible.  I find that the main piece that needs to be portable is the text rendering.  For the Windowing system, just about anything will do.  I am currently using the iup library in Lua for this task.  It’s fairly small and simple, but it has various quirks.  I also use the cd library to do the text rendering.  I have been contemplating switching to the wxWidgets library.  It seems a bit more robust, and has more components in one place, and it appears to be supported on multiple platforms, better than iup.  But, ultimately, I only need a couple of things.  I need to get a window, and I need to get an OpenGL context.  That’s about it.  All other UI is performed within OpenGL itself, so no native UI libraries are necessary.

Another consideration is that eventually, I will want to port to HTML/WebGL.  The switch from Lua to JavaScript is fairly straight forward, so the closer I can keep the libraries to things that can be supported by JavaScript, the better.

These are all core design decisions, which don’t have much to do with what you see on the surface.  But, making them makes all the difference in the world as to what you’ll be able to do as the software evolves.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s