summaryrefslogtreecommitdiff
path: root/src/mesa/main/occlude.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-11-28 21:06:40 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-11-28 21:06:40 +0000
commitafb6fe034c3df9377ca8c0393a60c7996af92faf (patch)
treea6e537625a8518062dabb0e6ca6e3af48abf8041 /src/mesa/main/occlude.c
parentdeb4a63a867d58b400a2b8d45ea5db5a54d71fac (diff)
more tweaks to error checking and reporting
Diffstat (limited to 'src/mesa/main/occlude.c')
-rw-r--r--src/mesa/main/occlude.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c
index 2a3f8a00b9..c8fa1dfacd 100644
--- a/src/mesa/main/occlude.c
+++ b/src/mesa/main/occlude.c
@@ -220,7 +220,7 @@ void GLAPIENTRY
_mesa_EndQueryARB(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
- struct occlusion_query *q;
+ struct occlusion_query *q = NULL;
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_DEPTH);
@@ -230,11 +230,12 @@ _mesa_EndQueryARB(GLenum target)
return;
}
- q = (struct occlusion_query *)
- _mesa_HashLookup(ctx->Occlusion.QueryObjects,
- ctx->Occlusion.CurrentQueryObject);
+ if (ctx->Occlusion.CurrentQueryObject)
+ q = (struct occlusion_query *)
+ _mesa_HashLookup(ctx->Occlusion.QueryObjects,
+ ctx->Occlusion.CurrentQueryObject);
if (!q || !q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glEndQuery with glBeginQuery");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glEndQuery with no glBeginQuery");
return;
}
@@ -282,7 +283,7 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params)
_mesa_HashLookup(ctx->Occlusion.QueryObjects, id);
if (!q || q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB(id=%d)", id);
return;
}
@@ -312,7 +313,7 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params)
q = (struct occlusion_query *)
_mesa_HashLookup(ctx->Occlusion.QueryObjects, id);
if (!q || q->Active) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB");
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB(id=%d", id);
return;
}