diff options
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; +} |