summary refs log tree commit diff
path: root/src/IsometricDrawer.h
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2024-06-16 10:35:45 +0300
committerWlodekM <[email protected]>2024-06-16 10:35:45 +0300
commitabef6da56913f1c55528103e60a50451a39628b1 (patch)
treeb3c8092471ecbb73e568cd0d336efa0e7871ee8d /src/IsometricDrawer.h
initial commit
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