Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
RenderTarget.cpp
Go to the documentation of this file.
1
2/*
3 ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
4 ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
5 █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
6 ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
7 ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
8 ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
9 /vvvvvvvvvvvvvvvvvvv \=========================================,
10 `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
11 Katana Engine \/ © 2012 - Shuriken Studios LLC
12 http://www.shurikenstudios.com
13*/
14
15#include "KatanaEngine.h"
16
17namespace KatanaEngine
18{
19 ALLEGRO_DISPLAY *RenderTarget::s_pDisplay;
20
21 RenderTarget::RenderTarget(const int width, const int height)
22 {
23 ALLEGRO_BITMAP *pBitmap = al_create_bitmap(width, height);
24
25 SetTexture(pBitmap);
26 }
27
29 {
30 if (pTarget) al_set_target_bitmap(pTarget->GetAllegroBitmap());
31 else al_set_target_bitmap(al_get_backbuffer(s_pDisplay));
32 }
33}
Contains a 2D texture that can be used as a render target.
RenderTarget(const int width, const int height)
Instantiate a render target object.
static void Set(RenderTarget *pTarget)
Set the desired target to render to when drawing.
virtual void SetTexture(ALLEGRO_BITMAP *pBitmap)
Used to set the underlaying allegro bitmap.
Definition Texture.cpp:49
virtual ALLEGRO_BITMAP * GetAllegroBitmap() const
Get the allegro bitmap representation of the texture.
Definition Texture.h:57
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition Animation.cpp:18