Menu

Home

Adam Kewley
Attachments
boss_layout.png (21396 bytes)

Welcome to the Boss Engine project.

Note:

  1. This project was created as an educational experiment and therefore may not completely follow industry standards for application and game development.

  2. This Wiki is in its infancy and will expand over time. It will also serve as the primary documentation center (along with the Javadoc) for this project.

What is Boss Engine?

Boss Engine attempts to create a bridge between the (decidedly retro) 8-bit color low resolution world, and the current 32bit high resolution world. The goal is to provide a comprehensive library and platform for developing modern applications under the screen limitations of an average DOS computer.

Great.. How do I start using it?

At the very moment you'll have to grab the code from SVN and compile a local copy. There is an ant build script (requires JDK1.6 or newer and ANT 1.7 or newer) to build the project. There are no external dependencies at this moment so compilation is a simple task.

Once you're compiled you can start poking around at the samples package: org.boss.samples This package contains several code samples which demonstrate how to use the Boss Engine.

API Layout

The main entry point for Boss is the org.boss.Boss. This class is known as a Java Singleton class. This means that only one instance of this class can exist at the same time. The good news is you really only need one instance per application. Boss extends the org.boss.graphics.Graphics class and (currently) pulls in IO handles for the keyboard and mouse. Boss comes with built a built in Keyboard handler, but you can easily supplement your own as well.

Most work is performed using the Boss class. In addition there are object classes (Palette, ImageBuffer, Font) which Boss can interact with. Lastly there are helper classes for manipulating the object classes.

The lower level classes handling the bridge between the 8 and 32bit world are not needed and therefore shouldn't be bothered with unless you wish to know the internals of the system.

Note that this project reuses several common class names that are found in the core java package (ImageBuffer, Graphics, Font).

Boss Graphics.

Boss utilizes the org.boss.graphics.driver.VideoModes class to define the supported virtual resolutions for Boss Engine. This class limits resolutions (of varying widths and screen ratios) from 320x200 on up to 800x600. There is no reason why a developer couldn't add additional resolutions, but I wanted to keep this simple. In addition, performance tests didn't show resolutions above 800x600 rendering well with complex animations. The sheer amount of pixels being copied directly gets resource intensive. Therefore 800x600 was picked as the upper resolution.

The virtual screen is initialized by calling the boss.init( int mode, boolean fullscreen ) method and passing either a numerical screen value, or using the constants defined in the VideoModes class to specify the requested resolution. The screen can be rendered either full screen or windowed. In addition the screen can switch back and forth between windowed. At the moment windowed support is limited.

The target host resolution is either 800x600 or 640x480 depending on the limitations of the host system.

Writing to the virtual screen is performed via the Boss class. There are multiple primitive drawing and image rendering methods available. Images can be loaded using the Boss class, although they must be saved as indexed palette type images. This means 15,16,24,32 bit images are incompatible with the API. When loading an image you have the option to import the image palette into the current screen palette as well. This is useful for obtaining palettes from an image, or quickly swapping the palette when displaying a full screen image.

All drawing is done to a particular buffer. The main buffer is the virtual screen buffer. You can also point at any ImageBuffer object that is created and the engine will render to the image buffer rather than the screen. the Boss.render() method is utilized to push the virtual screen buffer to the physical screen.

The number of classes and objects to keep track of when handling basic graphics is minimal. Compared to standard graphics development in Java. A lot of this is taken care of for you so that you can focus instead on application development.

The only major housekeeping that is required at the moment for the engine deals with ImageBuffer objects. The Graphics class (which Boss extends) has an artificial limit placed on the number of ImageBuffer objects that may be created at any one time. In longer running applications, it's good to free these up by calling the Boss.freeImageBuffer( ImageBuffer imageBuffer ) method to free an image object once you are done with it. This will also help keep the Java Heap size down.

Javadoc for project will be made available shortly.