update for ui api
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift.c
index c7b8688e4023c6d881ee4eb509e6b1968646b881..f4fc3c1ad7fac68f96b8b79bf00a3a4441b60127 100644 (file)
@@ -738,21 +738,22 @@ void vg_render(void)
    gui_render_icons();
 }
 
-void vg_gui(void)
+void vg_gui( ui_context *ctx )
 {
    if( skaterift.op == k_async_op_clientloading ) return;
 
-   gui_draw();
+   gui_draw( ctx );
 
-   if( k_tools_mode ){
+   if( k_tools_mode )
+   {
       ui_rect null;
       ui_rect screen = { 0, 0, vg.window_x, vg.window_y };
       ui_rect panel = { 0, 0, 1000, 700 };
       ui_rect_center( screen, panel );
-      ui_capture_mouse( 1 );
+      ui_capture_mouse( ctx, 1 );
 
-      ui_fill( panel, ui_colour( k_ui_bg+1 ) );
-      ui_outline( panel, 1, ui_colour( k_ui_bg+7 ), 0 );
+      ui_fill( ctx, panel, ui_colour( ctx, k_ui_bg+1 ) );
+      ui_outline( ctx, panel, 1, ui_colour( ctx, k_ui_bg+7 ), 0 );
 
       ui_rect_pad( panel, (ui_px[2]){ 8, 8 } );
 
@@ -760,30 +761,32 @@ void vg_gui(void)
    }
 
    if( k_light_editor )
-      imgui_world_light_edit( world_current_instance() );
+      imgui_world_light_edit( ctx, world_current_instance() );
    
-   g_ui_ctx->tex_bg = gpipeline.fb_main->attachments[0].id;
-   render_fb_inverse_ratio( gpipeline.fb_main, g_ui_ctx->bg_inverse_ratio );
+   vg_ui.tex_bg = gpipeline.fb_main->attachments[0].id;
+   render_fb_inverse_ratio( gpipeline.fb_main, vg_ui.bg_inverse_ratio );
 
-   menu_gui();
-   player__im_gui();
+   menu_gui( ctx );
+   player__im_gui( ctx );
    world_instance *world = world_current_instance();
 
-   world_routes_imgui( world );
-   skaterift_replay_imgui();
-   workshop_form_gui();
-   render_view_framebuffer_ui();
-   remote_player_network_imgui( vg.pv );
+   world_routes_imgui( ctx, world );
+   skaterift_replay_imgui( ctx );
+   workshop_form_gui( ctx );
+   render_view_framebuffer_ui( ctx );
+   remote_player_network_imgui( ctx, vg.pv );
 
    if( menu_viewing_map() )
    {
-      remote_players_imgui_world( world_current_instance(), vg.pv, 2000.0f, 0 );
-      remote_players_imgui_lobby();
+      remote_players_imgui_world( ctx, world_current_instance(), 
+                                  vg.pv, 2000.0f, 0 );
+      remote_players_imgui_lobby( ctx );
    }
    else 
    {
-      remote_players_chat_imgui(); /* TODO: conditional */
-      remote_players_imgui_world( world_current_instance(), vg.pv, 100.0f, 1 );
+      remote_players_chat_imgui( ctx ); /* TODO: conditional */
+      remote_players_imgui_world( ctx, world_current_instance(), 
+                                  vg.pv, 100.0f, 1 );
    }
 }