summaryrefslogtreecommitdiff
path: root/src/render/gl.h
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-04 00:51:18 +0100
committeraura <nw@moneybot.cc>2026-03-04 00:51:18 +0100
commit890bea19359649695df1b618a41ce580cf3dfbda (patch)
tree8bc10ae4e613b0ad57fae9a68cec38c7d59cf067 /src/render/gl.h
parent61aea7311c2e1af78fd9da544499f2198f2da1dd (diff)
parentbe91342733fd56d1e7bafe72e82a8ac4dc67b79d (diff)
Merge branch 'ui-rework'
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 );