diff options
author | Justin Worthe <justin.worthe@entelect.co.za> | 2014-07-31 13:58:22 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@entelect.co.za> | 2014-07-31 13:58:22 +0200 |
commit | 98ba22e7064db57316dfff1ae127feb3dceeb73e (patch) | |
tree | 1f7fe3065f804e491f558650285e8c6d05fc914b /source/presentation/ScreenPanel.cpp |
Diffstat (limited to 'source/presentation/ScreenPanel.cpp')
-rw-r--r-- | source/presentation/ScreenPanel.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/presentation/ScreenPanel.cpp b/source/presentation/ScreenPanel.cpp new file mode 100644 index 0000000..db2db69 --- /dev/null +++ b/source/presentation/ScreenPanel.cpp @@ -0,0 +1,24 @@ +#include "ScreenPanel.h" + +const ALLEGRO_COLOR ScreenPanel::BLANK = al_map_rgb(0,0,0); + +ScreenPanel::ScreenPanel(ALLEGRO_BITMAP* back, ALLEGRO_BITMAP* front, int x, int y, int width, int height) + :_width(width), + _height(height) +{ + _back = al_create_sub_bitmap(back, x, y, _width, _height); + _front = al_create_sub_bitmap(front, x, y, _width, _height); +} + +ScreenPanel::~ScreenPanel() +{ + al_destroy_bitmap(_back); + al_destroy_bitmap(_front); +} + +void ScreenPanel::flip() +{ + ALLEGRO_BITMAP* temp = _back; + _back = _front; + _front = temp; +} |