X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=metrics.c;h=84fc23f6b20b02a2a15ece51ee9b63447d4e5466;hb=211a9ae3f02ce8032da195b211ea683d5fada05d;hp=cbfe52e9d1ce6d8c19bed45c9d038b11d14bfa0e;hpb=5569357a9fc7189c2bae43773f44ba576583ec2b;p=fips diff --git a/metrics.c b/metrics.c index cbfe52e..84fc23f 100644 --- a/metrics.c +++ b/metrics.c @@ -24,7 +24,8 @@ #include -#include "fips-dispatch.h" +#include "fips-dispatch-gl.h" + #include "metrics.h" typedef struct counter @@ -57,7 +58,7 @@ typedef struct context context_t current_context; unsigned -metrics_add_counter (void) +metrics_counter_new (void) { counter_t *counter; @@ -83,6 +84,18 @@ metrics_add_counter (void) return counter->id; } +void +metrics_counter_start (unsigned counter) +{ + glBeginQuery (GL_TIME_ELAPSED, counter); +} + +void +metrics_counter_stop (void) +{ + glEndQuery (GL_TIME_ELAPSED); +} + void metrics_set_current_program (unsigned program) {