Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://astro.uni-altai.ru/~aw/stellarium/api/classStelVertexBufferBackend.html
Дата изменения: Unknown Дата индексирования: Fri Feb 28 07:53:00 2014 Кодировка: Поисковые слова: comet tail |
Stellarium 0.12.3
|
Base class of all vertex buffer backends. More...
#include <StelVertexBufferBackend.hpp>
Public Member Functions | |
StelVertexBufferBackend (const QVector< StelVertexAttribute > &attributes) | |
Construct a StelVertexBufferBackend, specifying attributes of the vertex type. More... | |
virtual | ~StelVertexBufferBackend () |
Required to ensure that derived classes get properly deallocated. More... | |
virtual void | addVertex (const void *const vertexInPtr)=0 |
Add a new vertex to the buffer. More... | |
virtual void | getVertex (const int index, void *const vertexOutPtr) const =0 |
Get a vertex from the buffer. More... | |
virtual void | setVertex (const int index, const void *const vertexInPtr)=0 |
Rewrite a vertex in the buffer. More... | |
virtual void | lock ()=0 |
Lock the buffer. Must be called before drawing. More... | |
virtual void | unlock ()=0 |
Unlock the buffer. Must be called to modify the buffer after drawing. More... | |
virtual void | clear ()=0 |
Clear the buffer, removing all vertices. More... | |
void | validateVertexType (const int vertexSize) |
Assert that the user-specified (in StelVertexBuffer) vertex type is valid. More... | |
Protected Attributes | |
const Attributes | attributes |
Specifies layout of vertex attributes in the vertex type. More... | |
Base class of all vertex buffer backends.
This is where the vertex buffer logic is implemented.
The backend doesn't directly know the vertex type (since templating doesn't mix with virtual inheritance), so it works with raw (void) pointers.
Vertex format is described by the attributes data member. Each item in attributes specifies a vertex attribute (such as a position or normal), and these correspond to the data members of the user-specified vertex struct which is the template parameter of the StelVertexBuffer class.
StelVertexBufferBackend is always owned by a StelVertexBuffer and can't exist separately. Only the StelRenderer backend has direct access to StelVertexBufferBackend's implementation.
When the user asks StelRenderer to create a vertex buffer, the renderer backend first creates its own implementation of the vertex buffer backend, and then wraps it up in a StelVertexBuffer.
Definition at line 55 of file StelVertexBufferBackend.hpp.
|
inline |
Construct a StelVertexBufferBackend, specifying attributes of the vertex type.
Definition at line 87 of file StelVertexBufferBackend.hpp.
|
inlinevirtual |
Required to ensure that derived classes get properly deallocated.
Definition at line 93 of file StelVertexBufferBackend.hpp.
|
pure virtual |
Add a new vertex to the buffer.
StelVertexBuffer guarantees that when this is called, buffer is not locked and index is in range.
vertexInPtr | Pointer to the beginning of the vertex. Data members of the vertex must match vertex attributes of the buffer. |
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
pure virtual |
Clear the buffer, removing all vertices.
The backend implementation might reuse previously allocated storage after clearing, so calling clear() might be more efficient than destroying a buffer and then constructing a new one.
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
pure virtual |
Get a vertex from the buffer.
StelVertexBuffer guarantees that when this is called, buffer is not locked and index is in range.
index | Index of the vertex to read. |
vertexOutPtr | Pointer to the beginning of the output vertex. Data members of the vertex must match vertex attributes of the buffer. |
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
pure virtual |
Lock the buffer. Must be called before drawing.
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
pure virtual |
Rewrite a vertex in the buffer.
StelVertexBuffer guarantees that when this is called, buffer is not locked and index is in range.
index | Index of the vertex to set. |
vertexInPtr | Pointer to the beginning of the vertex that will rewrite the vertex in the buffer. Data members of the vertex must match vertex attributes of the buffer. |
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
pure virtual |
Unlock the buffer. Must be called to modify the buffer after drawing.
Implemented in StelQGLInterleavedArrayVertexBufferBackend, and StelQGLArrayVertexBufferBackend.
|
inline |
Assert that the user-specified (in StelVertexBuffer) vertex type is valid.
Definition at line 139 of file StelVertexBufferBackend.hpp.
|
protected |
Specifies layout of vertex attributes in the vertex type.
Definition at line 160 of file StelVertexBufferBackend.hpp.