OSDN Git Service

added missing error check in _mesa_BeginQueryARB (Cedric Gautier). minor clean-ups.
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 2 Mar 2004 15:21:51 +0000 (15:21 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 2 Mar 2004 15:21:51 +0000 (15:21 +0000)
src/mesa/main/occlude.c

index c8fa1df..d329f11 100644 (file)
@@ -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"),
 #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;