summary refs log tree commit diff
path: root/src/IsometricDrawer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/IsometricDrawer.h')
-rw-r--r--src/IsometricDrawer.h20
1 files changed, 20 insertions, 0 deletions
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