X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_profiler.h;h=bfdde127af5b921840a79b66aa7c57c7367996be;hb=8340e9c7406c7292f85266f9f30f4b5ff246dcd3;hp=5c0690c9186b6010a0ecee9515fc9528cc2397a0;hpb=d48e4bdf9285dacbd2c642ef844a3aba3e8d0160;p=vg.git diff --git a/vg_profiler.h b/vg_profiler.h index 5c0690c..bfdde12 100644 --- a/vg_profiler.h +++ b/vg_profiler.h @@ -49,17 +49,16 @@ VG_STATIC void vg_profile_end( struct vg_profile *profile ) u64 time_end = SDL_GetPerformanceCounter(), delta = time_end - profile->start; - if( profile->mode == k_profile_mode_frame ) - { + if( profile->mode == k_profile_mode_frame ){ profile->samples[ profile->buffer_current ] = delta; vg_profile_increment( profile ); } - else - { + else{ profile->samples[ profile->buffer_current ] += delta; } } +#if 0 VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count, float budget, ui_rect panel, u32 colour_offset ) { @@ -81,8 +80,7 @@ VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count, double avgs[8]; int ptrs[8]; - for( int i=0; ibuffer_current; avgs[i] = 0.0f; } @@ -92,12 +90,10 @@ VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count, double rate_mul = 1000.0 / (double)SDL_GetPerformanceFrequency(); - for( int i=0; iname ); @@ -140,16 +135,11 @@ VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count, k_text_align_left ); } } +#endif VG_STATIC void vg_profiler_init(void) { - vg_var_push( (struct vg_var){ - .name = "vg_profiler", - .data = &vg_profiler, - .data_type = k_var_dtype_i32, - .opt_i32 = { .min=0, .max=1, .clamp=1 }, - .persistent = 1 - }); + VG_VAR_I32( vg_profiler, flags=VG_VAR_PERSISTENT ); } #endif /* VG_PROFILER_H */