VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrv::DtIndirectGlTextureObjectManager Class Reference

This manager manages the lifetime of the actual gl texture objects (gl unsigned ints) in the indirect rendering module.

These texture objects are based on (keyed on) DtIndirectTexturePrototype.

See DtIndirectTexturePrototype and DtIndirectTexturePrototypeManager for detailed explanation of the texturing system.

Inheritance diagram for makVrv::DtIndirectGlTextureObjectManager:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtIndirectGlTextureObjectManager ()
 
 DtIndirectGlTextureObjectManager ()=delete
 
DtIndirectGlTextureObjectManageroperator= (const DtIndirectGlTextureObjectManager &rhs)=delete
 
 DtIndirectGlTextureObjectManager (const DtIndirectGlTextureObjectManager &rhs)=delete
 
virtual
DtIndirectGlTextureObjectResult 
getOrCreate (const DtIndirectTexturePrototype *vrvTexture, int textureLimitStrategy)
 
virtual DtIndirectGlTextureObjectget (const DtIndirectTexturePrototype *vrvTexture)
 
virtual bool has (unsigned int textureId) const
 
virtual bool removeEntry (DtIndirectGlTextureObject *indirectGlTextureObject)
 
virtual unsigned int outOfMemoryTextureId (void) const
 
virtual DtVector2< intseenImageSize (const std::string &imageFileAbsolutePath) const
 
virtual void run (unsigned int frameNumber)
 
virtual std::unordered_set
< DtIndirectGlTextureObject * > & 
texturesSet (void)
 
virtual void printStatsWhenNoWindows (void)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static
DtIndirectGlTextureObjectManager
instance (DtDe &de)
 

Protected Member Functions

 DtIndirectGlTextureObjectManager (DtDe &de)
 
virtual unsigned int createCompressedGlTexture2d (const DtIndirectTexturePrototype *vrvTexture, const DtIndirectImagePrototype *vrvImage, const DtIndirectLimitTextureStrategy &indirectLimitTextureStrategy, bool regularPath, bool &aboveCutoff) const
 
virtual unsigned int createUnCompressedGlTexture2d (const DtIndirectTexturePrototype *vrvTexture, const DtIndirectImagePrototype *vrvImage, const DtIndirectLimitTextureStrategy &indirectLimitTextureStrategy) const
 
virtual unsigned int createGlTexture2dArray (const DtIndirectTexturePrototype *vrvTexture) const
 
virtual unsigned int createGlTexture3D (const DtIndirectTexturePrototype *vrvTexture) const
 
virtual void setupWrapFilteringAndAniso (unsigned int textureId, const DtIndirectTexturePrototype *vrvTexture) const
 
virtual bool textureWillPutMemoryAboveCutoff (int sizeOfTextureInBytes) const
 
virtual
DtIndirectLimitTextureStrategy
limitTextureStrategy (int strategyType)
 

Protected Attributes

DtDemyDe
 
DtSignalConnectionManager myConnections
 
std::unordered_map< const
DtIndirectTexturePrototype
*, DtIndirectGlTextureObject * > 
myTexturePrototypeToObject
 
std::unordered_map
< DtIndirectGlTextureObject
*, const
DtIndirectTexturePrototype * > 
myTextureObjectToPrototype
 
std::unordered_map< unsigned
int, DtIndirectGlTextureObject * > 
myIdToGlTextures
 
std::unordered_set
< DtIndirectGlTextureObject * > 
mySetIndirectGlTextureObjects
 
boost::mutex myMutex
 
DtMeifConvertermyImageCompressor
 
int myOutOfMemoryTextureId
 
DtIndirectDefaultTexturesContainermyDefaultTexturesContainer
 
std::unordered_map
< std::string, DtVector2< int > > 
mySeenImages
 
DtIndirectLimitTextureStrategymyNoLimitStrategy
 
DtIndirectLimitTextureStrategymyTerrainLimitTextureStrategy
 
DtIndirectLogmyIndirectLog
 
DtIndirectTextureResidencyManagermyIndirectTextureResidencyManager
 
DtIndirectImagePrototypeManagermyImagePrototypeManager
 

Static Protected Attributes

static const std::string theClassName
 

Constructor & Destructor Documentation

virtual makVrv::DtIndirectGlTextureObjectManager::~DtIndirectGlTextureObjectManager ( )
virtual

destructor

makVrv::DtIndirectGlTextureObjectManager::DtIndirectGlTextureObjectManager ( )
delete

not allowed

makVrv::DtIndirectGlTextureObjectManager::DtIndirectGlTextureObjectManager ( const DtIndirectGlTextureObjectManager rhs)
delete

not allowed

makVrv::DtIndirectGlTextureObjectManager::DtIndirectGlTextureObjectManager ( DtDe de)
protected

cannot create directly

Member Function Documentation

static DtIndirectGlTextureObjectManager& makVrv::DtIndirectGlTextureObjectManager::instance ( DtDe de)
static

Access the singleton instance.

DtIndirectGlTextureObjectManager& makVrv::DtIndirectGlTextureObjectManager::operator= ( const DtIndirectGlTextureObjectManager rhs)
delete

not allowed

virtual DtIndirectGlTextureObjectResult makVrv::DtIndirectGlTextureObjectManager::getOrCreate ( const DtIndirectTexturePrototype vrvTexture,
int  textureLimitStrategy 
)
virtual

Get or create a texture keyed on the given vrv texture If not present, will make a texture object. If present, will return the texture object. Will use the vrv texture's image to fill its mip maps.

Parameters
vrvTextureThe DtIndirectTexturePrototype template to create the texture from
limitstrategy to use (there's only 2 right now, entity and terrain)
virtual DtIndirectGlTextureObject* makVrv::DtIndirectGlTextureObjectManager::get ( const DtIndirectTexturePrototype vrvTexture)
virtual

same as above, but will not create, if not present. will return 0 in this case

virtual bool makVrv::DtIndirectGlTextureObjectManager::has ( unsigned int  textureId) const
virtual

whether this exists

virtual bool makVrv::DtIndirectGlTextureObjectManager::removeEntry ( DtIndirectGlTextureObject indirectGlTextureObject)
virtual

This is called via DtIndirectGlTextureObject, when it's user count goes to zero Higher up, it is actually called indirectly called via DtGpuCulling::releaseGlObjects with a call to remove itself as the user of the DtIndirectGlTextureObject.

virtual unsigned int makVrv::DtIndirectGlTextureObjectManager::outOfMemoryTextureId ( void  ) const
virtual

texture id of the texture used when we are out of memory

virtual DtVector2<int> makVrv::DtIndirectGlTextureObjectManager::seenImageSize ( const std::string &  imageFileAbsolutePath) const
virtual

get the size of the image that's been seen so far useful to track all images seen, because images can be nulled out after processing and deleted by the ref counting of the caching in DtOsgFileCache

virtual void makVrv::DtIndirectGlTextureObjectManager::run ( unsigned int  frameNumber)
virtual

This will actually just run once for each gc, each frame.

virtual std::unordered_set<DtIndirectGlTextureObject*>& makVrv::DtIndirectGlTextureObjectManager::texturesSet ( void  )
virtual

accessor

virtual void makVrv::DtIndirectGlTextureObjectManager::printStatsWhenNoWindows ( void  )
virtual

Used for debugging This is used for debugging for when we removed all windows There should be no textures with resident handles. Furthermore, textures with no resident handles in any context, should have been deleted.

virtual unsigned int makVrv::DtIndirectGlTextureObjectManager::createCompressedGlTexture2d ( const DtIndirectTexturePrototype vrvTexture,
const DtIndirectImagePrototype vrvImage,
const DtIndirectLimitTextureStrategy indirectLimitTextureStrategy,
bool  regularPath,
bool aboveCutoff 
) const
protectedvirtual

create compressed 2d image. this is the path used majority of the time

virtual unsigned int makVrv::DtIndirectGlTextureObjectManager::createUnCompressedGlTexture2d ( const DtIndirectTexturePrototype vrvTexture,
const DtIndirectImagePrototype vrvImage,
const DtIndirectLimitTextureStrategy indirectLimitTextureStrategy 
) const
protectedvirtual

create compressed 2d image. (e.g. sfx pods)

virtual unsigned int makVrv::DtIndirectGlTextureObjectManager::createGlTexture2dArray ( const DtIndirectTexturePrototype vrvTexture) const
protectedvirtual

create compressed 2d image. (sfx textures are sometimes 2d arrays)

virtual unsigned int makVrv::DtIndirectGlTextureObjectManager::createGlTexture3D ( const DtIndirectTexturePrototype vrvTexture) const
protectedvirtual

create uncompressed 3d texture.

virtual void makVrv::DtIndirectGlTextureObjectManager::setupWrapFilteringAndAniso ( unsigned int  textureId,
const DtIndirectTexturePrototype vrvTexture 
) const
protectedvirtual

set up texture parameters into texture id from the vrv texture

virtual bool makVrv::DtIndirectGlTextureObjectManager::textureWillPutMemoryAboveCutoff ( int  sizeOfTextureInBytes) const
protectedvirtual

whether making this texture will put the used memory above cutoff

virtual DtIndirectLimitTextureStrategy* makVrv::DtIndirectGlTextureObjectManager::limitTextureStrategy ( int  strategyType)
protectedvirtual

internal

Member Data Documentation

DtDe& makVrv::DtIndirectGlTextureObjectManager::myDe
protected
DtSignalConnectionManager makVrv::DtIndirectGlTextureObjectManager::myConnections
protected
std::unordered_map<const DtIndirectTexturePrototype*, DtIndirectGlTextureObject*> makVrv::DtIndirectGlTextureObjectManager::myTexturePrototypeToObject
protected

of vrv texture to the indirect gl texture object

std::unordered_map<DtIndirectGlTextureObject*, const DtIndirectTexturePrototype* > makVrv::DtIndirectGlTextureObjectManager::myTextureObjectToPrototype
protected
std::unordered_map<unsigned int, DtIndirectGlTextureObject*> makVrv::DtIndirectGlTextureObjectManager::myIdToGlTextures
protected

another map for fast look up

std::unordered_set<DtIndirectGlTextureObject*> makVrv::DtIndirectGlTextureObjectManager::mySetIndirectGlTextureObjects
protected

another set for fast look up

boost::mutex makVrv::DtIndirectGlTextureObjectManager::myMutex
protected
DtMeifConverter* makVrv::DtIndirectGlTextureObjectManager::myImageCompressor
protected
int makVrv::DtIndirectGlTextureObjectManager::myOutOfMemoryTextureId
protected
DtIndirectDefaultTexturesContainer& makVrv::DtIndirectGlTextureObjectManager::myDefaultTexturesContainer
protected

cache to avoid repeated look ups via DtIndirectDefaultTexturesContainer::instance(myDe)

const std::string makVrv::DtIndirectGlTextureObjectManager::theClassName
staticprotected
std::unordered_map<std::string, DtVector2<int> > makVrv::DtIndirectGlTextureObjectManager::mySeenImages
protected
DtIndirectLimitTextureStrategy* makVrv::DtIndirectGlTextureObjectManager::myNoLimitStrategy
protected
DtIndirectLimitTextureStrategy& makVrv::DtIndirectGlTextureObjectManager::myTerrainLimitTextureStrategy
protected
DtIndirectLog& makVrv::DtIndirectGlTextureObjectManager::myIndirectLog
protected
DtIndirectTextureResidencyManager* makVrv::DtIndirectGlTextureObjectManager::myIndirectTextureResidencyManager
protected
DtIndirectImagePrototypeManager& makVrv::DtIndirectGlTextureObjectManager::myImagePrototypeManager
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)