Engine::Graphics::Texture2D

Engine::Graphics::Texture2D #

An example game engine / Graphical related classes / Texture2D

Defined in header <src/Graphics/Texture2D.hpp>


class Texture2D;

Inherits from Texture, Handle

Public Functions #

Member Functions Description
(constructor) (function)
(destructor) (virtual function)
getWidth const override Returns the width of the texture in pixels. (virtual function)
getHeight const override Returns the height of the texture in pixels. (virtual function)
getDepth const override Returns the depth of the texture in pixels. (virtual function)

Additional inherited members #

Public Types(inherited from Engine::Graphics::Texture)

Member Types Definition
Type Type (enum)

Public Functions(inherited from Engine::Graphics::Texture)

Member Functions Description
Texture (function)
~Texture = default (virtual function)
isLoaded const (function)

Protected Attributes(inherited from Engine::Graphics::Texture)

Member Protected Attributes Description
loaded bool (protected variable)
type Type (protected variable)

Public Functions(inherited from Engine::Graphics::Handle)

Member Functions Description
Handle = default (function)
~Handle = default (virtual function)
getHandle const (function)

Protected Attributes(inherited from Engine::Graphics::Handle)

Member Protected Attributes Description
handle int (protected variable)

Public Functions #

function Texture2D #

Defined in header <src/Graphics/Texture2D.hpp>

Texture2D(
    int width, 
    int height, 
    uint8_t * data, 
    Texture::Type type =Texture::Type::RGBA8);

Parameters

  • data - The pointer to the raw pixels data
  • height - The height of the image held by the data pointer
  • type - What is the type of this pixels array?
  • width - The width of the image held by the data pointer

Exception Safety

Basic exception guarantee.

function ~Texture2D #

Defined in header <src/Graphics/Texture2D.hpp>

virtual ~Texture2D();

Exception Safety

Basic exception guarantee.

function getWidth #

Defined in header <src/Graphics/Texture2D.hpp>

virtual int
getWidth() const override;

Returns the width of the texture in pixels.

Return value

Width in pixels

Exception Safety

Basic exception guarantee.

function getHeight #

Defined in header <src/Graphics/Texture2D.hpp>

virtual int
getHeight() const override;

Returns the height of the texture in pixels.

Return value

Height in pixels

Exception Safety

Basic exception guarantee.

function getDepth #

Defined in header <src/Graphics/Texture2D.hpp>

virtual int
getDepth() const override;

Returns the depth of the texture in pixels.

Return value

Depth in pixels

Notes

If this texture is 2D the depth is always 1 pixels

Exception Safety

Basic exception guarantee.


Updated on 2023-04-03