indexed drawing and index buffers
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
#include "utils/gryphn_error_code.h"
|
||||
#include <core/gryphn_handles.h>
|
||||
|
||||
typedef enum gnIndexType {
|
||||
GN_UINT16, GN_UINT32
|
||||
} gnIndexType;
|
||||
|
||||
typedef enum gnBufferType {
|
||||
GN_VERTEX_BUFFER = 0x00000001
|
||||
GN_VERTEX_BUFFER = 0x00000001f,
|
||||
GN_INDEX_BUFFER = 0x00000002f,
|
||||
} gnBufferType;
|
||||
|
||||
typedef enum gnBufferUsage {
|
||||
|
@@ -23,3 +23,6 @@ void gnCommandBindBuffer(gnCommandBufferHandle buffer, gnBufferHandle bufferToBi
|
||||
void gnCommandDraw(struct gnCommandBuffer_t* buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance) {
|
||||
buffer->commandPool->commandFunctions->_gnCommandDraw(buffer, vertexCount, firstVertex, instanceCount, firstInstance);
|
||||
}
|
||||
void gnCommandDrawIndexed(gnCommandBufferHandle buffer, gnIndexType type, int indexCount, int firstIndex, int vertexOffset, int instanceCount, int firstInstance) {
|
||||
buffer->commandPool->commandFunctions->_gnCommandDrawIndexed(buffer, type, indexCount, firstIndex, vertexOffset, instanceCount, firstInstance);
|
||||
}
|
||||
|
@@ -13,3 +13,4 @@ void gnCommandSetScissor(gnCommandBufferHandle buffer, gnScissor scissor);
|
||||
void gnCommandBindBuffer(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type);
|
||||
|
||||
void gnCommandDraw(gnCommandBufferHandle buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance);
|
||||
void gnCommandDrawIndexed(gnCommandBufferHandle buffer, gnIndexType type, int indexCount, int firstIndex, int vertexOffset, int instanceCount, int firstInstance);
|
||||
|
@@ -113,4 +113,5 @@ typedef struct gnCommandFunctions_t {
|
||||
|
||||
void (*_gnCommandBindBuffer)(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type);
|
||||
void (*_gnCommandDraw)(gnCommandBufferHandle buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance);
|
||||
void (*_gnCommandDrawIndexed)(gnCommandBufferHandle buffer, gnIndexType type, int indexCount, int firstIndex, int vertexOffset, int instanceCount, int firstInstance);
|
||||
} gnCommandFunctions;
|
||||
|
@@ -109,4 +109,5 @@ void gnLoadCommandFunctions(struct gnDynamicLibrary_t* lib, struct gnCommandFunc
|
||||
gnLoadDLLFunction(lib, functions->_gnCommandSetScissor, "gnCommandSetScissorFn");
|
||||
gnLoadDLLFunction(lib, functions->_gnCommandBindBuffer, "gnCommandBindBufferFn");
|
||||
gnLoadDLLFunction(lib, functions->_gnCommandDraw, "gnCommandDrawFn");
|
||||
gnLoadDLLFunction(lib, functions->_gnCommandDrawIndexed, "gnCommandDrawIndexedFn");
|
||||
}
|
||||
|
Reference in New Issue
Block a user