Mountain  1.0.0
Simple C++ 2D Game Framework
Mountain::Texture Class Reference

Represents an image in memory. More...

#include <texture.hpp>

+ Inheritance diagram for Mountain::Texture:
+ Collaboration diagram for Mountain::Texture:

Public Member Functions

MOUNTAIN_API bool_t SetSourceData (const uint8_t *buffer, int64_t length) override
 
MOUNTAIN_API void Load () override
 
MOUNTAIN_API void Unload () override
 
MOUNTAIN_API void ResetSourceData () override
 
template<typename T = char_t>
const TGetData () const
 Gets the raw data of the texture. More...
 
template<typename T = char_t>
TGetData ()
 Gets the raw data of the texture. More...
 
MOUNTAIN_API Vector2i GetSize () const
 Gets the size of the texture. More...
 
MOUNTAIN_API void SetSize (Vector2i newSize)
 
MOUNTAIN_API Graphics::MagnificationFilter GetFilter () const
 
MOUNTAIN_API void SetFilter (Graphics::MagnificationFilter newFilter)
 
MOUNTAIN_API void Use () const
 Binds the texture.
 
MOUNTAIN_API void Unuse () const
 Unbinds the texture.
 
MOUNTAIN_API uint32_t GetId () const
 Get the ID of this texture on the GPU.
 
MOUNTAIN_API Graphics::GpuTexture GetGpuTexture () const
 Gets the underlying GpuTexture.
 

Static Public Attributes

static MOUNTAIN_API constexpr std::array FileExtensions
 Allowed extensions for texture files. More...
 

Detailed Description

Represents an image in memory.

Definition at line 18 of file texture.hpp.

Member Function Documentation

◆ GetData() [1/2]

template<typename T = char_t>
const T* Mountain::Texture::GetData ( ) const

Gets the raw data of the texture.

Template Parameters
TType
Returns
Data

◆ GetData() [2/2]

template<typename T = char_t>
T* Mountain::Texture::GetData ( )

Gets the raw data of the texture.

Template Parameters
TType
Returns
Data

◆ GetSize()

MOUNTAIN_API Vector2i Mountain::Texture::GetSize ( ) const

Gets the size of the texture.

Returns
Size

Member Data Documentation

◆ FileExtensions

MOUNTAIN_API constexpr std::array Mountain::Texture::FileExtensions
static
Initial value:
{
".jpg",
".jpeg",
".png"
}

Allowed extensions for texture files.

Definition at line 23 of file texture.hpp.


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