The Vish Visualization Shell 0.3
Vish
Public Member Functions | Public Attributes | List of all members
Wizt::GLTextureID Class Reference

Better base class for OpenGL Texture ID's. More...

#include <ocean/GLvish/GLTextureID.hpp>

Inheritance diagram for Wizt::GLTextureID:
Wizt::TextureBuffer Wizt::TypedTextureBuffer< Type >

Public Member Functions

GLuint getTextureId () const
 Read-only access to the stored texture ID's. This function will NOT create any texture ID's.
 
 GLTextureID (type TextureTarget, int TextureUnit) throw ()
 Constructor, specify texture unit.
 
bool isValid () const
 Check whether a valid texture ID is stored here.
 
GLuint makeTextureId ()
 On first access, OpenGL textures will be generated.
 
 operator bool () const
 Check whether a valid texture ID is stored here.
 
bool selectActiveTextureUnit () const
 
 ~GLTextureID ()
 Deletion of created OpenGL textures. Note that this destructor crashes if called outside a valid OpenGL context.
 

Public Attributes

const type target
 The corresponding OpenGL texture target (GL_TEXTURE_nD)
 

Detailed Description

Better base class for OpenGL Texture ID's.

Supports multiple active texture units as specified in OpenGL 2.

Member Function Documentation

◆ makeTextureId()

GLuint Wizt::GLTextureID::makeTextureId ( )

On first access, OpenGL textures will be generated.

This function must be called from within a valid OpenGL context.

◆ selectActiveTextureUnit()

bool Wizt::GLTextureID::selectActiveTextureUnit ( ) const
Returns
false if active texture are not supported, such as in ancient OpenGL

References Wizt::GLContextChecker::invalidContext(), and Wizt::RequireGLContext().