Provides functions for setting up and using vertex-buffers.
More...
#include <kinc/global.h>
#include "usage.h"
#include "vertexstructure.h"
#include <kinc/backend/graphics4/vertexbuffer.h>
#include <stdbool.h>
Go to the source code of this file.
|
| KINC_FUNC void | kinc_g4_vertex_buffer_init (kinc_g4_vertex_buffer_t *buffer, int count, kinc_g4_vertex_structure_t *structure, kinc_g4_usage_t usage, int instance_data_step_rate) |
| | Allocate and initialize a vertex-buffer.
|
| KINC_FUNC void | kinc_g4_vertex_buffer_destroy (kinc_g4_vertex_buffer_t *buffer) |
| | Destroys a vertex-buffer.
|
| KINC_FUNC float * | kinc_g4_vertex_buffer_lock_all (kinc_g4_vertex_buffer_t *buffer) |
| | Locks all of a vertex-buffer to modify its contents.
|
| KINC_FUNC float * | kinc_g4_vertex_buffer_lock (kinc_g4_vertex_buffer_t *buffer, int start, int count) |
| | Locks part of a vertex-buffer to modify its contents.
|
| KINC_FUNC void | kinc_g4_vertex_buffer_unlock_all (kinc_g4_vertex_buffer_t *buffer) |
| | Unlock all of a vertex-buffer so the changed contents can be used.
|
| KINC_FUNC void | kinc_g4_vertex_buffer_unlock (kinc_g4_vertex_buffer_t *buffer, int count) |
| | Unlocks part of a vertex-buffer so the changed contents can be used.
|
| KINC_FUNC int | kinc_g4_vertex_buffer_count (kinc_g4_vertex_buffer_t *buffer) |
| | Returns the number of vertices in a buffer.
|
| KINC_FUNC int | kinc_g4_vertex_buffer_stride (kinc_g4_vertex_buffer_t *buffer) |
| | Returns the stride aka the size of one vertex of the buffer in bytes.
|
| KINC_FUNC void | kinc_g4_set_vertex_buffers (kinc_g4_vertex_buffer_t **buffers, int count) |
| | Sets vertex-buffers for the next draw-call.
|
| KINC_FUNC void | kinc_g4_set_vertex_buffer (kinc_g4_vertex_buffer_t *buffer) |
| | Sets a vertex-buffer for the next draw-call.
|
Provides functions for setting up and using vertex-buffers.
◆ kinc_g4_set_vertex_buffer()
| KINC_FUNC void kinc_g4_set_vertex_buffer |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Sets a vertex-buffer for the next draw-call.
- Parameters
-
◆ kinc_g4_set_vertex_buffers()
| KINC_FUNC void kinc_g4_set_vertex_buffers |
( |
kinc_g4_vertex_buffer_t ** | buffers, |
|
|
int | count ) |
Sets vertex-buffers for the next draw-call.
- Parameters
-
| buffers | The buffers to set |
| count | The number of buffers to set |
◆ kinc_g4_vertex_buffer_count()
| KINC_FUNC int kinc_g4_vertex_buffer_count |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Returns the number of vertices in a buffer.
- Parameters
-
| buffer | The buffer to figure out the number of vertices for |
- Returns
- The number of vertices
◆ kinc_g4_vertex_buffer_destroy()
| KINC_FUNC void kinc_g4_vertex_buffer_destroy |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Destroys a vertex-buffer.
- Parameters
-
| buffer | The buffer to destroy |
◆ kinc_g4_vertex_buffer_init()
| KINC_FUNC void kinc_g4_vertex_buffer_init |
( |
kinc_g4_vertex_buffer_t * | buffer, |
|
|
int | count, |
|
|
kinc_g4_vertex_structure_t * | structure, |
|
|
kinc_g4_usage_t | usage, |
|
|
int | instance_data_step_rate ) |
Allocate and initialize a vertex-buffer.
- Parameters
-
| buffer | The buffer to initialize |
| count | The number of vertices in the buffer |
| structure | The structure of the buffer |
| usage | A hint for how the buffer will be used |
| instance_data_step_rate | The step-rate for instanced-rendering - use 0 if instanced-rendering will not be used with this buffer |
◆ kinc_g4_vertex_buffer_lock()
| KINC_FUNC float * kinc_g4_vertex_buffer_lock |
( |
kinc_g4_vertex_buffer_t * | buffer, |
|
|
int | start, |
|
|
int | count ) |
Locks part of a vertex-buffer to modify its contents.
- Parameters
-
| buffer | The buffer to lock |
| start | The index of the first vertex to lock |
| count | The number of vertices to lock |
- Returns
- The contents of the buffer, starting at start
◆ kinc_g4_vertex_buffer_lock_all()
| KINC_FUNC float * kinc_g4_vertex_buffer_lock_all |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Locks all of a vertex-buffer to modify its contents.
- Parameters
-
- Returns
- The contents of the buffer
◆ kinc_g4_vertex_buffer_stride()
| KINC_FUNC int kinc_g4_vertex_buffer_stride |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Returns the stride aka the size of one vertex of the buffer in bytes.
- Parameters
-
| buffer | The buffer to figure out the stride for |
- Returns
- The stride of the buffer in bytes
◆ kinc_g4_vertex_buffer_unlock()
| KINC_FUNC void kinc_g4_vertex_buffer_unlock |
( |
kinc_g4_vertex_buffer_t * | buffer, |
|
|
int | count ) |
Unlocks part of a vertex-buffer so the changed contents can be used.
- Parameters
-
| buffer | The buffer to unlock |
| count | The number of vertices to unlock, starting from the start-vertex from the previous lock-call |
◆ kinc_g4_vertex_buffer_unlock_all()
| KINC_FUNC void kinc_g4_vertex_buffer_unlock_all |
( |
kinc_g4_vertex_buffer_t * | buffer | ) |
|
Unlock all of a vertex-buffer so the changed contents can be used.
- Parameters
-
| buffer | The buffer to unlock |