The Vish Visualization Shell 0.3
Vish
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Wizt::GLTextureBase Class Referenceabstract

Base class for OpenGL Texture ID's. More...

#include <ocean/GLvish/TextureID.hpp>

Inheritance diagram for Wizt::GLTextureBase:
Wizt::TextureBase MemCore::Cacheable MemCore::Ageable MemCore::Intercube MemCore::ReferenceBase< Cacheable > Wizt::TextureID< 1 > Wizt::TextureID< N > Wizt::TextureID< N > Wizt::GLTexture< 1, 1 > Wizt::GLTexture< 2, 1 > Wizt::GLTexture< 3, 1 > Wizt::GLTexture< Dims, N > Wizt::GLTexture1D Wizt::GLTexture2DBase Wizt::GLTexture3D Wizt::GlossyTexture Wizt::GLMultisampleTexture2D Wizt::GLTexture2D

Public Member Functions

void getTexLevelParameter (GLenum pname, GLint *params, int i=0, GLint level=0) const
 http://www.opengl.org/sdk/docs/man/xhtml/glGetTexLevelParameter.xml
 
 GLTextureBase (int TextureTarget, const MemCore::WeakPtr< MemCore::Creature > &C, int textureID=0) throw ()
 Constructor, specify texture unit (optional, by default 0)
 
void TexParameterf (GLenum pname, GLfloat param, int i=0)
 Sets an OpenGL texture parameter.
 
 ~GLTextureBase ()
 Destructor.
 
- Public Member Functions inherited from Wizt::TextureBase
virtual void bind (int i=0) const =0
 Bind the texture with the given ID.
 
int getTextureUnit () const
 Return the active texture unit selected here.
 
bool setActiveTexture (int textureID)
 Associate a texture unit with this texture ID which relates to glActiveTexture(), as to be invoked via activate().
 
 TextureBase (const MemCore::WeakPtr< MemCore::Creature > &C, int textureID=0) throw ()
 Constructor, specify texture unit (optional, by default 0)
 
virtual void unbind () const =0
 Deactive the given texture.
 
virtual ~TextureBase ()
 Virtual Destructor.
 
- Public Member Functions inherited from MemCore::Cacheable
 Cacheable (const WeakPtr< Creature > &C)
 Constructor.
 
virtual void DeferredConstructor ()
 A virtual function that is called on the first strong referencing of a Cacheable object.
 
bool isCached () const
 Check whether this object is managed by a cache queue.
 
bool isUncached () const
 Check whether this object is managed by a cache queue.
 
bool markAsUsed ()
 Mark this data object as being recently used.
 
virtual memsize_t memsize () const =0
 Ask how many bytes this object occupies.
 
WeakPtr< CacheBasemyCache () const
 Return the associated Cache object as known from the associated Creator, if any.
 
const WeakPtr< Creature > & myCreator () const
 Return the associated Creator, if any.
 
int NumberOfListEntries () const
 Count the number of entries here.
 
void PreDestructor ()
 This class uses a predestructor to remove itself's size from the cache queue.
 
void push_back (CacheQueue &Q)
 Put the current item onto the BACK of the given cache queue.
 
void push_front (CacheQueue &Q)
 Put the current item onto the FRONT of the given cache queue.
 
void setCreator (const WeakPtr< Creature > &C)
 Set and the creator.
 
- Public Member Functions inherited from MemCore::ReferenceBase< Cacheable >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< Cacheable, Cacheable > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
 
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
 
refcount_t refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (Cacheable *that) noexcept
 Constructor, initializes reference counter to zero.
 
const auto & self () const
 Return weak pointer to the object self.
 
refcount_t wrefcount () const noexcept
 The weak reference count.
 
- Public Member Functions inherited from MemCore::Ageable
 Ageable () noexcept
 Constructor; remembers birth time from current time counter.
 
constexpr Ageable (age_t t) noexcept
 Constructor with explicit time value.
 
constexpr Ageable (const Ageable &A) noexcept
 Copy constructor.
 
 Ageable (const volatile Ageable &A) noexcept
 Copy constructor.
 
constexpr const AgeablegetAge () const
 Return reference to this age, useful for derived classes.
 
bool isNewerThan (const Ageable &a) const noexcept
 Comparison operator.
 
bool isOlderThan (const Ageable &a) const noexcept
 Comparison operator.
 
bool isYoungerThan (const Ageable &a) const noexcept
 Comparison operator (alias to isNewerThan() )
 
bool operator!= (const Ageable &a) const noexcept
 Comparison operator.
 
bool operator< (const Ageable &a) const noexcept
 Comparison operator.
 
bool operator<= (const Ageable &a) const noexcept
 Comparision operator.
 
bool operator<= (const volatile Ageable &a) const volatile noexcept
 Comparision operator.
 
bool operator== (const Ageable &a) const noexcept
 Comparison operator.
 
bool operator> (const Ageable &a) const noexcept
 Comparison operator.
 
bool operator> (const volatile Ageable &a) const volatile throw ()
 Comparision operator.
 
bool operator>= (const Ageable &a) const noexcept
 Comparision operator.
 
bool operator>= (const volatile Ageable &a) const volatile noexcept
 Comparison operator.
 
constexpr void resetAge () noexcept
 Set time value to InfinitelyOld().
 
void setInfinitelyNew () noexcept
 Set time value to InfinitelyOld().
 
age_t time_value () const noexcept
 Return an object's current age.
 
age_t time_value () const volatile noexcept
 Return an object's current age.
 
Ageabletouch () noexcept
 Mark the current object as being modified "now".
 
age_t update (age_t age) noexcept
 Set the age of the current object to a specific age if that is newer than the current one.
 
age_t update (const Ageable &Other) noexcept
 Set the age of the current object to the age of another object if that other one is newer than the current one.
 
age_t update (const volatile Ageable &Other) volatile noexcept
 Set the age of the current object to the age of another object if that other one is newer than the current one.
 
 ~Ageable () noexcept
 Destructor.
 
- Public Member Functions inherited from MemCore::Intercube
void addInterface (const RefPtr< InterfaceBase > &I) const
 Add an interface class object.
 
template<class Data >
void addInterfaceData (const Data &D)
 Add data via an interface class object.
 
template<class Data , typename TypeSelector >
void addInterfaceData (const Data &D)
 Add data via an interface class object.
 
void clearInterfaces ()
 Remove all interfaces.
 
bool const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const
 Constant iterator.
 
virtual RefPtr< InterfaceBasecreateInterface (const type_info &) const
 Virtual function which allows derived objects to create Interface objects on demand.
 
RefPtr< InterfaceBasefindInterface (const type_info &t) const
 Find a certain interface of specified type.
 
RefPtr< InterfaceBasegetInterface (const type_info &t)
 Retrieve an interface object from a certain type.
 
std::string getInterfaceNames (const char delim=';') const
 Debug function retrieving all interfaces as human-readable string.
 
template<class Data >
bool gotNewInterfaceData (const Data &D)
 Check whether data on the given interface have changed, and if so, set new data as interface.
 
template<class Data >
bool gotNewInterfaceData (mutex &M, const Data &D)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector &S)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector *S)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data >
bool hasChangedInterfaceData (const Data &D) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D, const Selector &) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D, const Selector *) const
 Check whether interface data have changed.
 
bool hasInterface (const type_info &t) const
 Check if some Interface might exist.
 
 Intercube ()
 Constructor.
 
bool iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP)
 Modifyable iterator.
 
void printInterfaces () const
 Debug function that prints the names of all interfaces.
 
void registerInterface (const type_info &t)
 Register an interface type; when the interface is actually required, the virtual createInterface() function will be called.
 
template<class InterfaceType >
void removeInterface ()
 Remove an interface.
 
void removeInterfaceBase (const type_info &InterfaceBaseID)
 Remove an interface.
 
virtual ~Intercube ()
 Destructor.
 

Public Attributes

const int target
 The corresponding OpenGL texture target (GL_TEXTURE_nD)
 

Protected Member Functions

bool SelectActiveTextureUnit () const
 Activate the associated texture unit Return false if run with an OpenGL version that does not support multiple texture units (pre 2.0) Calls glActiveTexture.
 
virtual void setTexParameters (int i=0)=0
 Bind the active texture and set parameters as defined in the respective child class.
 
- Protected Member Functions inherited from MemCore::Cacheable
void adjustCacheableSize (memsize_t memDiff)
 In case this object changes its size after insertion to the CacheQueue, call this function to adjust.
 
 ~Cacheable ()
 Destructor.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< Cacheable >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
 
void suicide ()
 Delete this.
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Additional Inherited Members

- Public Types inherited from MemCore::Cacheable
using cachecounter_t = unsigned long
 The type to store repeated accesses to a cached object.
 
- Public Types inherited from MemCore::ReferenceBase< Cacheable >
using reference_domain_t = Cacheable
 The type of the base class.
 
using SelfPtr_t = WeakPtr< Cacheable, Cacheable >
 Type for a pointer to this object itself.
 
- Static Public Member Functions inherited from MemCore::Ageable
static const AgeableInfinitelyNew () noexcept
 Return a time that is infinitely in the future (well, sort of).
 
static constexpr const AgeableInfinitelyOld () noexcept
 Return a time that is infinitely in the past (well, sort of).
 
static age_t now () noexcept
 Return the current global time.
 

Detailed Description

Base class for OpenGL Texture ID's.

Supports multiple active texture units as specified in OpenGL 2.

Constructor & Destructor Documentation

◆ GLTextureBase()

Wizt::GLTextureBase::GLTextureBase ( int  TextureTarget,
const MemCore::WeakPtr< MemCore::Creature > &  C,
int  textureID = 0 
)
throw (
)
inline

Constructor, specify texture unit (optional, by default 0)

Parameters
Cthe responsible Creator object

Member Function Documentation

◆ getTexLevelParameter()

void Wizt::GLTextureBase::getTexLevelParameter ( GLenum  pname,
GLint *  params,
int  i = 0,
GLint  level = 0 
) const
inline

http://www.opengl.org/sdk/docs/man/xhtml/glGetTexLevelParameter.xml

Parameters
pnameSpecifies the symbolic name of a texture parameter. GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_DEPTH, GL_TEXTURE_INTERNAL_FORMAT, GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE, GL_TEXTURE_DEPTH_SIZE, GL_TEXTURE_COMPRESSED, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, and GL_TEXTURE_BUFFER_OFFSET are accepted.

◆ SelectActiveTextureUnit()

bool Wizt::GLTextureBase::SelectActiveTextureUnit ( ) const
protected

Activate the associated texture unit Return false if run with an OpenGL version that does not support multiple texture units (pre 2.0) Calls glActiveTexture.

See also
http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml

This function does not call bind().

References Wizt::TextureBase::getTextureUnit().

Referenced by Wizt::GlossyTexture::beginRender(), Wizt::GLTexture< Dims, N >::bind(), Wizt::GlossyTexture::endRender(), Wizt::GLTexture< Dims, N >::unbind(), and Wizt::TextureID< N >::~TextureID().

◆ TexParameterf()

void Wizt::GLTextureBase::TexParameterf ( GLenum  pname,
GLfloat  param,
int  i = 0 
)
inline

Sets an OpenGL texture parameter.

Parameters
pnameSpecifies the symbolic name of a single-valued texture parameter. pname can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R, or GL_TEXTURE_PRIORITY.
Note
Call SelectActiveTextureUnit() before invoking these functions.