summaryrefslogtreecommitdiff
path: root/src/render/gl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/gl.h')
-rw-r--r--src/render/gl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/render/gl.h b/src/render/gl.h
index e4e2d5a..dfb76b3 100644
--- a/src/render/gl.h
+++ b/src/render/gl.h
@@ -9,6 +9,7 @@
typedef struct GL_FONT *PGL_FONT;
typedef struct GL_DATA *PGL_DATA;
+typedef void(*GL_RESIZE_REPAINT_CB)( void* userdata );
struct VERTEX {
VEC2 pos;
@@ -71,6 +72,11 @@ typedef struct GL_DATA {
MAT4* proj_matrix;
GLuint vao;
+
+ GL_RESIZE_REPAINT_CB resize_repaint_cb{};
+ void* resize_repaint_userdata{};
+ U8 resize_repaint_active{};
+ U8 window_constraint_active{};
} *PGL_DATA;
GL_DATA* gl_instance();
@@ -79,6 +85,7 @@ void gl_destroy( GL_DATA* gl );
void gl_gen_buffers( GL_DATA* gl );
STAT gl_beginframe( GL_DATA* gl );
STAT gl_endframe( GL_DATA* gl );
+STAT gl_poll_events( GL_DATA* gl );
STAT gl_shader_compile( GL_DATA* gl, GL_SHADER_DEF* shader );
void gl_shader_destroy( GL_DATA* gl, GL_SHADER_DEF* shader );
GL_SHADER_PROGRAM* gl_program_create( GL_DATA* gl, const char* name, U32 size = sizeof(GL_SHADER_PROGRAM) );
@@ -89,6 +96,8 @@ GL_TEX2D* gl_texture_from_file( GL_DATA* gl, const char* name );
GL_TEX2D* gl_texture_from_bitmap( GL_DATA* gl, const char* name, U8* bitmap, U32 width, U32 height );
void gl_texture_destroy( GL_DATA* gl, GL_TEX2D* tex );
void gl_update_window( GL_DATA* gl, I32* size );
+void gl_sync_window_size( GL_DATA* gl );
+void gl_set_resize_repaint_callback( GL_DATA* gl, GL_RESIZE_REPAINT_CB cb, void* userdata );
void gl_set_clip( GL_DATA* gl, VEC2 start, VEC2 dim );
void gl_get_clip( GL_DATA* gl, VEC2* start, VEC2* dim );
void gl_set_viewport( GL_DATA* gl, VEC2 start, VEC2 dim );