its ot'
[vg.git] / src / vg / vg.h
index a36697b516a77ce3e7ea8298bb2c271438aeb7a9..31cfa8065529233f091bad686717ae2b166ac12d 100644 (file)
@@ -222,58 +222,64 @@ static void vg_init( int argc, char *argv[], const char *window_name )
       
    vg_register();
    vg_register_exit( &vg_free, "vg_free" );
+
+
+   vg_shaders_recompile(0,NULL);
+   vg_register_exit( &vg_shaders_free, "vg_shaders_free" );
+       vg_function_push( (struct vg_cmd){
+               .name = "shaders",
+               .function = vg_shaders_recompile
+       });
+
    
-   if( vg_shaders_compile() )
-   {
-      vg_start();
+   vg_start();
+
+   vg_console_init();
+   vg_register_exit( &vg_console_free, "Console" );
+
+   vg_audio_init();
+   vg_register_exit( &vg_audio_free, "vg_audio_free" );
    
-      vg_console_init();
-      vg_register_exit( &vg_console_free, "Console" );
+   vg_debugtools_setup();
    
-      vg_audio_init();
-      vg_register_exit( &vg_audio_free, "vg_audio_free" );
+   /* 
+    * Main gameloop
+    */
+   while( !glfwWindowShouldClose( vg_window ) )
+   {
+      v2_copy( (v2f){ 0.0f, 0.0f }, vg_mouse_wheel );
+
+      glfwPollEvents();
       
-      vg_debugtools_setup();
+      #ifdef VG_STEAM
+      sw_event_loop();
+      #endif
+      
+      vg_time_last = vg_time;
+      vg_time = glfwGetTime();
+      vg_time_delta = vg_minf( vg_time - vg_time_last, 0.1f );
+      
+      vg_update_inputs();
+      vg_update();
+      vg_render();
+      
+      vg_lines_drawall((float*)vg_pv);
       
-      /* 
-       * Main gameloop
-       */
-      while( !glfwWindowShouldClose( vg_window ) )
       {
-         v2_copy( (v2f){ 0.0f, 0.0f }, vg_mouse_wheel );
-
-         glfwPollEvents();
-         
-         #ifdef VG_STEAM
-         sw_event_loop();
-         #endif
+         ui_begin( &ui_global_ctx, vg_window_x, vg_window_y );
+         ui_set_mouse( &ui_global_ctx, vg_mouse[0], vg_mouse[1], 
+               vg_get_button_state( "primary" ) );
          
-         vg_time_last = vg_time;
-         vg_time = glfwGetTime();
-         vg_time_delta = vg_minf( vg_time - vg_time_last, 0.1f );
+         vg_ui();
+         vg_console_draw();
+         vg_debugtools_draw();
          
-         vg_update_inputs();
-         vg_update();
-         vg_render();
-         
-         vg_lines_drawall((float*)vg_pv);
-         
-         {
-            ui_begin( &ui_global_ctx, vg_window_x, vg_window_y );
-            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 );
-            ui_draw( &ui_global_ctx, NULL );
-         }
-         
-         glfwSwapBuffers( vg_window );
-         VG_CHECK_GL();
+         ui_resolve( &ui_global_ctx );
+         ui_draw( &ui_global_ctx, NULL );
       }
+      
+      glfwSwapBuffers( vg_window );
+      VG_CHECK_GL();
    }
    
    vg_exit();