VBO and EBO OpenGL-like objects to store vertex and other data which is used directly in the drawcalls.
More...
| enum | SRPPrimitive {
SRP_PRIM_POINTS
, SRP_PRIM_LINES
, SRP_PRIM_LINE_STRIP
, SRP_PRIM_LINE_LOOP
,
SRP_PRIM_TRIANGLES
, SRP_PRIM_TRIANGLE_STRIP
, SRP_PRIM_TRIANGLE_FAN
} |
| |
| typedef enum SRPPrimitive | SRPPrimitive |
| |
| typedef struct SRPVertexBuffer | SRPVertexBuffer |
| |
| typedef struct SRPIndexBuffer | SRPIndexBuffer |
| |
| SRPVertexBuffer * | srpNewVertexBuffer () |
| |
| void | srpFreeVertexBuffer (SRPVertexBuffer *this) |
| |
| void | srpVertexBufferCopyData (SRPVertexBuffer *this, size_t nBytesPerVertex, size_t nBytesData, const void *data) |
| |
| void | srpDrawVertexBuffer (const SRPVertexBuffer *this, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count) |
| |
| SRPIndexBuffer * | srpNewIndexBuffer () |
| |
| void | srpIndexBufferCopyData (SRPIndexBuffer *this, SRPType indicesType, size_t nBytesData, const void *data) |
| |
| void | srpFreeIndexBuffer (SRPIndexBuffer *this) |
| |
| void | srpDrawIndexBuffer (const SRPIndexBuffer *this, const SRPVertexBuffer *vb, const SRPFramebuffer *fb, const SRPShaderProgram *sp, SRPPrimitive primitive, size_t startIndex, size_t count) |
| |
VBO and EBO OpenGL-like objects to store vertex and other data which is used directly in the drawcalls.
◆ SRPIndexBuffer
◆ SRPPrimitive
◆ SRPVertexBuffer
Stores vertex data, similarly to VBO in OpenGL
◆ SRPPrimitive
Specifies primitives that can be drawn
- See also
- srpDrawVertexBuffer() srpDrawIndexBuffer()
| Enumerator |
|---|
| SRP_PRIM_POINTS | Draw points (0, 1, 2, 3, ..., n-1)
|
| SRP_PRIM_LINES | Draw lines (0-1, 2-3, ...) If non-even N of vertices, then the extra one is ignored)
|
| SRP_PRIM_LINE_STRIP | Draw lines (0-1, 1-2, ..., {n-2}-{n-1})
|
| SRP_PRIM_LINE_LOOP | Draw lines (0-1, 1-2, ..., {n-2}-{n-1}, {n-1}-0)
|
| SRP_PRIM_TRIANGLES | Draw triangles (0-1-2, 3-4-5, ...)
|
| SRP_PRIM_TRIANGLE_STRIP | Draw triangles (0-1-2, 1-2-3, 2-3-4, ...)
|
| SRP_PRIM_TRIANGLE_FAN | Draw triangles (0-1-2, 0-2-3, 0-3-4, ...)
|
◆ srpDrawIndexBuffer()
Draw vertices using both vertex and index buffers
- Parameters
-
| [in] | this | The index buffer to read the indices from |
| [in] | vb | The vertex buffer to read the vertex data from |
| [in] | fb | The framebuffer to draw to |
| [in] | sp | The shader program to use |
| [in] | primitive | Specifies the primitive to draw |
| [in] | startIndex | Specifies from what index buffer's index to start drawing |
| [in] | count | Specifies how many indices to draw |
◆ srpDrawVertexBuffer()
Draw vertices from vertex buffer
- Parameters
-
| [in] | this | The pointer to vertex buffer to read the vertex data from |
| [in] | fb | The framebuffer to draw to |
| [in] | sp | The shader program to use |
| [in] | primitive | Specifies the primitive to draw |
| [in] | startIndex | Specifies from what index to start drawing |
| [in] | count | Specifies how many vertices to draw |
◆ srpFreeIndexBuffer()
Free the index buffer
- Parameters
-
◆ srpFreeVertexBuffer()
Free the vertex buffer
- Parameters
-
◆ srpIndexBufferCopyData()
| void srpIndexBufferCopyData |
( |
SRPIndexBuffer * |
this, |
|
|
SRPType |
indicesType, |
|
|
size_t |
nBytesData, |
|
|
const void * |
data |
|
) |
| |
Copy the vertex data over to vertex buffer
- Parameters
-
| [in] | this | The pointer to index buffer |
| [in] | indicesType | The type of indices passed by data. Must be one of TYPE_UINT8, TYPE_UINT16, TYPE_UINT32, TYPE_UIN64 |
| [in] | nBytesData | The size of index data |
| [in] | data | The pointer to an array of indices of type indicesType |
◆ srpNewIndexBuffer()
Construct the index buffer
- Returns
- A pointer to constructed index buffer
◆ srpNewVertexBuffer()
◆ srpVertexBufferCopyData()
| void srpVertexBufferCopyData |
( |
SRPVertexBuffer * |
this, |
|
|
size_t |
nBytesPerVertex, |
|
|
size_t |
nBytesData, |
|
|
const void * |
data |
|
) |
| |
Copy the vertex data over to vertex buffer
- Parameters
-
| [in] | this | The pointer to vertex buffer |
| [in] | nBytesPerVertex | The size of one vertex, in bytes |
| [in] | nBytesData | The size of vertex data, in bytes |
| [in] | data | The pointer to vertex data |