From f4d83149a7030b4156d8b857ac146f4a6a0b0808 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 3 Aug 2014 22:15:12 +0200 Subject: [PATCH] GL: Occlusion query bugfix --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index eb59f2205..6dae9f4fe 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -2803,9 +2803,13 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() else { GLuint result; - nglGetQueryObjectuivARB(ID, GL_QUERY_RESULT, &result); - OcclusionType = result != 0 ? NotOccluded : Occluded; - VisibleCount = (uint) result; + nglGetQueryObjectuivARB(ID, GL_QUERY_RESULT_AVAILABLE, &result); + if (result != GL_FALSE) + { + nglGetQueryObjectuivARB(ID, GL_QUERY_RESULT, &result); + OcclusionType = result != 0 ? NotOccluded : Occluded; + VisibleCount = (uint) result; + } } } #endif