The SGX Engine - About
SGX is the 3D graphics engine from Steven Goodwin. It is based around of series of null drivers and loosely-coupled modules to facilitate an infinitely upgradable engine. It is primarily suited to games and digital TV backdrops, and runs under Windows and Linux, using OpenGL.
Background
The SGX engine has existed (in some form or another) for over six years. The basic design philosophy is to provide a complete engine that can be ported with utmost ease to other platforms. It does this through double chance functions, prepared singletons, and an elegant underlying design structure. Portions of this code feature in Steven Goodwin's book, Cross-Platform Game Programming.
Version 1
The initial version, from 1992. It was provided to a few licensees as an abstraction to the Game SDK (later called DirectX). It was never heavily promoted, and it's unsupported.Version 2
This exists in three forms, all from the original 1995 code base. The first exists only in an archive on my hard drive. It contains all the components of the current engine, but in a very rough-and-ready form. The other two versions were supplied with each of my two books, Cross-Platform Game Programming and The Game Developer's Open Source Handbook. Each was refactored to suit the structure of the book, rather than the code. Consequently, it's not suitable for development.Version 3
The latest and greatest! This includes all the major components necessary for a cross-platform engine, including several refactorings, and optimisations.Major changes in version 3
- New memory allocator and interface
- Completely revamped naming convention
- GUI Designer and library
- 2000 new utility methods and classes
- Lots of stuff still being working on...
Naming Conventions
The history of the project is such that namespaces are only rudimentarily supported. Instead, each method, class, and member is given an 'sgx' prefix. The style of this naming reflects its purpose. Any class, method, or variable with the SGX designation implies it can be used safely across all platforms.SGX_UPPER_CASE - A cross-platform macro implementing some functionality, or indicating whether functionality may exist (SGX_DEBUG). It is always safe to use them, although the resultant code may not exist in some builds (e.g. profiling or release builds), or it might use an alternate path.
sgxMethod - A simple cross-platform function, that may be inlined. This is for basic core functionality only, and represents a fundamental part to the system. The maths code uses this alot.
sgxClass - Cross-platform classes that represent a fundamental type in the system, such as matrices and vectors.
CSGXClassName - Any major component.
Component Singletons
We adopt a simple (?!) 6-step approach to construction of objects.ctor - Standard C++ invocation, must leave the object in a workable state. Usually involves settings variables to 0, and pointers to NULL.
create - use only to build singletons.
initialize - prepare the constructed object. Separated to allow vtable access et al. Add pointer to any management classes.
release - remove pointer from any managmenet classes.
destroy - Usually only used with singletons, or places where vtable is still necessary. Base class only. Usually (only?) used as static.
dtor - final removal. Including driver-specific code. Usually virtual.
