csRenderBuffer Class Reference
[Graphics]
Basic renderbuffer for OpenGL renderer.
More...
#include <csgfx/renderbuffer.h>
Inheritance diagram for csRenderBuffer:

Public Member Functions | |
virtual | ~csRenderBuffer () |
Destructor. | |
virtual void * | Lock (csRenderBufferLockType lockType) |
Lock the buffer to allow writing and give us a pointer to the data. | |
virtual void | Release () |
Releases the buffer. After this all writing to the buffer is illegal. | |
virtual void | CopyInto (const void *data, size_t elementCount, size_t elemOffset=0) |
Copy data to the render buffer. | |
virtual int | GetComponentCount () const |
Gets the number of components per element. | |
virtual csRenderBufferComponentType | GetComponentType () const |
Gets the component type (float, int, etc). | |
virtual csRenderBufferType | GetBufferType () const |
Get type of buffer (static/dynamic). | |
virtual size_t | GetSize () const |
Get the size of the buffer (in bytes). | |
virtual size_t | GetStride () const |
Get the stride of the buffer (in bytes). | |
virtual size_t | GetElementDistance () const |
Get the distance between two elements (in bytes, includes stride). | |
virtual size_t | GetOffset () const |
Get the offset of the buffer (in bytes). | |
virtual uint | GetVersion () |
Get version. | |
virtual iRenderBuffer * | GetMasterBuffer () const |
Get the master buffer in case this is an interleaved buffer. | |
virtual bool | IsIndexBuffer () const |
Whether the buffer is an index buffer. | |
virtual size_t | GetRangeStart () const |
The lowest index contained in this buffer, only valid for index buffers. | |
virtual size_t | GetRangeEnd () const |
The highest index contained in this buffer, only valid for index buffers. | |
virtual size_t | GetElementCount () const |
Number of elements in a buffer. | |
Static Public Member Functions | |
csRef< iRenderBuffer > | CreateRenderBuffer (size_t elementCount, csRenderBufferType type, csRenderBufferComponentType componentType, uint componentCount, bool copy=true) |
Create a render buffer. | |
csRef< iRenderBuffer > | CreateIndexRenderBuffer (size_t elementCount, csRenderBufferType type, csRenderBufferComponentType componentType, size_t rangeStart, size_t rangeEnd, bool copy=true) |
Create an index buffer. | |
csRef< iRenderBuffer > | CreateInterleavedRenderBuffers (size_t elementCount, csRenderBufferType type, uint count, const csInterleavedSubBufferOptions *elements, csRef< iRenderBuffer > *buffers) |
Create an interleaved renderbuffer (You would use this then set stride to determine offset and stride of the interleaved buffer. | |
const char * | GetDescrFromBufferName (csRenderBufferName bufferName) |
Utility to retrieve the "friendly" string name of a buffer description, e.g. | |
csRenderBufferName | GetBufferNameFromDescr (const char *name) |
Retrieve the buffer name for a "friendly" buffer description. | |
Protected Member Functions | |
csRenderBuffer (size_t size, csRenderBufferType type, csRenderBufferComponentType componentType, uint componentCount, size_t rangeStart, size_t rangeEnd, bool copy) | |
Constructor. | |
Protected Attributes | |
csRenderBufferType | bufferType |
hint about main usage | |
csRenderBufferComponentType | comptype |
datatype for each component | |
size_t | bufferSize |
datatype for each component | |
uint | compCount |
number of components per element | |
size_t | stride |
buffer stride | |
size_t | offset |
offset from buffer start to data | |
size_t | rangeStart |
range start for index-buffer | |
size_t | rangeEnd |
range start for index-buffer | |
unsigned int | version |
modification number | |
bool | doCopy |
should we copy data, or just use supplied buffer | |
bool | doDelete |
if buffer should be deleted on deallocation | |
bool | isLocked |
currently locked? (to prevent recursive locking) | |
bool | isIndex |
if this is index-buffer | |
unsigned char * | buffer |
buffer holding the data | |
csRenderBufferLockType | lastLock |
last type of lock used |
Detailed Description
Basic renderbuffer for OpenGL renderer.
Definition at line 51 of file renderbuffer.h.
Constructor & Destructor Documentation
|
Constructor.
|
|
Destructor.
|
Member Function Documentation
|
Copy data to the render buffer.
Implements iRenderBuffer. |
|
Create an index buffer.
|
|
Create an interleaved renderbuffer (You would use this then set stride to determine offset and stride of the interleaved buffer.
static const csInterleavedSubBufferOptions interleavedElements[2] = {{CS_BUFCOMP_FLOAT, 3}, {CS_BUFCOMP_FLOAT, 2}}; csRef<iRenderBuffer> buffers[2]; csRenderBuffer::CreateInterleavedRenderBuffers (num_verts, CS_BUF_STATIC, 2, interleavedElements, buffers); csRef<iRenderBuffer> vertex_buffer = buffers[0]; csRef<iRenderBuffer> texel_buffer = buffers[1]; |
|
Create a render buffer.
|
|
Retrieve the buffer name for a "friendly" buffer description. Can be used to parse e.g. shader files. |
|
Get type of buffer (static/dynamic).
Implements iRenderBuffer. Definition at line 96 of file renderbuffer.h. References csRenderBufferType. |
|
Gets the number of components per element.
Implements iRenderBuffer. Definition at line 84 of file renderbuffer.h. |
|
Gets the component type (float, int, etc).
Implements iRenderBuffer. Definition at line 90 of file renderbuffer.h. References csRenderBufferComponentType. |
|
Utility to retrieve the "friendly" string name of a buffer description, e.g. "position" for CS_BUFFER_POSITION. |
|
Number of elements in a buffer.
Implements iRenderBuffer. |
|
Get the distance between two elements (in bytes, includes stride).
Implements iRenderBuffer. Definition at line 113 of file renderbuffer.h. |
|
Get the master buffer in case this is an interleaved buffer. The master buffer is the buffer that actually holds the data; while it can be used to retrieve or set data, it must not be used for actual rendering. Use the interleaved buffers instead. Implements iRenderBuffer. Definition at line 133 of file renderbuffer.h. |
|
Get the offset of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 119 of file renderbuffer.h. |
|
The highest index contained in this buffer, only valid for index buffers.
Implements iRenderBuffer. Definition at line 143 of file renderbuffer.h. |
|
The lowest index contained in this buffer, only valid for index buffers.
Implements iRenderBuffer. Definition at line 141 of file renderbuffer.h. |
|
Get the size of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 102 of file renderbuffer.h. |
|
Get the stride of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 108 of file renderbuffer.h. |
|
Get version.
Implements iRenderBuffer. Definition at line 123 of file renderbuffer.h. References uint. |
|
Whether the buffer is an index buffer.
Implements iRenderBuffer. Definition at line 138 of file renderbuffer.h. |
|
Lock the buffer to allow writing and give us a pointer to the data. The pointer will be (void*)-1 if there was some error.
Implements iRenderBuffer. |
|
Releases the buffer. After this all writing to the buffer is illegal.
Implements iRenderBuffer. |
Member Data Documentation
|
buffer holding the data
Definition at line 250 of file renderbuffer.h. |
|
datatype for each component
Definition at line 224 of file renderbuffer.h. |
|
hint about main usage
Definition at line 219 of file renderbuffer.h. |
|
number of components per element
Definition at line 226 of file renderbuffer.h. |
|
datatype for each component
Definition at line 221 of file renderbuffer.h. |
|
should we copy data, or just use supplied buffer
Definition at line 241 of file renderbuffer.h. |
|
if buffer should be deleted on deallocation
Definition at line 243 of file renderbuffer.h. |
|
if this is index-buffer
Definition at line 247 of file renderbuffer.h. |
|
currently locked? (to prevent recursive locking)
Definition at line 245 of file renderbuffer.h. |
|
last type of lock used
Definition at line 252 of file renderbuffer.h. |
|
offset from buffer start to data
Definition at line 230 of file renderbuffer.h. |
|
range start for index-buffer
Definition at line 235 of file renderbuffer.h. |
|
range start for index-buffer
Definition at line 233 of file renderbuffer.h. |
|
buffer stride
Definition at line 228 of file renderbuffer.h. |
|
modification number
Definition at line 238 of file renderbuffer.h. |
The documentation for this class was generated from the following file:
- csgfx/renderbuffer.h
Generated for Crystal Space by doxygen 1.3.9.1