Panda3D
Public Member Functions | Static Public Member Functions | Friends
VertexBufferContext Class Reference

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 "vertexBufferContext.h"

Inheritance diagram for VertexBufferContext:
BufferContext AdaptiveLruPage SavedContext LinkedListNode AdaptiveLruPageDynamicList AdaptiveLruPageStaticList TypedObject LinkedListNode LinkedListNode MemoryBase DXVertexBufferContext8

List of all members.

Public Member Functions

 VertexBufferContext (PreparedGraphicsObjects *pgo, GeomVertexArrayData *data)
bool changed_size (const GeomVertexArrayDataHandle *reader) const
 Returns true if the data has changed size since the last time mark_loaded() was called.
bool changed_usage_hint (const GeomVertexArrayDataHandle *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 ()
GeomVertexArrayDataget_data () const
 Returns the pointer to the client-side array data object.
virtual TypeHandle get_type () const
void mark_loaded (const GeomVertexArrayDataHandle *reader)
 Should be called after the VertexBufferContext 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 GeomVertexArrayDataHandle *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

Detailed Description

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 vertexBufferContext.h.


Member Function Documentation

bool VertexBufferContext::changed_size ( const GeomVertexArrayDataHandle 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 vertexBufferContext.I.

References BufferContext::get_data_size_bytes().

Referenced by DXGraphicsStateGuardian8::apply_vertex_buffer().

bool VertexBufferContext::changed_usage_hint ( const GeomVertexArrayDataHandle 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 vertexBufferContext.I.

Returns the pointer to the client-side array data object.

Definition at line 36 of file vertexBufferContext.I.

Referenced by DXVertexBufferContext8::create_vbuffer(), and DXVertexBufferContext8::upload_data().

static void VertexBufferContext::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 DXVertexBufferContext8.

Definition at line 67 of file vertexBufferContext.h.

References BufferContext::init_type().

Referenced by DXVertexBufferContext8::init_type().

Should be called after the VertexBufferContext has been loaded into graphics memory, this updates the internal flags for changed_size() and modified().

Definition at line 96 of file vertexBufferContext.I.

References BufferContext::set_resident(), update_data_size_bytes(), and BufferContext::update_modified().

Referenced by DXGraphicsStateGuardian8::apply_vertex_buffer().

Should be called after the buffer has been forced out of graphics memory.

Definition at line 113 of file vertexBufferContext.I.

References UpdateSeq::old(), BufferContext::set_resident(), and BufferContext::update_modified().

Referenced by DXVertexBufferContext8::evict_lru().

void VertexBufferContext::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 vertexBufferContext.I.

References AdaptiveLruPage::set_lru_size().

Referenced by DXVertexBufferContext8::evict_lru(), and mark_loaded().

bool VertexBufferContext::was_modified ( const GeomVertexArrayDataHandle 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 vertexBufferContext.I.

References BufferContext::get_modified().

Referenced by DXGraphicsStateGuardian8::apply_vertex_buffer().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations