Kemena3D
Loading...
Searching...
No Matches
kemena::kTexture Class Reference

Base GPU texture abstraction shared by kTexture2D and kTextureCube. More...

#include <ktexture.h>

Inheritance diagram for kemena::kTexture:

Public Member Functions

 kTexture ()
 Constructs an empty texture with no GPU handle assigned.
virtual ~kTexture ()
 Virtual destructor; allows safe polymorphic deletion of derived textures.
kTextureduplicate (kString newName)
 Creates a shallow copy with a different sampler name.
void setTextureID (GLuint newTextureID)
 Sets the GPU texture handle.
GLuint getTextureID ()
 Returns the GPU texture handle.
void setTextureName (kString newName)
 Sets the GLSL sampler uniform name for this texture.
kString getTextureName ()
 Returns the GLSL sampler uniform name.
void setType (kTextureType newType)
 Sets the texture type (2D or cube map).
kTextureType getType ()
 Returns the texture type.

Detailed Description

Base GPU texture abstraction shared by kTexture2D and kTextureCube.

Stores the API texture handle, a name used to bind the texture to shader uniforms, and the texture type (2D or cube map).

Constructor & Destructor Documentation

◆ kTexture()

kemena::kTexture::kTexture ( )

Constructs an empty texture with no GPU handle assigned.

Here is the caller graph for this function:

◆ ~kTexture()

virtual kemena::kTexture::~kTexture ( )
virtual

Virtual destructor; allows safe polymorphic deletion of derived textures.

Member Function Documentation

◆ duplicate()

kTexture * kemena::kTexture::duplicate ( kString newName)

Creates a shallow copy with a different sampler name.

Parameters
newNameNew texture name for the duplicate.
Returns
Heap-allocated duplicate; caller takes ownership.
Here is the call graph for this function:

◆ getTextureID()

GLuint kemena::kTexture::getTextureID ( )

Returns the GPU texture handle.

Returns
Opaque texture handle (0 if not yet loaded).

◆ getTextureName()

kString kemena::kTexture::getTextureName ( )

Returns the GLSL sampler uniform name.

Returns
Uniform name kString.

◆ getType()

kTextureType kemena::kTexture::getType ( )

Returns the texture type.

Returns
TEX_TYPE_2D or TEX_TYPE_CUBE.

◆ setTextureID()

void kemena::kTexture::setTextureID ( GLuint newTextureID)

Sets the GPU texture handle.

Parameters
newTextureIDHandle returned by the texture loading API.

◆ setTextureName()

void kemena::kTexture::setTextureName ( kString newName)

Sets the GLSL sampler uniform name for this texture.

Parameters
newNameUniform variable name in the shader.

◆ setType()

void kemena::kTexture::setType ( kTextureType newType)

Sets the texture type (2D or cube map).

Parameters
newTypeTexture type.

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