checkbox imgui api
[vg.git] / vg_engine.c
index 0d8c01575ecb2fa9641948fbcf5984d587da4659..1723c70f3c26ce22e8a6856e4e0b9a31f828b04e 100644 (file)
@@ -105,10 +105,15 @@ void async_internal_complete( void *payload, u32 size )
    SDL_AtomicUnlock( &vg.sl_status );
 }
 
+#ifdef VG_CUSTOM_SHADERS
+void vg_auto_shader_register(void); /* created from codegen */
+#endif
+
 static void _vg_load_full( void *data )
 {
    vg_preload();
    vg_tex2d_replace_with_error_async( &vg.tex_missing );
+   vg_async_stall();
    vg_ui.tex_bg = vg.tex_missing;
 
    /* internal */
@@ -121,6 +126,9 @@ static void _vg_load_full( void *data )
    vg_loader_step( vg_profiler_init, NULL );
 
    /* client */
+#ifdef VG_CUSTOM_SHADERS
+   vg_auto_shader_register();
+#endif
    vg_load();
 
    vg_async_call( async_internal_complete, NULL, 0 );
@@ -879,7 +887,7 @@ void vg_settings_ui_header( ui_rect inout_panel, const char *name )
 bool vg_settings_apply_button( ui_rect inout_panel, bool validated )
 {
    ui_rect last_row;
-   ui_px height = (vg_ui.font->glyph_height + 18) * k_ui_scale;
+   ui_px height = (vg_ui.font->sy + 18) * k_ui_scale;
    ui_split( inout_panel, k_ui_axis_h, -height, k_ui_padding, 
              inout_panel, last_row );
 
@@ -1122,7 +1130,8 @@ static void vg_settings_gui(void)
    ui_rect quit_button;
    ui_split( title, k_ui_axis_v, title[2]-title[3], 2, title, quit_button );
 
-   if( ui_button_text( quit_button, "X", 1 ) == 1 ){
+   if( ui_button_text( quit_button, "X", 1 ) == k_ui_button_click )
+   {
       vg_settings_close();
       return;
    }
@@ -1190,3 +1199,7 @@ int AmdPowerXpressRequestHighPerformance = 1;
 #include "vg_rigidbody.c"
 #include "vg_rigidbody_view.c"
 #include "vg_shader.c"
+
+#ifdef VG_CUSTOM_SHADERS
+ #include "shaders/impl.c"
+#endif