Kore
Loading...
Searching...
No Matches
indexbuffer.h File Reference

Provides functions for setting up and using index-buffers. More...

#include <kinc/global.h>
#include <kinc/backend/graphics5/indexbuffer.h>

Go to the source code of this file.

Data Structures

struct  kinc_g5_index_buffer

Typedefs

typedef enum kinc_g5_index_buffer_format kinc_g5_index_buffer_format_t
typedef struct kinc_g5_index_buffer kinc_g5_index_buffer_t

Enumerations

enum  kinc_g5_index_buffer_format { KINC_G5_INDEX_BUFFER_FORMAT_32BIT , KINC_G5_INDEX_BUFFER_FORMAT_16BIT }

Functions

KINC_FUNC void kinc_g5_index_buffer_init (kinc_g5_index_buffer_t *buffer, int count, kinc_g5_index_buffer_format_t format, bool gpu_memory)
 Initializes an index-buffer.
KINC_FUNC void kinc_g5_index_buffer_destroy (kinc_g5_index_buffer_t *buffer)
 Destroys an index-buffer.
KINC_FUNC void * kinc_g5_index_buffer_lock_all (kinc_g5_index_buffer_t *buffer)
 Locks an index-buffer so its contents can be modified.
KINC_FUNC void * kinc_g5_index_buffer_lock (kinc_g5_index_buffer_t *buffer, int start, int count)
 Locks part of a vertex-buffer to modify its contents.
KINC_FUNC void kinc_g5_index_buffer_unlock_all (kinc_g5_index_buffer_t *buffer)
 Unlocks an index-buffer after locking it so the changed buffer-contents can be used.
KINC_FUNC void kinc_g5_index_buffer_unlock (kinc_g5_index_buffer_t *buffer, int count)
 Unlocks part of an index-buffer after locking so the changed buffer-contents can be used.
KINC_FUNC int kinc_g5_index_buffer_count (kinc_g5_index_buffer_t *buffer)
 Returns the number of indices in the buffer.

Detailed Description

Provides functions for setting up and using index-buffers.

Function Documentation

◆ kinc_g5_index_buffer_count()

KINC_FUNC int kinc_g5_index_buffer_count ( kinc_g5_index_buffer_t * buffer)

Returns the number of indices in the buffer.

Parameters
bufferThe buffer to query for its number of indices
Returns
The number of indices

◆ kinc_g5_index_buffer_destroy()

KINC_FUNC void kinc_g5_index_buffer_destroy ( kinc_g5_index_buffer_t * buffer)

Destroys an index-buffer.

Parameters
bufferThe buffer to destroy

◆ kinc_g5_index_buffer_init()

KINC_FUNC void kinc_g5_index_buffer_init ( kinc_g5_index_buffer_t * buffer,
int count,
kinc_g5_index_buffer_format_t format,
bool gpu_memory )

Initializes an index-buffer.

Parameters
bufferThe buffer to initialize
countThe number of indices to allocate for the buffer
gpu_memoryWhen true, the buffer will be uploaded to gpu-memory which will make it faster to use but slower to change

◆ kinc_g5_index_buffer_lock()

KINC_FUNC void * kinc_g5_index_buffer_lock ( kinc_g5_index_buffer_t * buffer,
int start,
int count )

Locks part of a vertex-buffer to modify its contents.

Parameters
bufferThe buffer to lock
startThe index of the first index to lock
countThe number of indices to lock
Returns
The contents of the index-buffer, starting at start, in uint32s or uint16s depending on the format provided when initializing

◆ kinc_g5_index_buffer_lock_all()

KINC_FUNC void * kinc_g5_index_buffer_lock_all ( kinc_g5_index_buffer_t * buffer)

Locks an index-buffer so its contents can be modified.

Parameters
bufferThe buffer to lock
Returns
The contents of the index-buffer in uint32s or uint16s depending on the format provided when initializing

◆ kinc_g5_index_buffer_unlock()

KINC_FUNC void kinc_g5_index_buffer_unlock ( kinc_g5_index_buffer_t * buffer,
int count )

Unlocks part of an index-buffer after locking so the changed buffer-contents can be used.

Parameters
bufferThe buffer to unlock
countThe number of indices to unlock, starting from the start-index from the previous lock-call

◆ kinc_g5_index_buffer_unlock_all()

KINC_FUNC void kinc_g5_index_buffer_unlock_all ( kinc_g5_index_buffer_t * buffer)

Unlocks an index-buffer after locking it so the changed buffer-contents can be used.

Parameters
bufferThe buffer to unlock