From: James Benton Date: Tue, 31 Jul 2012 11:48:27 +0000 (+0100) Subject: Check if GL_ARB_timer_query is supported before using it. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b6ca846eb0bd53c4e28a6fcd6bf2a403da94a12f;p=apitrace Check if GL_ARB_timer_query is supported before using it. --- diff --git a/retrace/glretrace_main.cpp b/retrace/glretrace_main.cpp index ce06402..e3bb9d4 100644 --- a/retrace/glretrace_main.cpp +++ b/retrace/glretrace_main.cpp @@ -171,6 +171,12 @@ getActiveProgram() void beginProfile(trace::Call &call) { if (firstFrame) { + const char* extensions = (const char*)glGetString(GL_EXTENSIONS); + if (!glws::checkExtension("GL_ARB_timer_query", extensions)) { + std::cout << "Error: Cannot run profile, GL_ARB_timer_query extension is not supported." << std::endl; + exit(-1); + } + frame_start(); }