The Vish Visualization Shell 0.3
Vish
Wizt::TextureCreator Class Reference

A handler for texture creation and release. More...

#include <ocean/Anemonia/TextureBase.hpp>

Inheritance diagram for Wizt::TextureCreator:
MemCore::CreatorBase< TextureBase >

Public Member Functions

MemCore::RefPtr< TextureBaseactivate () const
 Touch in cache and bind to OpenGL ID.
MemCore::RefPtr< TextureBaseget () const override
 Try to get data if possible.
const std::type_info & getType () override
 Query the associated value type of this creator object.
Creature::ReasonForReleasal release () override
 Release the texture memory.
 TextureCreator (const MemCore::WCachePtr &MyCache)
 Constructor, give the OpenGL Cache here.
 ~TextureCreator ()
 Destructor, must be called within an OpenGL context.
Public Member Functions inherited from MemCore::CreatorBase< TextureBase >
RefPtr< TextureBase > create (bool CreateAsOld=false)
 Actually create the object, using an existing one if existent via the get() function, otherwise calling the virtual produce() function.
RefPtr< TextureBase > createAsOld ()
 Get and possibly create data here without touching it, which is useful if the data is required only temporary.
 CreatorBase (const WCachePtr &theCache)
 Construct with Cache object given.
RefPtr< TextureBase > get_or_request (const result &R=nullptr)
 Asynchronous data access: Get the data if available, otherwise request them if possible and return nullptr.
bool isUnderCreation () const override
 return true while a request issued by the producer is still ongoing
virtual bool request (const result &R=nullptr)
 Asynchron mode: Request data to be created.
virtual RefPtr< TextureBase > take ()
 Take the data out of this creator and yield it as return value.

Detailed Description

A handler for texture creation and release.

There are no functions to actually create the texture here, there is just a place to hold one. This texture reference may vanish at any time due to the cache management system. This will not work if a strong reference to the texture is kept elsewhere. It is up to the application code to check whether such a texture object exists, and if not, create and set an appropriate one.

Todo
should be derived from Creator<> template?

Member Function Documentation

◆ getType()

const std::type_info & Wizt::TextureCreator::getType ( )
inlineoverridevirtual

Query the associated value type of this creator object.

This type information can possibly be determined without actually loading any data. Whether or not this is the case is up to the implementation of the child class.

Implements MemCore::CreatorBase< TextureBase >.