X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=skaterift_imgui_dev.c;h=9618a044f95678befe1a4855384e8b7f7367cdac;hb=53597f45307d8a2120e3a0bbe71797b216e8750b;hp=2a3d282366b76c0304a23447cc16c15ee1dce1b4;hpb=2f44245bafbb83a2172e544a7a2965ae837186ed;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/skaterift_imgui_dev.c b/skaterift_imgui_dev.c index 2a3d282..9618a04 100644 --- a/skaterift_imgui_dev.c +++ b/skaterift_imgui_dev.c @@ -24,7 +24,8 @@ #include "vg/vg.h" static int skaterift_loaded = 0; -static char g_an_buffer[ 4096 ]; +static char g_an_buffer[ 96 ], + g_an_buffer2[ 96 ]; int main( int argc, char *argv[] ){ vg_mem.use_libc_malloc = 0; @@ -105,10 +106,29 @@ VG_STATIC void vg_gui(void){ vg_ui.wants_mouse = 1; - ui_rect panel; + ui_rect panel, content; ui_panel( window, panel ); - ui_enum( panel, "Select enum:", dropdown_options, 3, &dropdown_value ); - ui_checkbox( panel, "Toggly:", &checkbox_value ); + + static i32 page = 0; + ui_tabs( panel, content, + (const char *[]){ "Controls", "Other", "Nothing" }, 3, &page ); + + if( page == 0 ){ + ui_enum( content, "Select enum:", dropdown_options, 3, &dropdown_value ); + ui_checkbox( content, "Toggly:", &checkbox_value ); + ui_textbox( content, "Single:", g_an_buffer, 96, 1, 0, NULL ); + ui_textbox( content, "Multi:", g_an_buffer2, 96, 5, 0, NULL ); + + if( ui_button( content, "Hello" ) == 1 ){ + vg_success( "Ding!\n" ); + } + } + else if( page == 1 ){ + if( ui_button( content, "Another button" ) == 1 ){ + vg_error( "Press\n" ); + } + } + #if 0 ui_fill( window, ui_colour( k_ui_bg+1 ) );