Raster

Handles multiple layers onto one framebuffer.

Constructors

this
this(ushort x, ushort y, OutputScreen oW, size_t paletteLength, ubyte buffers)

Default constructor. x and y : represent the resolution of the raster.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

LayerMap
alias LayerMap = TreeMap!(int, Layer)
Undocumented in source.

Functions

addLayer
void addLayer(Layer l, int i)

Adds a layer at the given priority.

addPaletteChunk
Color[] addPaletteChunk(Color[] paletteChunk)

Adds a palette chunk to the end of the main palette.

addRefreshListener
void addRefreshListener(RefreshListener r)

Adds a RefreshListener to its list.

clearPaletteChunk
Color[] clearPaletteChunk(ushort lenght, ushort offset)

Clears an area of the palette with zeroes. Returns the original area.

editColor
void editColor(ushort c, Color val)

Edits the given color index. Will be set deprecated in 0.10.0

getOutput
SDL_Texture* getOutput()

Returns the workpad.

getPaletteIndex
Color getPaletteIndex(ushort index)
Undocumented in source. Be warned that the author may not have intended to support it.
isRefreshing
bool isRefreshing()

Returns if the raster is refreshing.

loadPalette
Color[] loadPalette(Color[] palette)

Loads a palette into the object. Returns the new palette of the object.

loadPaletteChunk
Color[] loadPaletteChunk(Color[] paletteChunk, ushort offset)

Loads a palette chunk into the object. The offset determines where the palette should be loaded. If it points to an existing place, the indices after that will be overwritten until the whole palette will be copied. If it points to the end or after it, then the palette will be made longer, and will pad with values 0x00_00_00_00 if needed. Returns the new palette of the object.

refresh
void refresh()

Refreshes the whole framebuffer.

removeLayer
void removeLayer(int n)

Removes a layer at the given priority.

replaceLayer
deprecated void replaceLayer(Layer l, int i)

Replaces the layer at the given number. Deprecated!

resetAvgfps
void resetAvgfps()

Resets the avgFPS to zero.

setPaletteIndex
Color setPaletteIndex(ushort index, Color val)
Undocumented in source. Be warned that the author may not have intended to support it.
setupPalette
void setupPalette(int i)

Sets the number of colors. Will be set deprecated in 0.10.0

Properties

avgfps
real avgfps [@property getter]

Returns the current average FPS count.

fps
real fps [@property getter]

Returns the current FPS count.

palette
Color[] palette [@property getter]

Returns a copy of the palette of the object.

Variables

_palette
Color[] _palette;

Color format is ARGB, with each index having their own transparency.

displayedBuffer
ubyte displayedBuffer;

Framebuffer currently being displayed

fbData
void* fbData;
Undocumented in source.
fbPitch
int fbPitch;
Undocumented in source.
frameBuffer
SDL_Texture*[] frameBuffer;
Undocumented in source.
layerMap
LayerMap layerMap;

Stores the layers by their priorities.

nOfBuffers
ubyte nOfBuffers;

Number of framebuffers, 2 for double buffering.

updatedBuffer
ubyte updatedBuffer;

Framebuffer currently being updated

Inherited Members

From IRaster

getOutput
SDL_Texture* getOutput()
Undocumented in source.

From PaletteContainer

palette
Color[] palette [@property getter]

Returns the palette of the object.

getPaletteIndex
Color getPaletteIndex(ushort index)

Returns the given palette index.

setPaletteIndex
Color setPaletteIndex(ushort index, Color value)

Sets the given palette index to the given value.

addPaletteChunk
Color[] addPaletteChunk(Color[] paletteChunk)

Adds a palette chunk to the end of the main palette.

loadPalette
Color[] loadPalette(Color[] palette)

Loads a palette into the object. Returns the new palette of the object.

loadPaletteChunk
Color[] loadPaletteChunk(Color[] paletteChunk, ushort offset)

Loads a palette chunk into the object. The offset determines where the palette should be loaded. If it points to an existing place, the indices after that will be overwritten until the whole palette will be copied. If it points to the end or after it, then the palette will be made longer, and will pad with values #00000000 if needed. Returns the new palette of the object.

clearPaletteChunk
Color[] clearPaletteChunk(ushort lenght, ushort offset)

Clears an area of the palette with zeroes. Returns the original area.

Meta