Base GPU texture abstraction shared by kTexture2D and kTextureCube.
More...
#include <ktexture.h>
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).
◆ kTexture()
| kemena::kTexture::kTexture |
( |
| ) |
|
Constructs an empty texture with no GPU handle assigned.
◆ ~kTexture()
| virtual kemena::kTexture::~kTexture |
( |
| ) |
|
|
virtual |
Virtual destructor; allows safe polymorphic deletion of derived textures.
◆ duplicate()
Creates a shallow copy with a different sampler name.
- Parameters
-
| newName | New texture name for the duplicate. |
- Returns
- Heap-allocated duplicate; caller takes ownership.
◆ 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()
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
-
| newTextureID | Handle returned by the texture loading API. |
◆ setTextureName()
| void kemena::kTexture::setTextureName |
( |
kString | newName | ) |
|
Sets the GLSL sampler uniform name for this texture.
- Parameters
-
| newName | Uniform variable name in the shader. |
◆ setType()
Sets the texture type (2D or cube map).
- Parameters
-
The documentation for this class was generated from the following file: