BLACKSPIRIT
.ch

Documentation as PDF

A detailed documentation is available for download as PDFDocumentation.

Last update: 2008-06-11

It is not yet finished but already contains lots of helpful information and an example to get started.

Javadoc

The javadoc for the latest release can be browsed online: Blackspirit Graphics Javadoc

On the download page Javadoc for all releases can be downloaded.

Architecture

Blackspirit Graphics allows for multiple implementations, therefore all core components are Interfaces.

The canvas factory (green) is the entry point when using Blackspirit Graphics. It is responsible for creating new canvas' and provides information about available display modes (screen resolution, frame rate).

A canvas is a region of the screen where rendering takes place. There are two types of canvas. The real-time canvas is suited for real-time rendering. It can be used fullscreen, which means that the whole screen can be used for rendering, or as a window only containing a region of the screen to render on. The AWT canvas can be integrated in Swing and AWT applications.

An image graphics context must be created by the canvas to draw on an image. Each image graphics context is for drawing on a single image.

The graphics context (blue) is an abstract representation of an area to draw on. This could be the screen (canvas) or an image (image graphics context). The drawing settings (color, transformations, etc.) are being held separately for each graphics context.

To do the actual drawing a graphics listener must be implemented which gets triggered when a graphics context gets redrawn. It also notices when a graphics context gets initialised or the size changes.

Graphics (red) is the provider of all drawing functionality. It contains methods to draw points, lines, triangles, images and text as well as methods to change the drawing settings like color, transformation and so on.

The view describes which region of the coordinate system is visible in a graphics context. Every graphics context has its own view.

To draw an image it has first to be created using the image factory. An image can be loaded from a URL (network, file system) or it can be empty.

The resource manager allows control over caching and releasing of resources (images, fonts). This is useful to prevent resources from being cached during rendering. When a resource is used for drawing and is not yet cached, it will be cached automatically.

Links

BSGraphics

3rd Party Libraries