panda3d.core.BufferContext

class BufferContext

Bases: SavedContext

This is a base class for those kinds of SavedContexts that occupy an easily-measured (and substantial) number of bytes in the video card’s frame buffer memory or AGP memory. At the present, this includes most of the SavedContext types: VertexBufferContext and IndexBufferContext, as well as TextureContext.

This class provides methods for tracking the video memory utilization, as well as residency of each object, via PStats.

Inheritance diagram

Inheritance diagram of BufferContext

getDataSizeBytes() → size_t

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.

Return type

size_t

getModified() → UpdateSeq

Returns the UpdateSeq that was recorded the last time mark_loaded() was called.

Return type

UpdateSeq

getActive() → bool

Returns the active flag associated with this object. An object is considered “active” if it was rendered in the current frame.

getResident() → bool

Returns the resident flag associated with this object. An object is considered “resident” if it appears to be resident in texture memory.

static getClassType() → TypeHandle
Return type

TypeHandle

property object

Returns the associated object.

Return type

TypedWritableReferenceCount

property data_size_bytes

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.

Return type

size_t

property modified

Returns the UpdateSeq that was recorded the last time mark_loaded() was called.

Return type

UpdateSeq

property active

Returns the active flag associated with this object. An object is considered “active” if it was rendered in the current frame.

Return type

bool

property resident

Returns the resident flag associated with this object. An object is considered “resident” if it appears to be resident in texture memory.

Return type

bool