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

Public Member Functions | |
virtual void | CopyInto (const void *data, size_t elementCount, size_t elemOffset=0) |
Copy data to the render buffer. | |
virtual csRenderBufferType | GetBufferType () const |
Get type of buffer (static/dynamic). | |
virtual int | GetComponentCount () const |
Gets the number of components per element. | |
virtual csRenderBufferComponentType | GetComponentType () const |
Gets the component type (float, int, etc). | |
virtual size_t | GetElementCount () const |
Number of elements in a buffer. | |
virtual size_t | GetElementDistance () const |
Get the distance between two elements (in bytes, includes stride). | |
virtual iRenderBuffer * | GetMasterBuffer () const |
Get the master buffer in case this is an interleaved buffer. | |
virtual size_t | GetOffset () const |
Get the offset of the buffer (in bytes). | |
virtual size_t | GetRangeEnd () const |
The highest index contained in this buffer, only valid for index buffers. | |
virtual size_t | GetRangeStart () const |
The lowest index contained in this buffer, only valid for index buffers. | |
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 uint | GetVersion () |
Get version. | |
virtual bool | IsIndexBuffer () const |
Whether the buffer is an index buffer. | |
virtual bool | IsMasterBuffer () |
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 | ~csRenderBuffer () |
Destructor. | |
Static Public Member Functions | |
static csRef< iRenderBuffer > | CreateIndexRenderBuffer (size_t elementCount, csRenderBufferType type, csRenderBufferComponentType componentType, size_t rangeStart, size_t rangeEnd, bool copy=true) |
Create an index buffer. | |
static 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. | |
static csRef< iRenderBuffer > | CreateRenderBuffer (size_t elementCount, csRenderBufferType type, csRenderBufferComponentType componentType, uint componentCount, bool copy=true) |
Create a render buffer. | |
static csRenderBufferName | GetBufferNameFromDescr (const char *name) |
Retrieve the buffer name for a "friendly" buffer description. | |
static const char * | GetDescrFromBufferName (csRenderBufferName bufferName) |
Utility to retrieve the "friendly" string name of a buffer description, e.g. | |
Public Attributes | |
SCF_DECLARE_IBASE | |
Protected Member Functions | |
csRenderBuffer (size_t size, csRenderBufferType type, csRenderBufferComponentType componentType, uint componentCount, size_t rangeStart, size_t rangeEnd, bool copy) | |
Constructor. | |
Protected Attributes | |
unsigned char * | buffer |
buffer holding the data | |
size_t | bufferSize |
datatype for each component | |
csRenderBufferType | bufferType |
hint about main usage | |
uint | compCount |
number of components per element | |
csRenderBufferComponentType | comptype |
datatype for each component | |
bool | doCopy |
should we copy data, or just use supplied buffer | |
bool | doDelete |
if buffer should be deleted on deallocation | |
bool | isIndex |
if this is index-buffer | |
bool | isLocked |
currently locked? (to prevent recursive locking) | |
csRenderBufferLockType | lastLock |
last type of lock used | |
csRef< iRenderBuffer > | masterBuffer |
size_t | offset |
offset from buffer start to data | |
size_t | rangeEnd |
range start for index-buffer | |
size_t | rangeStart |
range start for index-buffer | |
size_t | stride |
buffer stride | |
unsigned int | version |
modification number |
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 98 of file renderbuffer.h. |
|
Gets the number of components per element.
Implements iRenderBuffer. Definition at line 86 of file renderbuffer.h. |
|
Gets the component type (float, int, etc).
Implements iRenderBuffer. Definition at line 92 of file renderbuffer.h. |
|
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 115 of file renderbuffer.h. References csRenderBufferComponentSizes. |
|
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 135 of file renderbuffer.h. |
|
Get the offset of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 121 of file renderbuffer.h. |
|
The highest index contained in this buffer, only valid for index buffers.
Implements iRenderBuffer. Definition at line 145 of file renderbuffer.h. |
|
The lowest index contained in this buffer, only valid for index buffers.
Implements iRenderBuffer. Definition at line 143 of file renderbuffer.h. |
|
Get the size of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 104 of file renderbuffer.h. |
|
Get the stride of the buffer (in bytes).
Implements iRenderBuffer. Definition at line 110 of file renderbuffer.h. |
|
Get version.
Implements iRenderBuffer. Definition at line 125 of file renderbuffer.h. |
|
Whether the buffer is an index buffer.
Implements iRenderBuffer. Definition at line 140 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 258 of file renderbuffer.h. |
|
datatype for each component
Definition at line 232 of file renderbuffer.h. |
|
hint about main usage
Definition at line 227 of file renderbuffer.h. |
|
number of components per element
Definition at line 234 of file renderbuffer.h. |
|
datatype for each component
Definition at line 229 of file renderbuffer.h. |
|
should we copy data, or just use supplied buffer
Definition at line 249 of file renderbuffer.h. |
|
if buffer should be deleted on deallocation
Definition at line 251 of file renderbuffer.h. |
|
if this is index-buffer
Definition at line 255 of file renderbuffer.h. |
|
currently locked? (to prevent recursive locking)
Definition at line 253 of file renderbuffer.h. |
|
last type of lock used
Definition at line 260 of file renderbuffer.h. |
|
offset from buffer start to data
Definition at line 238 of file renderbuffer.h. |
|
range start for index-buffer
Definition at line 243 of file renderbuffer.h. |
|
range start for index-buffer
Definition at line 241 of file renderbuffer.h. |
|
buffer stride
Definition at line 236 of file renderbuffer.h. |
|
modification number
Definition at line 246 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.4.4