Object representing a display (screen or window). More...
#include <Display.hpp>
Classes | |
class | Event |
Display event object. More... | |
Public Types | |
enum | LockType { ReadWrite = 0, Read = ALLEGRO_LOCK_READONLY, Write = ALLEGRO_LOCK_WRITEONLY } |
Describes the type of Lock. More... | |
Public Member Functions | |
Display (unit width, unit height, int flags) | |
Creates a display with the specified width, height and flags flags is compatable with allegro5. | |
unit | Width () const |
Returns the current width of the display. | |
unit | Height () const |
Returns the current height of the display. | |
int | RefreshRate () const |
Returns the refresh rate of the display. | |
int | Flags () const |
Returns the display flags. | |
bool | WaitForVSync () |
Forces the thread to wait for VSYNC. | |
void | Flip () |
Flips the display. | |
void | Target () |
Targets the display backbuffer Shouldn't need to be called if using pure A5SES. | |
void | SetTitle (const char *title) |
Sets the window title. No effect in fullscreen. | |
bool | Resize (unit width, unit height) |
Resizes the display. | |
bool | AcknowledgeResize () |
Acknowledges a Resize event. | |
void | Move (unit x, unit y) |
Moves the display. | |
ALLEGRO_DISPLAY * | Release () |
Releases the held C structure so it is no longer automatically freed. | |
~Display () | |
Destroys the display. | |
std::auto_ptr< a5::Event > | Handle (ALLEGRO_EVENT *raw_event) const |
Processes Allegro event messages in to A5SES Events. | |
operator ALLEGRO_DISPLAY * () | |
Returns a pointer to the Allegro display struture. | |
std::auto_ptr< Bitmap_Lock > | Lock (Pixel_Format format=Pixel_Format::Any, LockType type=ReadWrite) |
Locks an entire bitmap. | |
std::auto_ptr< Bitmap_Lock > | Lock (const Rectangle rect, Pixel_Format format=Pixel_Format::Any, LockType type=ReadWrite) |
Locks a region of a bitmap. | |
unit | Width () const |
Returns the width of the bitmap. | |
unit | Height () const |
Returns the height of the bitmap. | |
void | Clear (Color c=RGB(0, 0, 0)) |
Clears the bitmap to the specified color. | |
void | Target () |
Sets the global Allegro target bitmap to this Shouldn't need to be called if using pure A5SES. | |
std::auto_ptr< Bitmap > | Sub (Rectangle r) |
Creates a sub-bitmap object from the specified rectangle. | |
void | PutPixel (unit x, unit y, Color c) |
Sets a pixel to a color. | |
Color | GetPixel (unit x, unit y) |
Returns the color of a pixel. | |
void | Blit (Bitmap &src, unit x, unit y, int flags=0) |
Draws an entire Bitmap to this one. | |
void | Blit (Bitmap &src, unit x, unit y, Rectangle clip, int flags=0) |
Draws a partial Bitmap to this one. | |
void | BlitScaled (Bitmap &src, Rectangle r, int flags=0) |
Draws a bitmap scaled to r to this one. | |
void | BlitScaled (Bitmap &src, unit x, unit y, Rectangle r, Rectangle clip, int flags=0) |
Draws a bitmap scaled to r and clipped to clip to this one. | |
void | BlitTinted (Bitmap &src, Color tint, unit x, unit y, int flags=0) |
Draws an entire Bitmap to this one (tinted). | |
void | BlitTinted (Bitmap &src, Color tint, unit x, unit y, Rectangle clip, int flags=0) |
Draws a partial Bitmap to this one (tinted). | |
void | BlitTintedScaled (Bitmap &src, Color tint, unit x, unit y, Rectangle r, int flags=0) |
Draws a bitmap scaled to r to this one (tinted). | |
void | BlitTintedScaled (Bitmap &src, Color tint, unit x, unit y, Rectangle r, Rectangle clip, int flags=0) |
Draws a bitmap scaled to r and clipped to clip to this one (tinted). | |
ALLEGRO_BITMAP * | Release () |
Releases the held C structure so it is no longer automatically freed. | |
operator ALLEGRO_BITMAP * () const | |
Returns a pointer to the Allegro bitmap structure. | |
void | SetEventSource (ALLEGRO_EVENT_SOURCE *event_source) |
Points the Allegro event source towards this object. | |
operator ALLEGRO_EVENT_SOURCE * () const | |
Returns a pointer to the Allegro event source. | |
Static Public Attributes | |
static const int | Windowed = ALLEGRO_WINDOWED |
Creates the display as a window. | |
static const int | Fullscreen = ALLEGRO_FULLSCREEN |
Creates the display fullscreen. | |
static const int | Resizable = ALLEGRO_RESIZABLE |
Allows the display to be resized Only effective in Windowed mode without NoFrame. | |
static const int | NoFrame = ALLEGRO_NOFRAME |
Removes the window border Only effective in Windowed mode. | |
static const int | GenerateExposeEvents = ALLEGRO_GENERATE_EXPOSE_EVENTS |
Generates ExposeEvent events when parts of the screen are "exposed". | |
static const int | VSync = 0x80000000 |
Makes Flip() wait for VSYNC before drawing. | |
static const int | FlipHorizontal = ALLEGRO_FLIP_HORIZONTAL |
Flip the image on the x axis. | |
static const int | FlipVertical = ALLEGRO_FLIP_VERTICAL |
Flip the image on the y axis. | |
Friends | |
class | Display |
Object representing a display (screen or window).
enum a5::Bitmap::LockType [inherited] |
Describes the type of Lock.
Creates a display with the specified width, height and flags flags is compatable with allegro5.
a5::Display::~Display | ( | ) |
Destroys the display.
unit a5::Display::Width | ( | ) | const |
Returns the current width of the display.
unit a5::Display::Height | ( | ) | const |
Returns the current height of the display.
int a5::Display::RefreshRate | ( | ) | const |
Returns the refresh rate of the display.
int a5::Display::Flags | ( | ) | const |
Returns the display flags.
bool a5::Display::WaitForVSync | ( | ) |
Forces the thread to wait for VSYNC.
void a5::Display::Flip | ( | ) |
Flips the display.
void a5::Display::Target | ( | ) |
Targets the display backbuffer Shouldn't need to be called if using pure A5SES.
void a5::Display::SetTitle | ( | const char * | title | ) |
Sets the window title. No effect in fullscreen.
bool a5::Display::AcknowledgeResize | ( | ) |
Acknowledges a Resize event.
ALLEGRO_DISPLAY* a5::Display::Release | ( | ) |
Releases the held C structure so it is no longer automatically freed.
std::auto_ptr<a5::Event> a5::Display::Handle | ( | ALLEGRO_EVENT * | raw_event | ) | const [virtual] |
Processes Allegro event messages in to A5SES Events.
Implements a5::Event_Source.
a5::Display::operator ALLEGRO_DISPLAY * | ( | ) |
Returns a pointer to the Allegro display struture.
std::auto_ptr<Bitmap_Lock> a5::Bitmap::Lock | ( | Pixel_Format | format = Pixel_Format::Any , |
|
LockType | type = ReadWrite | |||
) | [inherited] |
Locks an entire bitmap.
std::auto_ptr<Bitmap_Lock> a5::Bitmap::Lock | ( | const Rectangle | rect, | |
Pixel_Format | format = Pixel_Format::Any , |
|||
LockType | type = ReadWrite | |||
) | [inherited] |
Locks a region of a bitmap.
Bitmap::Lock_Failed |
unit a5::Bitmap::Width | ( | ) | const [inherited] |
Returns the width of the bitmap.
unit a5::Bitmap::Height | ( | ) | const [inherited] |
Returns the height of the bitmap.
Clears the bitmap to the specified color.
void a5::Bitmap::Target | ( | ) | [inherited] |
Sets the global Allegro target bitmap to this Shouldn't need to be called if using pure A5SES.
Creates a sub-bitmap object from the specified rectangle.
Draws an entire Bitmap to this one.
Draws a partial Bitmap to this one.
Draws a bitmap scaled to r
to this one.
void a5::Bitmap::BlitScaled | ( | Bitmap & | src, | |
unit | x, | |||
unit | y, | |||
Rectangle | r, | |||
Rectangle | clip, | |||
int | flags = 0 | |||
) | [inherited] |
Draws a bitmap scaled to r
and clipped to clip
to this one.
Draws an entire Bitmap to this one (tinted).
void a5::Bitmap::BlitTinted | ( | Bitmap & | src, | |
Color | tint, | |||
unit | x, | |||
unit | y, | |||
Rectangle | clip, | |||
int | flags = 0 | |||
) | [inherited] |
Draws a partial Bitmap to this one (tinted).
void a5::Bitmap::BlitTintedScaled | ( | Bitmap & | src, | |
Color | tint, | |||
unit | x, | |||
unit | y, | |||
Rectangle | r, | |||
int | flags = 0 | |||
) | [inherited] |
Draws a bitmap scaled to r
to this one (tinted).
void a5::Bitmap::BlitTintedScaled | ( | Bitmap & | src, | |
Color | tint, | |||
unit | x, | |||
unit | y, | |||
Rectangle | r, | |||
Rectangle | clip, | |||
int | flags = 0 | |||
) | [inherited] |
Draws a bitmap scaled to r
and clipped to clip
to this one (tinted).
ALLEGRO_BITMAP* a5::Bitmap::Release | ( | ) | [inherited] |
Releases the held C structure so it is no longer automatically freed.
a5::Bitmap::operator ALLEGRO_BITMAP * | ( | ) | const [inherited] |
Returns a pointer to the Allegro bitmap structure.
void a5::Event_Source::SetEventSource | ( | ALLEGRO_EVENT_SOURCE * | event_source | ) | [inherited] |
Points the Allegro event source towards this object.
a5::Event_Source::operator ALLEGRO_EVENT_SOURCE * | ( | ) | const [inherited] |
Returns a pointer to the Allegro event source.
const int a5::Display::Windowed = ALLEGRO_WINDOWED [static] |
Creates the display as a window.
const int a5::Display::Fullscreen = ALLEGRO_FULLSCREEN [static] |
Creates the display fullscreen.
const int a5::Display::Resizable = ALLEGRO_RESIZABLE [static] |
Allows the display to be resized Only effective in Windowed mode without NoFrame.
const int a5::Display::NoFrame = ALLEGRO_NOFRAME [static] |
Removes the window border Only effective in Windowed mode.
const int a5::Display::GenerateExposeEvents = ALLEGRO_GENERATE_EXPOSE_EVENTS [static] |
Generates ExposeEvent events when parts of the screen are "exposed".
const int a5::Display::VSync = 0x80000000 [static] |
Makes Flip() wait for VSYNC before drawing.
const int a5::Bitmap::FlipHorizontal = ALLEGRO_FLIP_HORIZONTAL [static, inherited] |
Flip the image on the x axis.
const int a5::Bitmap::FlipVertical = ALLEGRO_FLIP_VERTICAL [static, inherited] |
Flip the image on the y axis.