UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
Texture unit class. More...
#include <TextureUnit.h>
Public Member Functions | |
void | lock () |
Lock. | |
bool | makeActive () |
Make texture unit active. | |
char | getIndex () const |
Get texture unit index. | |
void | release () |
Release. |
Texture unit class.
Texture unit is a part of graphics card architecture. It is a component generally used for mapping texture on 3D geometry. Each graphics card have at least two of texture units.
Because only one texture can be associated with texture unit at a time, texture units have to be managed.
char TextureUnit::getIndex | ( | ) | const |
Get texture unit index.
Return index of texture unit. Availible texture units in OpenGL are enumerated as GL_TEXTURE0, GL_TEXTURE1,..
void TextureUnit::lock | ( | ) |
Lock.
Lock texture unit, making it unavailible.
bool TextureUnit::makeActive | ( | ) |
Make texture unit active.
OpenGL texture modifying calls affect texture associated with active texture unit. Only one texture unit can be active in OpenGL context at a time. Texture unit must be locked before activating, otherwise error is produced.
void TextureUnit::release | ( | ) |
Release.
Release texture unit, making it availible.