Performs the necessary operations to initialise the graphics library. The screen will not be switched into graphics mode at this point, however, so stdio is still allowed after creating the ScreenOutput object.
Set the screen mode. The resulting mode will be the best choice possible, given the requested width and height. The framerate specifies the required update rate (see update(), below).
This method updates the screen display. The technique used depends on the implementation. This method guarantees that the update will wait for a period of time which ensures that you don't get higher than framerate updates/second.
setPalette() sets one of the palette entries to value. E++ specifies a 256 colour palette-based colour display, which should be possible on most platforms, and easy to simulate on true-colour platforms. A new true-colour ScreenOutput class may be introduced at a later stage, if required.
The value is a three byte number which is encoded as 0xRRGGBB. Eg, 0xFF8500 give an orange colour.
Set the pixel at (x,y) on the screen to the given colour number. Always use this to set pixels on the screen, since - for performance reasons - setPixel() is not guaranteed to work.
The setPixel methods may not do clipping, so plots outside the destination bitmap may cause memory corruption or segmentation violations. This is for performance reasons.
Set the pixel at (x,y) on the given bitmap to the given colour number. Do not use this to set pixels on the screen, since - for performance reasons - setPixel() is not guaranteed to work.
The setPixel methods may not do clipping, so plots outside the destination bitmap may cause memory corruption or segmentation violations. This is for performance reasons.
Draws a pixel-wide line from (x1, y1) to (x2, y2) on the given bitmap in the given colour.
Draws the given character in an 8x8 font at the given position (the coordinates refer to the top left pixel of the 8x8 character). This may be useful when creating video Components.
Like drawChar(), but draws a complete NULL-terminated string to the bitmap.
Fills the given bitmap with the given colour.
Returns a pointer to the screen bitmap.
Creates an off-screen bitmap of the given dimensions. You can use the drawing functions to modify the bitmap but, since the bitmap structure is implementation specific, you should not attemt to evaluate the pointer you are returned.
You should free bitmaps you allocate with freeBitmap()
Creates a bitmap from a file. The format of the file is as appropriate for the host platform, eg. the DOS version loads .PCX files.
You are returned a pointer which refers to the bitmap. Bitmaps created in this way can be used in exactly the same way as bitmaps created with createBitmap().
Frees memory allocated to a bitmap. You should call this to free bitmaps you are finished with. Obviously, you should not attempt to use a bitmap which has been freed.
createSpriteBank() does bulk conversions of byte arrays of image data to arrays of bitmaps.
The data should be stored in an array of pointers to bytes which specify colour data. The resulting bitmap pointer will be put in the bank array (which you must allocate).
As an example, if you need a lot of 4x4 bitmaps, you calculate the image data for them (from character ROMs or whatever), then you would store them as follows:
Desired Bitmap 0 1 1 1 2 0 2 3 Gives -> imagedata[sprite] -> 0,1,1,1,2,0,2,3,4,2,1,0,3,4,1,0 4 2 1 0 3 4 1 0The width and height parameters allow createSpriteBank() to decode the data into bitmaps. count specifies the number of bitmaps to conver.
Frees all the bitmaps in a sprite bank. You should pass the bank and count parameters exactly as they were passed to createSpriteBank() on creation.
Draws one bitmap onto another. The bitmap pointer to be src is drawn onto the bitmap pointed to by dest at (x, y). The transparency can be either solid or transparent. transparent makes index 0 see-through.
Draws one bitmap within another. This is similar to copyBitmap(), but allows you to specify additional parameters which "wrap" or scroll the source bitmap before drawing it.
It's easier to try than explain, but see the PhoenixVideoHardware class for an example.
Currently, transparency can be solid or transparent. transparent makes index 0 see-through.
This is a super-copyBitmap().
It basically performs the same task of drawing one bitmap on another, but has more options. xflip and yflip, if true flip the sprite in the given direction before drawing.
colourtable[] is a way to remap the colours in the sprite. If colourtable is not NULL, drawSprite() will use it to change the colours, eg. if colourtable[3]==5 then any colour number 3 in the sprite is changed to 5 before drawing. If you specify a colourtable, it must be complete, you can't just include entries for those colours you want ot remap.
See the Centipede driver for an example of using this method.
Returns the current (achieved) framerate in frames/second.