Framework Architecture

The framework is structured as follows:


The SpriteTextRenderer is the framework's core component. This is the place where common functionality, such as text alignment algorithms, is implemented. Furthermore, it contains library-independent types for vectors, colors etc.

The classes SpriteRenderer and TextBlockRenderer are framework templates. They are abstract classes with several template methods that must be implemented by concrete subclasses. Most methods of those classes are protected or protected internal because they take library-independent parameters. For convenience, the concrete subclasses do not only implement the template methods, but also provide a library-specific interface for the core methods. E.g. the SlimDX.SpriteRenderer provides a
public void Draw(SlimDX.Direct3D11.ShaderResourceView, SlimDX.Vector2, SlimDX.Vector2, CoordinateType)
instead of the core's
protected internal void Draw(object, STRVector, STRVector, CoordinateType)

The components SpriteTextRenderer.SlimDX and SpriteTextRenderer.SharpDX are framework instantiations and provide hooks for the framework templates. More DirectX libraries can be supported by implementing appropriate hook classes for the SpriteRenderer and TextBlockRenderer. It is even imaginable to provide hook components that utilize other technologies, such as OpenGL. However, the entire framework is laid out for DirectX11, so this might become a hard task without a refactoring of the whole framework.

Client applications usually don't use the core component directly, but the library-specific components. Exceptions are helper structures like Degrees and Radians.

Last edited May 4, 2014 at 10:46 AM by Nico201, version 3