summaryrefslogtreecommitdiff
path: root/src/render/gl_2d.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/gl_2d.h')
-rw-r--r--src/render/gl_2d.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/render/gl_2d.h b/src/render/gl_2d.h
new file mode 100644
index 0000000..9830516
--- /dev/null
+++ b/src/render/gl_2d.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "gl.h"
+
+extern GL_SHADER_PROGRAM* gl_2d_init( GL_DATA* gl, VEC2 screensize, const char* shadername );
+
+void gl_polygon( GL_SHADER_PROGRAM* gl2d, VERTEX* vertices, U32 vertices_count );
+void gl_textured_polygon(
+ GL_SHADER_PROGRAM* gl2d,
+ VERTEX* vertices,
+ U32 vertices_count,
+ GL_TEX2D* tex
+);
+
+extern void gl_2d_line( GL_SHADER_PROGRAM* gl2d, VEC2 start, VEC2 end, CLR col );
+extern void gl_2d_rect( GL_SHADER_PROGRAM* gl2d, VEC2 origin, VEC2 dimensions, CLR col );
+extern void gl_2d_frect( GL_SHADER_PROGRAM* gl2d, VEC2 origin, VEC2 dimensions, CLR col );
+extern void gl_2d_circle( GL_SHADER_PROGRAM* gl2d, VEC2 origin, F32 radius, CLR col, U32 res = 48 );
+extern void gl_2d_fcircle( GL_SHADER_PROGRAM* gl2d, VEC2 origin, F32 radius, CLR col, U32 res = 48 );
+extern void gl_2d_textured_frect(
+ GL_SHADER_PROGRAM* gl2d,
+ VEC2 origin,
+ VEC2 dim,
+ GL_TEX2D* texture,
+ CLR col = { 1.f, 1.f, 1.f, 1.f },
+ VEC2* uv = 0,
+ F32 rotation = 0.F
+);