Arcade Shooter
Public Member Functions | Protected Member Functions | List of all members
KatanaEngine::Texture Class Reference

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

#include <Texture.h>

Inheritance diagram for KatanaEngine::Texture:
KatanaEngine::Resource KatanaEngine::RenderTarget

Public Member Functions

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

Protected Member Functions

virtual void SetTexture (ALLEGRO_BITMAP *pBitmap)
 Used to set the underlaying allegro bitmap. More...
 
- 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. More...
 
void ParseComments (std::string &line)
 Removes c-style, single-line comments from a line of text. More...
 
void TrimLine (std::string &line)
 Removes white-space at the front and end of a line of text. More...
 
ResourceManagerGetResourceManager ()
 Gets a pointer to the ResourceManager that was used to load the resource. More...
 
virtual ResourceClone ()
 Clones a resource. More...
 

Detailed Description

Represents a 2D grid of texels.

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.

◆ GetCenter()

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

Gets the center position of the texture.

Returns
Returns the center position.

◆ GetHeight()

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

Gets the height of the texture in pixels.

Returns
Returns the height in pixels.

◆ GetSize()

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

Gets the dimensions of the texture.

Returns
Returns the dimensions.

◆ GetWidth()

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

Gets the width of the texture in pixels.

Returns
Returns the width in pixels.

◆ 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.

◆ 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.

◆ SetTexture()

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

Used to set the underlaying allegro bitmap.

Parameters
pBitmapThe bitmap to set.

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