1.0
authorhgn <hgodden00@gmail.com>
Mon, 31 Oct 2022 19:04:51 +0000 (19:04 +0000)
committerhgn <hgodden00@gmail.com>
Mon, 31 Oct 2022 19:04:51 +0000 (19:04 +0000)
src/vg/vg.h

index 71f4b2a3d853c8c6605559c5a39a18d0486eae2b..de119709bd34df35483d224190dcc7ee771996a0 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;
@@ -402,12 +408,25 @@ VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name )
       {
          vg_mem.use_libc_malloc = atoi( arg );
       }
+
+      if( (arg = vg_long_opt_arg( "high-performance" )) )
+      {
+         vg.quality_profile = k_quality_profile_low;
+      }
    }
    
    vg_alloc_quota();
    vg_log_init();
    vg_console_init();
 
+   vg_convar_push( (struct vg_convar){
+      .name = "vg_quality",
+      .data = &vg.quality_profile,
+      .data_type = k_convar_dtype_i32,
+      .opt_i32 = { .min=0, .max=1, .clamp=1 },
+      .persistent = 0
+   });
+
    glfwInit();
    glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );
    glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 );