50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "display/shader/shaderbuffer.h"
|
|
#include "display/tilesetgl.h"
|
|
|
|
#define TILESET_SHADER_DATA_BLOCK_NAME "b_Tilesets"
|
|
#define TILESET_UNIFORM_TEXTURES_NAME "u_TilesetTextures"
|
|
|
|
typedef struct {
|
|
uint32_t columns;
|
|
uint32_t rows;
|
|
uint32_t width;
|
|
uint32_t height;
|
|
} tilesetshaderdatatileset_t;
|
|
|
|
typedef struct {
|
|
tilesetshaderdatatileset_t tilesets[TILESET_SLOT_COUNT];
|
|
} tilesetshaderdata_t;
|
|
|
|
extern shaderbuffer_t TILESET_SHADER_DATA_BUFFER;
|
|
extern tilesetshaderdata_t TILESET_SHADER_DATA_DATA;
|
|
extern GLuint TILESET_SHADER_DATA_TEXTURES[];
|
|
|
|
/**
|
|
* Initializes the tileset buffer and data.
|
|
*/
|
|
void tilesetShaderDataInit();
|
|
|
|
/**
|
|
* Updates the tileset buffer with the current data.
|
|
*/
|
|
void tilesetShaderDataUpdate();
|
|
|
|
/**
|
|
* Binds the tileset textures to the given uniform.
|
|
*
|
|
* @param uniform The uniform to bind the textures to.
|
|
*/
|
|
void tilesetShaderTexturesBind(const GLuint uniform);
|
|
|
|
/**
|
|
* Destroys the tileset buffer.
|
|
*/
|
|
void tilesetShaderDataDispose(); |