From 411b8faac47317e73ab9c285a85631a340a4ad53 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Mar 2004 15:21:51 +0000 Subject: [PATCH] added missing error check in _mesa_BeginQueryARB (Cedric Gautier). minor clean-ups. --- src/mesa/main/occlude.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index c8fa1dfacd8..d329f11f098 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -35,14 +35,6 @@ #include "occlude.h" #include "mtypes.h" -#ifndef GL_SAMPLES_PASSED_ARB -#define GL_SAMPLES_PASSED_ARB 0x8914 -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#endif - struct occlusion_query { @@ -188,6 +180,11 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } + if (id == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(id==0)"); + return; + } + if (ctx->Occlusion.CurrentQueryObject) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(target)"); return; -- 2.30.2