X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg.h;fp=vg%2Fvg.h;h=c792527fce16a2c2ed6086f79965f19017578dae;hb=499bcabb125cdf2618a6be89ccade08b007254f3;hp=2c86d4d3b596749469f7550c84947acca1118f6e;hpb=294ad22bc27eae2ec8a1cbea97d08a2d45b554e9;p=fishladder.git diff --git a/vg/vg.h b/vg/vg.h index 2c86d4d..c792527 100644 --- a/vg/vg.h +++ b/vg/vg.h @@ -248,23 +248,13 @@ static void vg_init( int argc, char *argv[], const char *window_name ) { ui_begin( &ui_global_ctx, vg_window_x, vg_window_y ); - - // TODO: Find a more elegent form for this - int mouse_state = 0; - if( vg_get_button( "primary" ) ) mouse_state = 2; - if( vg_get_button_down( "primary" ) ) mouse_state = 1; - if( vg_get_button_up( "primary" ) ) mouse_state = 3; - - ui_set_mouse( &ui_global_ctx, vg_mouse[0], vg_mouse[1], mouse_state ); + ui_set_mouse( &ui_global_ctx, vg_mouse[0], vg_mouse[1], vg_get_button_state( "primary" ) ); vg_ui(); vg_console_draw(); vg_debugtools_draw(); ui_resolve( &ui_global_ctx ); - m3x3f view = M3X3_IDENTITY; - m3x3_translate( view, (v3f){ -1.0f, 1.0f, 0.0f } ); - m3x3_scale( view, (v3f){ 1.0f/((float)vg_window_x*0.5f), -1.0f/((float)vg_window_y*0.5f), 1.0f } ); ui_draw( &ui_global_ctx ); }