25#ifndef GL_NV_occlusion_query
27 #define GL_OCCLUSION_TEST_HP 0x8165
28 #define GL_OCCLUSION_TEST_RESULT_HP 0x8166
29 #define GL_PIXEL_COUNTER_BITS_NV 0x8864
30 #define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
31 #define GL_PIXEL_COUNT_NV 0x8866
32 #define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
36#ifndef GL_ARB_occlusion_query
38 #define GL_SAMPLES_PASSED_ARB 0x8914
39 #define GL_QUERY_COUNTER_BITS_ARB 0x8864
40 #define GL_CURRENT_QUERY_ARB 0x8865
41 #define GL_QUERY_RESULT_ARB 0x8866
42 #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
47#ifndef GL_TIME_ELAPSED
48 #define GL_TIME_ELAPSED 0x88BF
49 #define GL_TIMESTAMP 0x8E28
52#ifndef GL_QUERY_RESULT
53 #define GL_QUERY_RESULT 0x8866
54 #define GL_QUERY_RESULT_AVAILABLE 0x8867
58#define INLINE_DRAWABLE_DRAW
69class ArrayDispatchers;
238#ifdef OSG_USE_DEPRECATED_API
240 inline void dirtyDisplayList()
265#ifdef INLINE_DRAWABLE_DRAW
266 inline void draw(
RenderInfo& renderInfo)
const;
548#ifdef INLINE_DRAWABLE_DRAW
553 if (useVertexArrayObject)
586#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
600 glNewList( globj, GL_COMPILE );
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
TemplateIndexArray< GLuint, Array::UIntArrayType, 1, GL_UNSIGNED_INT > UIntArray
Definition Array:419
TemplateArray< Vec2, Array::Vec2ArrayType, 2, GL_FLOAT > Vec2Array
Definition Array:448
TemplateArray< Vec4, Array::Vec4ArrayType, 4, GL_FLOAT > Vec4Array
Definition Array:450
std::vector< Matrix > MatrixList
A vector of NodePath, typically used to describe all the paths from a node to the potential root node...
Definition Node:53
TemplateIndexArray< GLshort, Array::ShortArrayType, 1, GL_SHORT > ShortArray
Definition Array:414
Vec2f Vec2
Definition Vec2:21
TemplateArray< Vec3d, Array::Vec3dArrayType, 3, GL_DOUBLE > Vec3dArray
Definition Array:453
TemplateArray< Vec3, Array::Vec3ArrayType, 3, GL_FLOAT > Vec3Array
Definition Array:449
Vec3f Vec3
Definition Vec3:21
TemplateArray< GLfloat, Array::FloatArrayType, 1, GL_FLOAT > FloatArray
Definition Array:421
BoundingBoxd BoundingBox
Definition BoundingBox:257
TemplateIndexArray< GLushort, Array::UShortArrayType, 1, GL_UNSIGNED_SHORT > UShortArray
Definition Array:418
TemplateArray< GLdouble, Array::DoubleArrayType, 1, GL_DOUBLE > DoubleArray
Definition Array:422
TemplateArray< Vec4d, Array::Vec4dArrayType, 4, GL_DOUBLE > Vec4dArray
Definition Array:454
BoundingSphered BoundingSphere
Definition BoundingSphere:308
TemplateIndexArray< GLbyte, Array::ByteArrayType, 1, GL_BYTE > ByteArray
Definition Array:413
Vec4f Vec4
Definition Vec4:21
T minimum(T lhs, T rhs)
return the minimum of two values, equivalent to std::min.
Definition Math:78
TemplateArray< Vec2d, Array::Vec2dArrayType, 2, GL_DOUBLE > Vec2dArray
Definition Array:452
TemplateIndexArray< GLubyte, Array::UByteArrayType, 1, GL_UNSIGNED_BYTE > UByteArray
Definition Array:417
TemplateArray< Vec4ub, Array::Vec4ubArrayType, 4, GL_UNSIGNED_BYTE > Vec4ubArray
Definition Array:438
TemplateIndexArray< GLint, Array::IntArrayType, 1, GL_INT > IntArray
Definition Array:415
virtual void accept(ArrayVisitor &)=0
ArrayVisitor()
Definition Array:467
ConstArrayVisitor()
Definition Array:526
Implements a simple buffered value for values that need to be buffered on a per graphics context basi...
Definition buffered_value:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Pure virtual base class for drawable geometry.
Definition Drawable:89
friend class StateSet
Definition Drawable:525
virtual void accept(PrimitiveFunctor &) const
Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Dra...
Definition Drawable:503
virtual bool supports(const PrimitiveIndexFunctor &) const
Return true if the Drawable subclass supports accept(PrimitiveIndexFunctor&).
Definition Drawable:506
void setComputeBoundingBoxCallback(ComputeBoundingBoxCallback *callback)
Set the compute bound callback to override the default computeBound.
Definition Drawable:174
virtual bool supports(const AttributeFunctor &) const
Return true if the Drawable subclass supports accept(AttributeFunctor&).
Definition Drawable:452
void setShape(const ref_ptr< T > &shape)
Definition Drawable:190
ref_ptr< Shape > _shape
Definition Drawable:531
const BoundingBox & getInitialBound() const
Set the initial bounding volume to use when computing the overall bounding volume.
Definition Drawable:119
virtual void compileGLObjects(RenderInfo &renderInfo) const
Immediately compile this Drawable into an OpenGL Display List/VertexBufferObjects.
virtual bool supports(const PrimitiveFunctor &) const
Return true if the Drawable subclass supports accept(PrimitiveFunctor&).
Definition Drawable:497
static GLuint generateDisplayList(unsigned int contextID, unsigned int sizeHint=0)
Return a OpenGL display list handle a newly generated or reused from display list cache.
Drawable(const Drawable &drawable, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual void accept(AttributeFunctor &)
accept an AttributeFunctor and call its methods to tell it about the internal attributes that this Dr...
Definition Drawable:457
virtual void dirtyGLObjects()
Force a recompile on next draw() of any OpenGL objects associated with this geoset.
virtual void releaseGLObjects(State *state=0) const
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
virtual bool supports(const ConstAttributeFunctor &) const
Return true if the Drawable subclass supports accept(ConstAttributeFunctor&).
Definition Drawable:487
virtual void setShape(Shape *shape)
Set the Shape of the Drawable.
Definition Drawable:188
bool getSupportsDisplayList() const
Get whether display lists are supported for this drawable instance.
Definition Drawable:210
DrawCallback * getDrawCallback()
Get the non const DrawCallback.
Definition Drawable:370
const VertexArrayStateList & getVertexArrayStateList() const
Definition Drawable:328
const Shape * getShape() const
Get the const Shape of the const Drawable.
Definition Drawable:196
CreateVertexArrayStateCallback * getCreateVertexArrayStateCallback()
Get the callback that overrides the default Drawable::createCreateVertexArrayStateImplementation().
Definition Drawable:308
void setBound(const BoundingBox &bb) const
set the bounding box .
bool _useVertexArrayObject
Definition Drawable:537
static void deleteDisplayList(unsigned int contextID, GLuint globj, unsigned int sizeHint=0)
Use deleteDisplayList instead of glDeleteList to allow OpenGL display list to be cached until they ca...
void drawInner(RenderInfo &renderInfo) const
Definition Drawable:271
const ComputeBoundingBoxCallback * getComputeBoundingBoxCallback() const
Get the const compute bound callback.
Definition Drawable:180
virtual unsigned int getGLObjectSizeHint() const
Return the estimated size of GLObjects (display lists/vertex buffer objects) that are associated with...
Definition Drawable:252
ref_ptr< DrawCallback > _drawCallback
Definition Drawable:544
void setUseVertexArrayObject(bool flag)
Set whether to use a local VertexArrayObject for this Drawable.
VertexArrayStateList _vertexArrayStateList
Definition Drawable:542
const CreateVertexArrayStateCallback * getCreateVertexArrayStateCallback() const
Get the const callback that overrides the default Drawable::createCreateVertexArrayStateImplementatio...
Definition Drawable:311
DrawableCullCallback CullCallback
Definition Drawable:346
BoundingBox _boundingBox
Definition Drawable:529
VertexArrayState * createVertexArrayState(RenderInfo &renderInfo) const
Create the VertexArrayState object used to track vertex array and vertex array object state.
Definition Drawable:315
ref_ptr< CreateVertexArrayStateCallback > _createVertexArrayStateCallback
Definition Drawable:545
GLuint & getDisplayList(unsigned int contextID) const
Return OpenGL display list for specified contextID.
Definition Drawable:222
friend class Node
Definition Drawable:523
bool getUseDisplayList() const
Return whether OpenGL display lists are being used for rendering.
Definition Drawable:219
void setUseDisplayList(bool flag)
When set to true, force the draw method to use OpenGL Display List for rendering.
DrawableEventCallback EventCallback
Definition Drawable:345
virtual BoundingBox computeBoundingBox() const
Compute the bounding box around Drawables's geometry.
BoundingBox _initialBoundingBox
Definition Drawable:527
void setInitialBound(const osg::BoundingBox &bbox)
Set the initial bounding volume to use when computing the overall bounding volume.
Definition Drawable:116
bool getUseVertexArrayObject() const
Return whether to use a local VertexArrayObject for this Drawable.
Definition Drawable:236
virtual void setThreadSafeRefUnref(bool threadSafe)
Set whether to use a mutex to ensure ref() and unref() are thread safe.
const BoundingBox & getBoundingBox() const
Get BoundingBox of Drawable.
Definition Drawable:130
static unsigned int getMinimumNumberOfDisplayListsToRetainInCache()
Get the minimum number of display lists to retain in the deleted display list cache.
GLObjectList _globjList
Definition Drawable:540
friend class Geode
Definition Drawable:524
void draw(RenderInfo &renderInfo) const
Draw OpenGL primitives.
Definition Drawable:549
virtual void setUseVertexBufferObjects(bool flag)
When set to true, ignore the setUseDisplayList() settings, and hints to the drawImplementation method...
virtual void accept(ConstAttributeFunctor &) const
Accept an AttributeFunctor and call its methods to tell it about the internal attributes that this Dr...
Definition Drawable:492
ComputeBoundingBoxCallback * getComputeBoundingBoxCallback()
Get the compute bound callback.
Definition Drawable:177
void setVertexArrayStateList(VertexArrayStateList &vasl)
Definition Drawable:324
bool _supportsDisplayList
Definition Drawable:533
virtual const Drawable * asDrawable() const
convert 'const this' into a const Drawable pointer if Object is a Drawable, otherwise return 0.
Definition Drawable:105
const BoundingSphere & getBound() const
Definition Drawable:121
bool _useDisplayList
Definition Drawable:534
virtual void setDrawCallback(DrawCallback *dc)
Set the DrawCallback which allows users to attach customize the drawing of existing Drawable object.
Definition Drawable:367
VertexArrayStateList & getVertexArrayStateList()
Definition Drawable:326
virtual BoundingSphere computeBound() const
Compute the bounding sphere around Drawables's geometry.
virtual void drawImplementation(RenderInfo &) const
drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL draw...
Definition Drawable:380
AttributeTypes
Definition Drawable:403
@ WEIGHTS
Definition Drawable:405
@ NORMALS
Definition Drawable:406
@ TEXTURE_COORDS_3
Definition Drawable:416
@ COLORS
Definition Drawable:407
@ TEXTURE_COORDS_2
Definition Drawable:415
@ TEXTURE_COORDS
Definition Drawable:412
@ TEXTURE_COORDS_1
Definition Drawable:414
@ TEXTURE_COORDS_5
Definition Drawable:418
@ TEXTURE_COORDS_4
Definition Drawable:417
@ TEXTURE_COORDS_0
Definition Drawable:413
@ ATTRIBUTE_7
Definition Drawable:411
@ FOG_COORDS
Definition Drawable:409
@ SECONDARY_COLORS
Definition Drawable:408
@ ATTRIBUTE_6
Definition Drawable:410
@ TEXTURE_COORDS_6
Definition Drawable:419
@ TEXTURE_COORDS_7
Definition Drawable:420
@ VERTICES
Definition Drawable:404
unsigned int AttributeType
Definition Drawable:400
void setCreateVertexArrayStateCallback(CreateVertexArrayStateCallback *cb)
Set the callback to override the default Drawable::createCreateVertexArrayStateImplementation().
Definition Drawable:305
bool _useVertexBufferObjects
Definition Drawable:536
const DrawCallback * getDrawCallback() const
Get the const DrawCallback.
Definition Drawable:373
void setSupportsDisplayList(bool flag)
Set the drawable so that it can or cannot be used in conjunction with OpenGL display lists.
MatrixList getWorldMatrices(const osg::Node *haltTraversalAtNode=0) const
Get the list of matrices that transform this node from local coordinates to world coordinates.
DrawableUpdateCallback UpdateCallback
Definition Drawable:344
static void setMinimumNumberOfDisplayListsToRetainInCache(unsigned int minimum)
Set the minimum number of display lists to retain in the deleted display list cache.
ref_ptr< ComputeBoundingBoxCallback > _computeBoundingBoxCallback
Definition Drawable:528
bool getUseVertexBufferObjects() const
Return whether OpenGL vertex buffer objects should be used when supported by OpenGL driver.
Definition Drawable:229
bool _supportsVertexBufferObjects
Definition Drawable:535
virtual void accept(PrimitiveIndexFunctor &) const
Accept a PrimitiveIndexFunctor and call its methods to tell it about the internal primitives that thi...
Definition Drawable:512
virtual Drawable * asDrawable()
Convert 'this' into a Drawable pointer if Object is a Drawable, otherwise return 0.
Definition Drawable:101
virtual VertexArrayState * createVertexArrayStateImplementation(RenderInfo &renderInfo) const
Implementation of Create the VertexArrayState object.
virtual void computeDataVariance()
Compute the DataVariance based on an assessment of callback etc.
Shape * getShape()
Get the Shape of the Drawable.
Definition Drawable:193
osg::buffered_value< GLuint > GLObjectList
Definition Drawable:539
Callback to allow users to override the default computation of bounding volume.
Definition Drawable:162
ComputeBoundingBoxCallback()
Definition Drawable:163
virtual BoundingBox computeBound(const osg::Drawable &) const
Definition Drawable:170
ComputeBoundingBoxCallback(const ComputeBoundingBoxCallback &org, const CopyOp ©op)
Definition Drawable:165
META_Object(osg, ComputeBoundingBoxCallback)
Callback class for overriding the default Drawable::createCreateVertexArrayStateImplementation().
Definition Drawable:288
CreateVertexArrayStateCallback()
Definition Drawable:289
CreateVertexArrayStateCallback(const CreateVertexArrayStateCallback &rhs, const CopyOp ©op)
Definition Drawable:291
META_Object(osg, CreateVertexArrayStateCallback)
virtual osg::VertexArrayState * createVertexArrayStateImplementation(osg::RenderInfo &renderInfo, const osg::Drawable *drawable) const
do customized createVertexArrayState .
Definition Drawable:297
Callback attached to an Drawable which allows the users to customize the drawing of an exist Drawable...
Definition Drawable:354
META_Object(osg, DrawCallback)
DrawCallback(const DrawCallback &org, const CopyOp ©op)
Definition Drawable:357
virtual void drawImplementation(osg::RenderInfo &, const osg::Drawable *) const
do customized draw code.
Definition Drawable:363
DrawCallback()
Definition Drawable:355
virtual void apply(AttributeType, unsigned int, Vec4 *)
Definition Drawable:441
virtual void apply(AttributeType, unsigned int, GLbyte *)
Definition Drawable:430
virtual void apply(AttributeType, unsigned int, float *)
Definition Drawable:438
virtual void apply(AttributeType, unsigned int, GLushort *)
Definition Drawable:435
virtual void apply(AttributeType, unsigned int, GLint *)
Definition Drawable:432
virtual void apply(AttributeType, unsigned int, GLuint *)
Definition Drawable:436
virtual void apply(AttributeType, unsigned int, Vec3d *)
Definition Drawable:446
virtual void apply(AttributeType, unsigned int, double *)
Definition Drawable:444
virtual void apply(AttributeType, unsigned int, Vec4ub *)
Definition Drawable:442
virtual void apply(AttributeType, unsigned int, GLshort *)
Definition Drawable:431
virtual ~AttributeFunctor()
Definition Drawable:428
virtual void apply(AttributeType, unsigned int, Vec2 *)
Definition Drawable:439
virtual void apply(AttributeType, unsigned int, Vec2d *)
Definition Drawable:445
virtual void apply(AttributeType, unsigned int, Vec3 *)
Definition Drawable:440
virtual void apply(AttributeType, unsigned int, GLubyte *)
Definition Drawable:434
virtual void apply(AttributeType, unsigned int, Vec4d *)
Definition Drawable:447
virtual void apply(AttributeType, unsigned int, const Vec4d *)
Definition Drawable:483
virtual void apply(AttributeType, unsigned int, const GLushort *)
Definition Drawable:471
virtual ~ConstAttributeFunctor()
Definition Drawable:464
virtual void apply(AttributeType, unsigned int, const Vec4ub *)
Definition Drawable:478
virtual void apply(AttributeType, unsigned int, const GLshort *)
Definition Drawable:467
virtual void apply(AttributeType, unsigned int, const Vec2 *)
Definition Drawable:475
virtual void apply(AttributeType, unsigned int, const Vec3d *)
Definition Drawable:482
virtual void apply(AttributeType, unsigned int, const float *)
Definition Drawable:474
virtual void apply(AttributeType, unsigned int, const Vec3 *)
Definition Drawable:476
virtual void apply(AttributeType, unsigned int, const GLbyte *)
Definition Drawable:466
virtual void apply(AttributeType, unsigned int, const double *)
Definition Drawable:480
virtual void apply(AttributeType, unsigned int, const GLint *)
Definition Drawable:468
virtual void apply(AttributeType, unsigned int, const GLubyte *)
Definition Drawable:470
virtual void apply(AttributeType, unsigned int, const Vec4 *)
Definition Drawable:477
virtual void apply(AttributeType, unsigned int, const Vec2d *)
Definition Drawable:481
virtual void apply(AttributeType, unsigned int, const GLuint *)
Definition Drawable:472
void applyArray(Drawable::AttributeType type, Array *array)
Definition Drawable:649
virtual void apply(Vec3dArray &array)
Definition Drawable:645
Drawable::AttributeFunctor & _af
Definition Drawable:661
AttributeFunctorArrayVisitor(Drawable::AttributeFunctor &af)
Definition Drawable:626
virtual void apply(Vec4dArray &array)
Definition Drawable:646
virtual void apply(UByteArray &array)
Definition Drawable:635
virtual ~AttributeFunctorArrayVisitor()
Definition Drawable:630
virtual void apply(ByteArray &array)
Definition Drawable:632
virtual void apply(UIntArray &array)
Definition Drawable:637
AttributeFunctorArrayVisitor & operator=(const AttributeFunctorArrayVisitor &)
Definition Drawable:660
virtual void apply(ShortArray &array)
Definition Drawable:633
virtual void apply(IntArray &array)
Definition Drawable:634
virtual void apply(Vec2dArray &array)
Definition Drawable:644
Drawable::AttributeType _type
Definition Drawable:662
virtual void apply(DoubleArray &array)
Definition Drawable:643
virtual void apply(FloatArray &array)
Definition Drawable:639
virtual void apply(Vec4Array &array)
Definition Drawable:642
virtual void apply(Vec3Array &array)
Definition Drawable:641
virtual void apply(Vec2Array &array)
Definition Drawable:640
virtual void apply(Vec4ubArray &array)
Definition Drawable:638
virtual void apply(UShortArray &array)
Definition Drawable:636
Drawable::ConstAttributeFunctor & _af
Definition Drawable:705
virtual void apply(const Vec2dArray &array)
Definition Drawable:687
ConstAttributeFunctorArrayVisitor(Drawable::ConstAttributeFunctor &af)
Definition Drawable:669
virtual void apply(const FloatArray &array)
Definition Drawable:682
virtual void apply(const Vec3dArray &array)
Definition Drawable:688
virtual void apply(const UByteArray &array)
Definition Drawable:678
virtual void apply(const Vec4dArray &array)
Definition Drawable:689
virtual void apply(const Vec2Array &array)
Definition Drawable:683
void applyArray(Drawable::AttributeType type, const Array *array)
Definition Drawable:692
virtual ~ConstAttributeFunctorArrayVisitor()
Definition Drawable:673
virtual void apply(const UIntArray &array)
Definition Drawable:680
virtual void apply(const IntArray &array)
Definition Drawable:677
virtual void apply(const DoubleArray &array)
Definition Drawable:686
virtual void apply(const UShortArray &array)
Definition Drawable:679
ConstAttributeFunctorArrayVisitor & operator=(const ConstAttributeFunctorArrayVisitor &)
Definition Drawable:703
virtual void apply(const ShortArray &array)
Definition Drawable:676
Drawable::AttributeType _type
Definition Drawable:706
virtual void apply(const Vec4ubArray &array)
Definition Drawable:681
virtual void apply(const ByteArray &array)
Definition Drawable:675
virtual void apply(const Vec3Array &array)
Definition Drawable:684
virtual void apply(const Vec4Array &array)
Definition Drawable:685
size_type size() const
Definition MixinVector:92
const_reference front() const
Definition MixinVector:138
bool empty() const
Definition MixinVector:91
Base class for all internal nodes in the scene graph.
Definition Node:72
void dirtyBound()
Mark this node's bounding sphere dirty.
bool _boundingSphereComputed
Definition Node:497
BoundingSphere _boundingSphere
Definition Node:496
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
@ DYNAMIC
Definition Object:218
DataVariance getDataVariance() const
Get the data variance of this object.
Definition Object:231
A PrimitiveFunctor is used (in conjunction with osg::Drawable::accept (PrimitiveFunctor&)) to get acc...
Definition PrimitiveSet:54
Definition PrimitiveSet:103
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
State * getState()
Definition RenderInfo:58
unsigned int getContextID() const
Definition RenderInfo:55
Base class for all shape types.
Definition Shape:49
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
bool useVertexBufferObject(bool useVBO) const
Definition State:790
VertexArrayState * getCurrentVertexArrayState() const
Get the CurrentVetexArrayState object that take which vertex arrays are bound.
Definition State:547
bool useVertexArrayObject(bool useVAO) const
Definition State:793
void bindVertexArrayObject(const VertexArrayState *vas)
Definition State:633
Proxy helper class for applyig a VertexArrayState in a local scope, with the preivous value being res...
Definition State:537
General purpose double pair, uses include representation of texture coordinates.
Definition Vec2d:29
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
General purpose double quad.
Definition Vec4d:29
General purpose float quad.
Definition Vec4ub:28
Definition VertexArrayState:25
void setRequiresSetArrays(bool flag)
Definition VertexArrayState:176
Definition VertexArrayState:219
#define OSG_EXPORT
Definition Export:39