Texture
Qualified name: mv::Texture
-
class Texture : protected QOpenGLFunctions_3_3_Core
Base texture class.
Contains most of the functionality, but can only be used through one of the sub-classes. The texture subclasses provide the specifics of the operations performed on the texture (such as dimensionality). It is wise to only call functions in this class when an OpenGL context is current and active, otherwise their behaviour is undefined.
Subclassed by mv::Texture1D, mv::Texture2D
Public Functions
-
inline Texture(GLenum target)
Texture constructor.
- Parameters:
target – The GLenum specifying the target of texture operations. GL_TEXTURE_1D, GL_TEXTURE_2D and GL_TEXTURE_3D are accepted.
-
inline void create()
Initializes the use of OpenGL functions in this context and generates the raw OpenGL Id of the texture.
This function should be called before doing any other texture operations and only when an OpenGL context is current and active.
-
inline void destroy()
Deletes the OpenGL texture Id and invalidates this texture until create() is called again.
-
inline void bind(unsigned int textureUnit)
Binds the texture to the given texture unit.
- Parameters:
textureUnit – The texture unit should be a value in the range [0-16). One shouldn’t try to pass OpenGL texture units in here, as the given value gets added to GL_TEXTURE0.
-
inline void bind()
Binds the texture to the active texture unit.
-
inline void release()
Unbinds the texture by binding the default (0) texture.
-
inline bool isCreated()
Return whether the texture has been allocated.
-
inline GLuint getHandle()
Return the raw OpenGL texture Id.
-
inline Texture(GLenum target)