Clutter Engine 0.0.1
Loading...
Searching...
No Matches
clt::Texture Class Reference

Represents a texture in the engine. More...

#include <Texture.h>

Public Member Functions

 ~Texture ()
 Destroys the Texture object and releases OpenGL resources.
 
void Bind (GLuint slot=0) const
 Binds the texture to a specified slot.
 
void UnBind () const
 Unbinds the texture from the current slot.
 
void UpdateInfo (int &rWidth, int &rHeight)
 Updates the provided width and height references with the texture's dimensions.
 
int GetWidth () const
 Gets the width of the texture.
 
int GetHeight () const
 Gets the height of the texture.
 
Vector2 GetSize () const
 Gets the size of the texture as a Vector2.
 
GLuint GetID () const
 Gets the OpenGL texture ID.
 

Friends

class Assets
 

Detailed Description

Represents a texture in the engine.

This class encapsulates an OpenGL texture, providing methods to bind, unbind, and query texture properties such as width, height, and OpenGL ID.

Member Function Documentation

◆ Bind()

void Texture::Bind ( GLuint slot = 0) const

Binds the texture to a specified slot.

Parameters
slotThe slot to bind the texture to (default is 0).

◆ GetHeight()

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

Gets the height of the texture.

Returns
The height of the texture in pixels.

◆ GetID()

GLuint clt::Texture::GetID ( ) const
inline

Gets the OpenGL texture ID.

Returns
The OpenGL texture ID.

◆ GetSize()

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

Gets the size of the texture as a Vector2.

Returns
A Vector2 containing the width and height of the texture.

◆ GetWidth()

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

Gets the width of the texture.

Returns
The width of the texture in pixels.

◆ UpdateInfo()

void Texture::UpdateInfo ( int & rWidth,
int & rHeight )

Updates the provided width and height references with the texture's dimensions.

Parameters
rWidthReference to store the width of the texture.
rHeightReference to store the height of the texture.

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