# TextureContext

from pandac.PandaModules import TextureContext

Class : TextureContext
Description : This is a special class object that holds all the information returned by a particular GSG to indicate the texture's internal context identifier.
Textures typically have an immediate-mode and a retained-mode operation. When using textures in retained-mode (in response to Texture::prepare()), the GSG will create some internal handle for the texture and store it here. The texture stores all of these handles internally.

## Inheritance:

TextureContext: BufferContext AdaptiveLruPage
BufferContext: SavedContext
SavedContext: TypedObject
TypedObject: MemoryBase
MemoryBase:
AdaptiveLruPage: AdaptiveLruPageDynamicList AdaptiveLruPageStaticList
AdaptiveLruPageDynamicList:
AdaptiveLruPageStaticList:

## Methods of TextureContext:

getClassType
getTexture
wasImageModified
wasModified
wasPropertiesModified
wasSimpleImageModified

## Methods of BufferContext:

getActive
getClassType
getDataSizeBytes
getModified
getResident

## Methods of SavedContext:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of AdaptiveLruPage:

AdaptiveLruPage (Constructor)
dequeueLru
enqueueLru
evictLru
getLru
getLruSize
getNumFrames
getNumInactiveFrames
markUsedLru
operator =
output
setLruSize
write

getClassType static TypeHandle TextureContext::get_class_type(void); Undocumented function.

getTexture Texture *TextureContext::get_texture(void) const; Description: Returns the pointer to the associated Texture object.

wasImageModified bool TextureContext::was_image_modified(void) const; Description: Returns true if the texture image has been modified since the last time mark_loaded() was called.

wasModified bool TextureContext::was_modified(void) const; Description: Returns true if the texture properties or image have been modified since the last time mark_loaded() was called.

wasPropertiesModified bool TextureContext::was_properties_modified(void) const; Description: Returns true if the texture properties (unrelated to the image) have been modified since the last time mark_loaded() was called.

wasSimpleImageModified bool TextureContext::was_simple_image_modified(void) const; Description: Returns true if the texture's "simple" image has been modified since the last time mark_simple_loaded() was called.

getActive bool BufferContext::get_active(void) const; Description: Returns the active flag associated with this object. An object is considered "active" if it was rendered in the current frame.

getClassType static TypeHandle BufferContext::get_class_type(void); Undocumented function.

getDataSizeBytes unsigned int BufferContext::get_data_size_bytes(void) const; Description: Returns the number of bytes previously reported for the data object. This is used to track changes in the data object's allocated size; if it changes from this, we need to create a new buffer. This is also used to track memory utilization in PStats.

getModified UpdateSeq BufferContext::get_modified(void) const; Description: Returns the UpdateSeq that was recorded the last time mark_loaded() was called.

getResident bool BufferContext::get_resident(void) const; Description: Returns the resident flag associated with this object. An object is considered "resident" if it appears to be resident in texture memory.

getClassType static TypeHandle SavedContext::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

AdaptiveLruPage AdaptiveLruPage::AdaptiveLruPage(unsigned int lru_size); Description:

dequeueLru void AdaptiveLruPage::dequeue_lru(void); Description: Removes the page from its AdaptiveLru.

enqueueLru void AdaptiveLruPage::enqueue_lru(AdaptiveLru *lru); Description: Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added. If lru is NULL, it means to remove this page from its LRU.

evictLru virtual void AdaptiveLruPage::evict_lru(void); Description: Evicts the page from the LRU. Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page. It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).

getLru AdaptiveLru *AdaptiveLruPage::get_lru(void) const; Description: Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.

getLruSize unsigned int AdaptiveLruPage::get_lru_size(void) const; Description: Returns the size of this page as reported to the LRU, presumably in bytes.

getNumFrames unsigned int AdaptiveLruPage::get_num_frames(void) const; Not defined in SimpleLruPage. Description: Returns the number of frames since the page was first added to its LRU. Returns 0 if it does not have an LRU.

getNumInactiveFrames unsigned int AdaptiveLruPage::get_num_inactive_frames(void) const; Not defined in SimpleLruPage. Description: Returns the number of frames since the page was last accessed on its LRU. Returns 0 if it does not have an LRU.

markUsedLru void AdaptiveLruPage::mark_used_lru(void) const; Description: To be called when the page is used; this will move it to the tail of the AdaptiveLru queue it is already on. This method is const because it's not technically modifying the contents of the page itself. Description: To be called when the page is used; this will move it to the tail of the specified AdaptiveLru queue.

operator = void AdaptiveLruPage::operator =(AdaptiveLruPage const &copy); Description:

output virtual void AdaptiveLruPage::output(ostream &out) const; Description:

setLruSize void AdaptiveLruPage::set_lru_size(unsigned int lru_size); Description: Specifies the size of this page, presumably in bytes, although any unit is possible.

write virtual void AdaptiveLruPage::write(ostream &out, int indent_level) const; Description: