About to start shaders

This commit is contained in:
2025-02-25 09:17:33 -06:00
parent af598552f4
commit 1f83690334
31 changed files with 1109 additions and 8 deletions

View File

@ -0,0 +1,61 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "duskgl.h"
typedef struct {
GLuint id;
size_t size;
} shaderbuffer_t;
/**
* Initializes a shader buffer.
*
* @param shaderBuffer The shader buffer to initialize.
* @param size The size of the buffer.
*/
void shaderBufferInit(
shaderbuffer_t *shaderBuffer,
const size_t size
);
/**
* Binds a shader buffer.
*
* @param shaderBuffer The shader buffer to bind.
*/
void shaderBufferBind(shaderbuffer_t *shaderBuffer);
/**
* Sets the data of a shader buffer.
*
* @param shaderBuffer The shader buffer to set the data of.
* @param data The data to set.
*/
void shaderBufferSetData(
shaderbuffer_t *shaderBuffer,
const void *data
);
/**
* Binds a shader buffer to a block.
*
* @param shaderBuffer The shader buffer to bind.
* @param blockIndex The block index to bind to.
*/
void shaderBufferBindToBlock(
shaderbuffer_t *shaderBuffer,
const GLuint blockIndex
);
/**
* Disposes of a shader buffer.
*
* @param shaderBuffer The shader buffer to dispose of.
*/
void shaderBufferDispose(shaderbuffer_t *shaderBuffer);