Public Member Functions | |
BufferObject () | |
BufferObject (const BufferObject &bo, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
virtual bool | isSameKindAs (const Object *obj) const |
virtual const char * | libraryName () const |
virtual const char * | className () const |
void | setUsage (GLenum usage) |
GLenum | getUsage () const |
bool | isBufferObjectSupported (unsigned int contextID) const |
bool | isPBOSupported (unsigned int contextID) const |
GLuint & | buffer (unsigned int contextID) const |
void | bindBuffer (unsigned int contextID) const |
void | unbindBuffer (unsigned int contextID) const |
void | dirty () |
bool | isDirty (unsigned int contextID) const |
virtual void | compileBuffer (State &state) const =0 |
virtual void | resizeGLObjectBuffers (unsigned int maxSize) |
void | releaseGLObjects (State *state=0) const |
Static Public Member Functions | |
static void | deleteBufferObject (unsigned int contextID, GLuint globj) |
static void | flushDeletedBufferObjects (unsigned int contextID, double, double &availableTime) |
static void | discardDeletedBufferObjects (unsigned int contextID) |
static Extensions * | getExtensions (unsigned int contextID, bool createIfNotInitalized) |
static void | setExtensions (unsigned int contextID, Extensions *extensions) |
Protected Types | |
typedef osg::buffered_value < GLuint > | GLObjectList |
typedef osg::buffered_value < unsigned int > | CompiledList |
Protected Member Functions | |
virtual | ~BufferObject () |
Protected Attributes | |
GLObjectList | _bufferObjectList |
CompiledList | _compiledList |
GLenum | _target |
GLenum | _usage |
unsigned int | _totalSize |
Classes | |
struct | BufferEntry |
class | Extensions |
typedef osg::buffered_value<GLuint> osg::BufferObject::GLObjectList [protected] |
typedef osg::buffered_value<unsigned int> osg::BufferObject::CompiledList [protected] |
osg::BufferObject::BufferObject | ( | ) |
osg::BufferObject::BufferObject | ( | const BufferObject & | bo, | |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY | |||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::BufferObject::~BufferObject | ( | ) | [protected, virtual] |
virtual bool osg::BufferObject::isSameKindAs | ( | const Object * | obj | ) | const [inline, virtual] |
virtual const char* osg::BufferObject::libraryName | ( | ) | const [inline, virtual] |
return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.
Implements osg::Object.
virtual const char* osg::BufferObject::className | ( | ) | const [inline, virtual] |
return the name of the object's class type. Must be defined by derived classes.
Implements osg::Object.
void osg::BufferObject::setUsage | ( | GLenum | usage | ) | [inline] |
Set what type of usage the buffer object will have. Options are: GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, or GL_DYNAMIC_COPY.
GLenum osg::BufferObject::getUsage | ( | ) | const [inline] |
Get the type of usage the buffer object has been set up for.
bool osg::BufferObject::isBufferObjectSupported | ( | unsigned int | contextID | ) | const [inline] |
bool osg::BufferObject::isPBOSupported | ( | unsigned int | contextID | ) | const [inline] |
GLuint& osg::BufferObject::buffer | ( | unsigned int | contextID | ) | const [inline] |
void osg::BufferObject::bindBuffer | ( | unsigned int | contextID | ) | const [inline] |
References osg::BufferObject::Extensions::glBindBuffer().
void osg::BufferObject::unbindBuffer | ( | unsigned int | contextID | ) | const [inline] |
References osg::BufferObject::Extensions::glBindBuffer().
void osg::BufferObject::dirty | ( | ) | [inline] |
bool osg::BufferObject::isDirty | ( | unsigned int | contextID | ) | const [inline] |
virtual void osg::BufferObject::compileBuffer | ( | State & | state | ) | const [pure virtual] |
Implemented in osg::VertexBufferObject, osg::ElementBufferObject, and osg::PixelBufferObject.
virtual void osg::BufferObject::resizeGLObjectBuffers | ( | unsigned int | maxSize | ) | [virtual] |
Resize any per context GLObject buffers to specified size.
Reimplemented from osg::Object.
Reimplemented in osg::VertexBufferObject, osg::ElementBufferObject, and osg::PixelBufferObject.
void osg::BufferObject::releaseGLObjects | ( | State * | state = 0 |
) | const [virtual] |
If State is non-zero, this function releases OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.
Reimplemented from osg::Object.
static void osg::BufferObject::deleteBufferObject | ( | unsigned int | contextID, | |
GLuint | globj | |||
) | [static] |
Use deleteVertexBufferObject instead of glDeleteBuffers to allow OpenGL buffer objects to be cached until they can be deleted by the OpenGL context in which they were created, specified by contextID.
static void osg::BufferObject::flushDeletedBufferObjects | ( | unsigned int | contextID, | |
double | , | |||
double & | availableTime | |||
) | [static] |
flush all the cached display list which need to be deleted in the OpenGL context related to contextID.
static void osg::BufferObject::discardDeletedBufferObjects | ( | unsigned int | contextID | ) | [static] |
dicard all the cached display list which need to be deleted in the OpenGL context related to contextID. Note, unlike flush no OpenGL calls are made, instead the handles are all removed. this call is useful for when an OpenGL context has been destroyed.
static Extensions* osg::BufferObject::getExtensions | ( | unsigned int | contextID, | |
bool | createIfNotInitalized | |||
) | [static] |
Function to call to get the extension of a specified context. If the Extension object for that context has not yet been created and the 'createIfNotInitalized' flag been set to false then returns NULL. If 'createIfNotInitalized' is true then the Extensions object is automatically created. However, in this case the extension object is only created with the graphics context associated with ContextID..
static void osg::BufferObject::setExtensions | ( | unsigned int | contextID, | |
Extensions * | extensions | |||
) | [static] |
setExtensions allows users to override the extensions across graphics contexts. typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions.
GLObjectList osg::BufferObject::_bufferObjectList [mutable, protected] |
CompiledList osg::BufferObject::_compiledList [mutable, protected] |
GLenum osg::BufferObject::_target [protected] |
GLenum osg::BufferObject::_usage [protected] |
unsigned int osg::BufferObject::_totalSize [mutable, protected] |