better low qual mode
[vg.git] / src / vg / vg.h
index 71f4b2a3d853c8c6605559c5a39a18d0486eae2b..61db7d6e0f83e802ee85f943f5932e84501de00b 100644 (file)
@@ -110,6 +110,12 @@ struct vg
 
    /* graphics */
    m4x4f pv;
+   enum quality_profile
+   {
+      k_quality_profile_high = 0,
+      k_quality_profile_low = 1,
+   }
+   quality_profile;
 
    /* Gamepad */
    GLFWgamepadstate  gamepad;
@@ -144,6 +150,14 @@ static VG_THREAD_LOCAL struct vg_thread_info vg_thread_info;
 #endif
 
 VG_STATIC void vg_fatal_exit_loop( const char *error );
+VG_STATIC void vg_required( void *ptr, const char *path )
+{
+   if( !ptr )
+   {
+      vg_fatal_exit_loop( path );
+   }
+}
+
 
 VG_STATIC void vg_ensure_engine_running(void)
 {
@@ -398,10 +412,15 @@ VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name )
          vg.samples = VG_MAX( 0, VG_MIN( 8, atoi( arg ) ) );
       }
 
-      if( (arg = vg_long_opt_arg( "use-libc-malloc" )) )
+      if(  vg_long_opt( "use-libc-malloc" ) )
       {
          vg_mem.use_libc_malloc = atoi( arg );
       }
+
+      if( vg_long_opt( "high-performance" ) )
+      {
+         vg.quality_profile = k_quality_profile_low;
+      }
    }
    
    vg_alloc_quota();