Panda3D
|
This is a special class object that holds all the information returned by a particular GSG to indicate the vertex data array's internal context identifier. More...
#include "indexBufferContext.h"
Public Member Functions | |
IndexBufferContext (PreparedGraphicsObjects *pgo, GeomPrimitive *data) | |
bool | changed_size (const GeomPrimitivePipelineReader *reader) const |
Returns true if the data has changed size since the last time mark_loaded() was called. | |
bool | changed_usage_hint (const GeomPrimitivePipelineReader *reader) const |
Returns true if the data has changed its usage hint since the last time mark_loaded() was called. | |
virtual TypeHandle | force_init_type () |
GeomPrimitive * | get_data () const |
Returns the pointer to the client-side array data object. | |
virtual TypeHandle | get_type () const |
void | mark_loaded (const GeomPrimitivePipelineReader *reader) |
Should be called after the IndexBufferContext has been loaded into graphics memory, this updates the internal flags for changed_size() and modified(). | |
void | mark_unloaded () |
Should be called after the buffer has been forced out of graphics memory. | |
virtual void | output (ostream &out) const |
void | update_data_size_bytes (size_t new_data_size_bytes) |
Should be called (usually by a derived class) when the on-card size of this object has changed. | |
bool | was_modified (const GeomPrimitivePipelineReader *reader) const |
Returns true if the data has been modified since the last time mark_loaded() was called. | |
virtual void | write (ostream &out, int indent_level) const |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Friends | |
class | PreparedGraphicsObjects |
This is a special class object that holds all the information returned by a particular GSG to indicate the vertex data array's internal context identifier.
This allows the GSG to cache the vertex data array in whatever way makes sense. For instance, DirectX can allocate a vertex buffer for the array. OpenGL can create a buffer object.
Definition at line 36 of file indexBufferContext.h.
bool IndexBufferContext::changed_size | ( | const GeomPrimitivePipelineReader * | reader | ) | const [inline] |
Returns true if the data has changed size since the last time mark_loaded() was called.
Definition at line 47 of file indexBufferContext.I.
References BufferContext::get_data_size_bytes(), and GeomPrimitivePipelineReader::get_data_size_bytes().
Referenced by DXGraphicsStateGuardian8::apply_index_buffer(), and DXGraphicsStateGuardian9::apply_index_buffer().
bool IndexBufferContext::changed_usage_hint | ( | const GeomPrimitivePipelineReader * | reader | ) | const [inline] |
Returns true if the data has changed its usage hint since the last time mark_loaded() was called.
Definition at line 59 of file indexBufferContext.I.
GeomPrimitive * IndexBufferContext::get_data | ( | ) | const [inline] |
Returns the pointer to the client-side array data object.
Definition at line 36 of file indexBufferContext.I.
Referenced by DXIndexBufferContext8::create_ibuffer(), DXIndexBufferContext9::create_ibuffer(), DXIndexBufferContext8::upload_data(), and DXIndexBufferContext9::upload_data().
static void IndexBufferContext::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from BufferContext.
Reimplemented in DXIndexBufferContext9, and DXIndexBufferContext8.
Definition at line 66 of file indexBufferContext.h.
References BufferContext::init_type().
Referenced by DXIndexBufferContext8::init_type(), and DXIndexBufferContext9::init_type().
void IndexBufferContext::mark_loaded | ( | const GeomPrimitivePipelineReader * | reader | ) | [inline] |
Should be called after the IndexBufferContext has been loaded into graphics memory, this updates the internal flags for changed_size() and modified().
Definition at line 96 of file indexBufferContext.I.
References GeomPrimitivePipelineReader::get_data_size_bytes(), BufferContext::set_resident(), update_data_size_bytes(), and BufferContext::update_modified().
Referenced by DXGraphicsStateGuardian8::apply_index_buffer(), and DXGraphicsStateGuardian9::apply_index_buffer().
void IndexBufferContext::mark_unloaded | ( | ) | [inline] |
Should be called after the buffer has been forced out of graphics memory.
Definition at line 113 of file indexBufferContext.I.
References UpdateSeq::old(), BufferContext::set_resident(), and BufferContext::update_modified().
Referenced by DXIndexBufferContext8::evict_lru(), and DXIndexBufferContext9::evict_lru().
void IndexBufferContext::update_data_size_bytes | ( | size_t | new_data_size_bytes | ) | [inline] |
Should be called (usually by a derived class) when the on-card size of this object has changed.
Reimplemented from BufferContext.
Definition at line 83 of file indexBufferContext.I.
References AdaptiveLruPage::set_lru_size().
Referenced by DXIndexBufferContext8::evict_lru(), DXIndexBufferContext9::evict_lru(), and mark_loaded().
bool IndexBufferContext::was_modified | ( | const GeomPrimitivePipelineReader * | reader | ) | const [inline] |
Returns true if the data has been modified since the last time mark_loaded() was called.
Definition at line 71 of file indexBufferContext.I.
References BufferContext::get_modified().
Referenced by DXGraphicsStateGuardian8::apply_index_buffer(), and DXGraphicsStateGuardian9::apply_index_buffer().