diff options
| author | kasull <qsullian@gmail.com> | 2026-03-01 20:18:08 -0500 |
|---|---|---|
| committer | kasull <qsullian@gmail.com> | 2026-03-01 20:18:08 -0500 |
| commit | 413ef78504278d37080b9b59a652e4bbd5e2a0fc (patch) | |
| tree | 67be817cf765725dd2d08c14b2d0ce8c12b20997 /src/render/gl.h | |
| parent | 71dd7fcccb45a54d85ae23a95a8a8905ed21fe15 (diff) | |
editor ui rework
add responsive editor relayout for window resize
rework header with back/save, view mode buttons, and 2d view type selector
add clipped, scrollable assets and contextual tool panels
simplify tool button wiring and repeated layout logic
simplify 2d top-down editor internals and shared grid update hooks
Diffstat (limited to 'src/render/gl.h')
| -rw-r--r-- | src/render/gl.h | 9 |
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 ); |
