Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtOpenGL.QGLBuffer Class Reference

The QGLBuffer class provides functions for creating and managing GL buffer objects. More...

Inheritance diagram for QtOpenGL.QGLBuffer:
Collaboration diagram for QtOpenGL.QGLBuffer:

Public Types

enum  Access { ReadOnly = 35000, ReadWrite = 35002, WriteOnly = 35001 }
  More...
 
enum  Type { IndexBuffer = 34963, PixelPackBuffer = 35051, PixelUnpackBuffer = 35052, VertexBuffer = 34962 }
  More...
 
enum  UsagePattern {
  DynamicCopy = 35050, DynamicDraw = 35048, DynamicRead = 35049, StaticCopy = 35046,
  StaticDraw = 35044, StaticRead = 35045, StreamCopy = 35042, StreamDraw = 35040,
  StreamRead = 35041
}
  More...
 

Public Member Functions

 QGLBuffer ()
 
 
 QGLBuffer (QGLBuffer other)
 
 
 QGLBuffer (QGLBuffer.Type type)
 
 
virtual void CreateProxy ()
 
new void Allocate (int count)
 
 
new bool Bind ()
 
 
new uint BufferId ()
 
 
new bool Create ()
 
 
new void Destroy ()
 
 
new bool IsCreated ()
 
 
new void Release ()
 
 
new int Size ()
 
 
new QGLBuffer.Type type ()
 
 
new bool Unmap ()
 
 
new void Dispose ()
 

Static Public Member Functions

static void Release (QGLBuffer.Type type)
 
 

Protected Member Functions

 QGLBuffer (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new QGLBuffer.UsagePattern usagePattern [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

The QGLBuffer class provides functions for creating and managing GL buffer objects.

Buffer objects are created in the GL server so that the client application can avoid uploading vertices, indices, texture image data, etc every time they are needed.

QGLBuffer objects can be copied around as a reference to the underlying GL buffer object:

QGLBuffer buffer1(QGLBuffer::IndexBuffer);

buffer1.create();

QGLBuffer buffer2 = buffer1;

QGLBuffer performs a shallow copy when objects are copied in this manner, but does not implement copy-on-write semantics. The original object will be affected whenever the copy is modified.

Member Enumeration Documentation

This enum defines the access mode for QGLBuffer::map().

Enumerator:
ReadOnly 

The buffer will be mapped for reading only.

ReadWrite 

The buffer will be mapped for reading and writing.

WriteOnly 

The buffer will be mapped for writing only.

This enum defines the type of GL buffer object to create with QGLBuffer.

Enumerator:
IndexBuffer 

Index buffer object for use with glDrawElements().

PixelPackBuffer 

Pixel pack buffer object for reading pixel data from the GL server (for example, with glReadPixels()). Not supported under OpenGL/ES.

PixelUnpackBuffer 

Pixel unpack buffer object for writing pixel data to the GL server (for example, with glTexImage2D()). Not supported under OpenGL/ES.

VertexBuffer 

Vertex buffer object for use when specifying vertex arrays.

This enum defines the usage pattern of a QGLBuffer object.

Enumerator:
DynamicCopy 

The data will be modified repeatedly and used many times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES.

DynamicDraw 

The data will be modified repeatedly and used many times for drawing operations.

DynamicRead 

The data will be modified repeatedly and used many times for reading data back from the GL server. Not supported under OpenGL/ES.

StaticCopy 

The data will be set once and used many times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES.

StaticDraw 

The data will be set once and used many times for drawing operations.

StaticRead 

The data will be set once and used many times for reading data back from the GL server. Not supported under OpenGL/ES.

StreamCopy 

The data will be set once and used a few times for reading data back from the GL server for use in further drawing operations. Not supported under OpenGL/ES.

StreamDraw 

The data will be set once and used a few times for drawing operations. Under OpenGL/ES 1.1 this is identical to StaticDraw.

StreamRead 

The data will be set once and used a few times for reading data back from the GL server. Not supported under OpenGL/ES.

Constructor & Destructor Documentation

QtOpenGL.QGLBuffer.QGLBuffer ( System.Type  dummy)
protected
QtOpenGL.QGLBuffer.QGLBuffer ( )

Constructs a new buffer object of type QGLBuffer::VertexBuffer.

Note: this constructor just creates the QGLBuffer instance. The actual buffer object in the GL server is not created until create() is called.

See also create().

QtOpenGL.QGLBuffer.QGLBuffer ( QGLBuffer  other)

Constructs a shallow copy of other.

Note: QGLBuffer does not implement copy-on-write semantics, so other will be affected whenever the copy is modified.

QtOpenGL.QGLBuffer.QGLBuffer ( QGLBuffer.Type  type)

Constructs a new buffer object of type QGLBuffer::VertexBuffer.

Note: this constructor just creates the QGLBuffer instance. The actual buffer object in the GL server is not created until create() is called.

See also create().

Member Function Documentation

new void QtOpenGL.QGLBuffer.Allocate ( int  count)

This is an overloaded function.

Allocates count bytes of space to the buffer. Any previous contents will be removed.

It is assumed that create() has been called on this buffer and that it has been bound to the current context.

See also create() and write().

new bool QtOpenGL.QGLBuffer.Bind ( )

Binds the buffer associated with this object to the current GL context. Returns false if binding was not possible, usually because type() is not supported on this GL implementation.

The buffer must be bound to the same QGLContext current when create() was called, or to another QGLContext that is sharing with it. Otherwise, false will be returned from this function.

See also release() and create().

new uint QtOpenGL.QGLBuffer.BufferId ( )

Returns the GL identifier associated with this buffer; zero if the buffer has not been created.

See also isCreated().

new bool QtOpenGL.QGLBuffer.Create ( )

Creates the buffer object in the GL server. Returns true if the object was created; false otherwise.

This function must be called with a current QGLContext. The buffer will be bound to and can only be used in that context (or any other context that is shared with it).

This function will return false if the GL implementation does not support buffers, or there is no current QGLContext.

See also isCreated(), allocate(), write(), and destroy().

virtual void QtOpenGL.QGLBuffer.CreateProxy ( )
virtual
new void QtOpenGL.QGLBuffer.Destroy ( )

Destroys this buffer object, including the storage being used in the GL server. All references to the buffer will become invalid.

new void QtOpenGL.QGLBuffer.Dispose ( )
new bool QtOpenGL.QGLBuffer.IsCreated ( )

Returns true if this buffer has been created; false otherwise.

See also create() and destroy().

new void QtOpenGL.QGLBuffer.Release ( )

Releases the buffer associated with this object from the current GL context.

This function must be called with the same QGLContext current as when bind() was called on the buffer.

See also bind().

static void QtOpenGL.QGLBuffer.Release ( QGLBuffer.Type  type)
static

Releases the buffer associated with this object from the current GL context.

This function must be called with the same QGLContext current as when bind() was called on the buffer.

See also bind().

new int QtOpenGL.QGLBuffer.Size ( )

Returns the size of the data in this buffer, for reading operations. Returns -1 if fetching the buffer size is not supported, or the buffer has not been created.

It is assumed that this buffer has been bound to the current context.

See also isCreated() and bind().

new QGLBuffer.Type QtOpenGL.QGLBuffer.type ( )

Returns the type of buffer represented by this object.

new bool QtOpenGL.QGLBuffer.Unmap ( )

Unmaps the buffer after it was mapped into the application's memory space with a previous call to map(). Returns true if the unmap succeeded; false otherwise.

It is assumed that this buffer has been bound to the current context, and that it was previously mapped with map().

This function is only supported under OpenGL/ES if the GL_OES_mapbuffer extension is present.

See also map().

Member Data Documentation

SmokeInvocation QtOpenGL.QGLBuffer.interceptor
protected

Property Documentation

virtual System.IntPtr QtOpenGL.QGLBuffer.SmokeObject
getset
new QGLBuffer.UsagePattern QtOpenGL.QGLBuffer.usagePattern
getset

Returns the usage pattern for this buffer object. The default value is StaticDraw.

Sets the usage pattern for this buffer object to value. This function must be called before allocate() or write().