[PREV] < Engine Fun || 2007-11-24 12:26:32 > [NEXT]
Well the past month or so I've been busying myself with a rather massive engine rewrite.

Having looked at how Torque, Quake, and a few other engines are set out... and then looking at mine... I decided the best way to continue on with the project, is to rewrite the engine.

An interesting thing I noticed is that I still tend to think in C rather than C++. I think of Functions and Objects, rather than Classes and Templates. It's making the engine rewrite a lot more "fun" than I'd like, but it's helping iron out my C++ weaknesses, so it's all good :)

It's using a rather odd system too.
At the top of the hierarchy, is the Interface.
Beneath that, and what you'd normally call in the engine itself, is the Interface Object.
Finally, linked to the Object, are the actual platform Layers.

Here's a little example of what I mean:

I have a Renderer Interface called:
IRender

You don't ever call IRender for anything, it's a pure virtual class. Instead, you call upon the Interface Object:
ORender


Of course, I'm aiming my engine to be multi-platform from the outset, which is where these "Layers" come in.

In terms of the Renderer, I currently have:
SDLRender
SPS2Render
for PC and PS2Linux respectively.

These are both derived from the IRender class, just as ORender is... so in code, all you need to do is something like:
ORender->CreateInterface();
which will call up the appropriate layer depending on the underlaying architecture :)
Fancy, no?

Currently, I've got a basic Renderer Interface setup, along with an even more basic Script Interface ( I can load up a configuration script and have Lua parse it, calling up a Window determined by what the config script says ), and some Input and Event handling.

It's certainly getting there.. albeit slowly, but with other coursework looming, I'd rather get everything else done and dusted before devoting all my time to this. That said, I at least know I'm heading in the right direction as the code is all clean and manageable and it works - which is always a bonus! ;)
[PREV] < 0 Comments || Add Comment > [NEXT]

Categories

Code Tutorial
Engine Dev
Honours Project
Dev Stuff
General Stuff
Everything

Previous Blogs

Current Blog


Blog and Code by Steven Campbell
Blog opinions are my own, as different as they may be to yours.
Comments are other people's opinions though.

Valid XHTML 1.0 Strict Valid CSS!