Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
KatanaEngine::Texture Class Reference

Represents a 2D grid of texels. More...

#include <Texture.h>

Inheritance diagram for KatanaEngine::Texture:

Public Member Functions

 Texture ()
 
virtual ~Texture ()
 
virtual bool Load (const std::string &path, ResourceManager *pManager)
 Load the desired font into memory.
 
int GetWidth () const
 Gets the width of the texture in pixels.
 
int GetHeight () const
 Gets the height of the texture in pixels.
 
Vector2 GetSize () const
 Gets the dimensions of the texture.
 
Vector2 GetCenter () const
 Gets the center position of the texture.
 
virtual bool IsCloneable () const
 Used to determine if the texture is cloneable.
 
virtual ALLEGRO_BITMAP * GetAllegroBitmap () const
 Get the allegro bitmap representation of the texture.
 
- Public Member Functions inherited from KatanaEngine::Resource
virtual ~Resource ()
 
unsigned short GetResourceID () const
 Gets the ID of the resource.
 

Protected Member Functions

virtual void SetTexture (ALLEGRO_BITMAP *pBitmap)
 Used to set the underlaying allegro bitmap.
 
- Protected Member Functions inherited from KatanaEngine::Resource
void Split (const std::string &line, const char delimeter, std::vector< std::string > &elements)
 Splits a string into a vector of strings.
 
void ParseComments (std::string &line)
 Removes c-style, single-line comments from a line of text.
 
void TrimLine (std::string &line)
 Removes white-space at the front and end of a line of text.
 
ResourceManagerGetResourceManager ()
 Gets a pointer to the ResourceManager that was used to load the resource.
 
virtual ResourceClone ()
 Clones a resource.
 

Detailed Description

Represents a 2D grid of texels.

Definition at line 20 of file Texture.h.

Constructor & Destructor Documentation

◆ Texture()

KatanaEngine::Texture::Texture ( )

Definition at line 21 of file Texture.cpp.

◆ ~Texture()

KatanaEngine::Texture::~Texture ( )
virtual

Definition at line 32 of file Texture.cpp.

Member Function Documentation

◆ GetAllegroBitmap()

virtual ALLEGRO_BITMAP * KatanaEngine::Texture::GetAllegroBitmap ( ) const
inlinevirtual

Get the allegro bitmap representation of the texture.

Returns
Returns the underlaying allegro bitmap.

Definition at line 57 of file Texture.h.

◆ GetCenter()

Vector2 KatanaEngine::Texture::GetCenter ( ) const
inline

Gets the center position of the texture.

Returns
Returns the center position.

Definition at line 48 of file Texture.h.

◆ GetHeight()

int KatanaEngine::Texture::GetHeight ( ) const
inline

Gets the height of the texture in pixels.

Returns
Returns the height in pixels.

Definition at line 40 of file Texture.h.

◆ GetSize()

Vector2 KatanaEngine::Texture::GetSize ( ) const
inline

Gets the dimensions of the texture.

Returns
Returns the dimensions.

Definition at line 44 of file Texture.h.

◆ GetWidth()

int KatanaEngine::Texture::GetWidth ( ) const
inline

Gets the width of the texture in pixels.

Returns
Returns the width in pixels.

Definition at line 36 of file Texture.h.

◆ IsCloneable()

virtual bool KatanaEngine::Texture::IsCloneable ( ) const
inlinevirtual

Used to determine if the texture is cloneable.

Returns
Returns true if the texture is clonable, false otherwise.
Remarks
Textures should usually not be cloneable.

Implements KatanaEngine::Resource.

Definition at line 53 of file Texture.h.

◆ Load()

bool KatanaEngine::Texture::Load ( const std::string & path,
ResourceManager * pManager )
virtual

Load the desired font into memory.

Parameters
pathThe path to the desired font.
pManagerA pointer to the ResourceManager that will manage the font.
Returns
Returns true if the font was loaded, false otherwise.

Implements KatanaEngine::Resource.

Reimplemented in KatanaEngine::RenderTarget.

Definition at line 39 of file Texture.cpp.

◆ SetTexture()

void KatanaEngine::Texture::SetTexture ( ALLEGRO_BITMAP * pBitmap)
protectedvirtual

Used to set the underlaying allegro bitmap.

Parameters
pBitmapThe bitmap to set.

Definition at line 49 of file Texture.cpp.


The documentation for this class was generated from the following files: