X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fcommands.cpp;h=a0a4336ade77c6951a1fd511e884e7f6e9dd0f7c;hp=19ff10115e53e10faf612220c2daf3f4697f841e;hb=052b85720688900bc36f8844a94269cb1c0cdd52;hpb=bae374a3cda6a1b59f36016624ef518bf2676355 diff --git a/source/core/commands.cpp b/source/core/commands.cpp index 19ff1011..a0a4336a 100644 --- a/source/core/commands.cpp +++ b/source/core/commands.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -9,6 +10,7 @@ #include "error.h" #include "gl.h" #include "pipelinestate.h" +#include "query.h" using namespace std; @@ -107,5 +109,17 @@ void Commands::resolve_multisample(Framebuffer &target) } } +void Commands::begin_query(const QueryPool &pool, unsigned index) +{ + if(index>=pool.queries.size()) + throw out_of_range("OpenGLCommands::begin_query"); + glBeginQuery(pool.gl_type, pool.queries[index]); +} + +void Commands::end_query(const QueryPool &pool, unsigned) +{ + glEndQuery(pool.gl_type); +} + } // namespace GL } // namespace Msp