From abef6da56913f1c55528103e60a50451a39628b1 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sun, 16 Jun 2024 10:35:45 +0300 Subject: initial commit --- src/IsometricDrawer.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/IsometricDrawer.h (limited to 'src/IsometricDrawer.h') diff --git a/src/IsometricDrawer.h b/src/IsometricDrawer.h new file mode 100644 index 0000000..fd20711 --- /dev/null +++ b/src/IsometricDrawer.h @@ -0,0 +1,20 @@ +#ifndef CC_ISOMETRICDRAWER_H +#define CC_ISOMETRICDRAWER_H +#include "Core.h" +/* Draws 2D isometric blocks for the hotbar and inventory UIs. + Copyright 2014-2023 ClassiCube | Licensed under BSD-3 +*/ +struct VertexTextured; + +/* Maximum number of vertices used to draw a block in isometric way. */ +#define ISOMETRICDRAWER_MAXVERTICES 12 + +/* Sets up state to begin drawing blocks isometrically */ +void IsometricDrawer_BeginBatch(struct VertexTextured* vertices, int* state); +/* Buffers the vertices needed to draw the given block at the given position */ +void IsometricDrawer_AddBatch(BlockID block, float size, float x, float y); +/* Returns the number of buffered vertices */ +int IsometricDrawer_EndBatch(void); +/* Draws the buffered vertices */ +void IsometricDrawer_Render(int count, int offset, int* state); +#endif -- cgit 1.4.1-2-gfad0