//------------------------------------------------------------------ void GLES2HardwareOcclusionQuery::destroyQuery() { if(getGLSupport()->checkExtension("GL_EXT_occlusion_query_boolean") || gleswIsSupported(3, 0)) { OGRE_CHECK_GL_ERROR(glDeleteQueriesEXT(1, &mQueryID)); } }
void SampleQueryGLTest::wrap() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>()) CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); #endif GLuint id; #ifndef MAGNUM_TARGET_GLES2 glGenQueries(1, &id); #else glGenQueriesEXT(1, &id); #endif /* Releasing won't delete anything */ { auto query = SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed, ObjectFlag::DeleteOnDestruction); CORRADE_COMPARE(query.release(), id); } /* ...so we can wrap it again */ SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed); #ifndef MAGNUM_TARGET_GLES2 glDeleteQueries(1, &id); #else glDeleteQueriesEXT(1, &id); #endif }
/** * Object destructor */ GLES2HardwareOcclusionQuery::~GLES2HardwareOcclusionQuery() { #ifdef GL_EXT_occlusion_query_boolean glDeleteQueriesEXT(1, &mQueryID); GL_CHECK_ERROR; #endif }
//------------------------------------------------------------------ void GLES2HardwareOcclusionQuery::destroyQuery() { #ifdef GL_EXT_occlusion_query_boolean OGRE_IF_IOS_VERSION_IS_GREATER_THAN(5.0) OGRE_CHECK_GL_ERROR(glDeleteQueriesEXT(1, &mQueryID)); #endif }
AbstractQuery::~AbstractQuery() { /* Moved out, nothing to do */ if(!_id) return; #ifndef MAGNUM_TARGET_GLES2 glDeleteQueries(1, &_id); #elif !defined(CORRADE_TARGET_EMSCRIPTEN) glDeleteQueriesEXT(1, &_id); #else CORRADE_ASSERT_UNREACHABLE(); #endif }
AbstractQuery::~AbstractQuery() { /* Moved out or not deleting on destruction, nothing to do */ if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; #ifndef MAGNUM_TARGET_GLES2 glDeleteQueries(1, &_id); #elif !defined(CORRADE_TARGET_EMSCRIPTEN) glDeleteQueriesEXT(1, &_id); #else CORRADE_ASSERT_UNREACHABLE(); #endif _flags |= ObjectFlag::Created; }
AbstractQuery::~AbstractQuery() { /* Moved out, nothing to do */ if(!_id) return; /** @todo Re-enable when extension loader is available for ES */ #ifndef MAGNUM_TARGET_GLES2 glDeleteQueries(1, &_id); #elif defined(CORRADE_TARGET_NACL) glDeleteQueriesEXT(1, &_id); #else CORRADE_INTERNAL_ASSERT(false); #endif }