Arcade Shooter
Texture.h
1 
2 /* ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
3  ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
4  █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
5  ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
6  ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
7  ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
8  /vvvvvvvvvvvvvvvvvvv \=========================================,
9  `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
10  Katana Engine \/ © 2012 - Shuriken Studios LLC */
11 
12 #pragma once
13 
14 namespace KatanaEngine
15 {
17  class Texture : public Resource
18  {
19 
20  public:
21 
22  Texture();
23  virtual ~Texture();
24 
29  virtual bool Load(const std::string &path, ResourceManager *pManager);
30 
33  int GetWidth() const { return m_width; }
34 
37  int GetHeight() const { return m_height; }
38 
41  Vector2 GetSize() const { return m_size; }
42 
45  Vector2 GetCenter() const { return m_center; }
46 
50  virtual bool IsCloneable() const { return false; }
51 
54  virtual ALLEGRO_BITMAP *GetAllegroBitmap() const { return m_pBitmap; }
55 
56 
57  protected:
58 
61  virtual void SetTexture(ALLEGRO_BITMAP *pBitmap);
62 
63 
64  private:
65 
66  static bool s_alAddonInitialized;
67 
68  ALLEGRO_BITMAP *m_pBitmap;
69 
70  int m_width;
71  int m_height;
72 
73  Vector2 m_size;
74  Vector2 m_center;
75 
76  };
77 }
virtual bool IsCloneable() const
Used to determine if the texture is cloneable.
Definition: Texture.h:50
Represents a 2D grid of texels.
Definition: Texture.h:17
int GetHeight() const
Gets the height of the texture in pixels.
Definition: Texture.h:37
int GetWidth() const
Gets the width of the texture in pixels.
Definition: Texture.h:33
virtual void SetTexture(ALLEGRO_BITMAP *pBitmap)
Used to set the underlaying allegro bitmap.
Definition: Texture.cpp:46
virtual ALLEGRO_BITMAP * GetAllegroBitmap() const
Get the allegro bitmap representation of the texture.
Definition: Texture.h:54
Defines a vector with 2 components (x and y). This is additional information...
Definition: Vector2.h:18
virtual bool Load(const std::string &path, ResourceManager *pManager)
Load the desired font into memory.
Definition: Texture.cpp:36
Base class for all resource types to be managed by the ResourceManager class.
Definition: Resource.h:19
Vector2 GetSize() const
Gets the dimensions of the texture.
Definition: Texture.h:41
Vector2 GetCenter() const
Gets the center position of the texture.
Definition: Texture.h:45
Loads and manages the lifespan of objects from external files.
Definition: ResourceManager.h:17
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition: Animation.cpp:14