[Piglit] [PATCH 1/2] fbo-depth-sample-compare: Eliminate dependency on glutSolidSphere.

jfonseca at vmware.com jfonseca at vmware.com
Thu Apr 24 02:03:51 PDT 2014


From: José Fonseca <jfonseca at vmware.com>

---
 tests/fbo/CMakeLists.gl.txt          |  6 +-----
 tests/fbo/fbo-depth-sample-compare.c | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tests/fbo/CMakeLists.gl.txt b/tests/fbo/CMakeLists.gl.txt
index 2f33481..7a24147 100644
--- a/tests/fbo/CMakeLists.gl.txt
+++ b/tests/fbo/CMakeLists.gl.txt
@@ -11,11 +11,6 @@ link_libraries (
 	${OPENGL_glu_LIBRARY}
 )
 
-if(NOT PIGLIT_USE_WAFFLE)
-	# This test uses glutSolidSphere.
-	piglit_add_executable (fbo-depth-sample-compare fbo-depth-sample-compare.c)
-endif(NOT PIGLIT_USE_WAFFLE)
-
 piglit_add_executable (fbo-1d fbo-1d.c)
 piglit_add_executable (fbo-alphatest-formats fbo-alphatest-formats.c)
 piglit_add_executable (fbo-alphatest-nocolor fbo-alphatest-nocolor.c)
@@ -27,6 +22,7 @@ piglit_add_executable (fbo-depthtex fbo-depthtex.c)
 piglit_add_executable (fbo-3d fbo-3d.c)
 piglit_add_executable (fbo-array fbo-array.c)
 piglit_add_executable (fbo-depth-array fbo-depth-array.c)
+piglit_add_executable (fbo-depth-sample-compare fbo-depth-sample-compare.c)
 piglit_add_executable (fbo-alpha fbo-alpha.c)
 piglit_add_executable (fbo-luminance-alpha fbo-luminance-alpha.c)
 piglit_add_executable (fbo-bind-renderbuffer fbo-bind-renderbuffer.c)
diff --git a/tests/fbo/fbo-depth-sample-compare.c b/tests/fbo/fbo-depth-sample-compare.c
index b9ec27f..10b8506 100644
--- a/tests/fbo/fbo-depth-sample-compare.c
+++ b/tests/fbo/fbo-depth-sample-compare.c
@@ -39,6 +39,12 @@
 #include <assert.h>
 #include "piglit-util-gl-common.h"
 
+#if defined(__APPLE__)
+#  include <OpenGL/glu.h>
+#else
+#  include <GL/glu.h>
+#endif
+
 
 /** Set DEBUG to 1 to enable extra output when trying to debug failures */
 #define DEBUG 0
@@ -60,6 +66,7 @@ static GLuint ColorTex, DepthTex, FBO;
 static GLuint ShaderProg;
 static GLint Zbits;
 static GLenum TexTarget = GL_TEXTURE_2D;
+static GLUquadricObj *sphereObj = NULL;
 
 
 static void
@@ -233,7 +240,13 @@ find_uint_min_max_center(const GLuint *buf, GLuint n,
 static void
 draw_sphere(void)
 {
-   glutSolidSphere(0.95, 40, 20);
+   GLdouble radius = 0.95;
+   GLint slices = 40;
+   GLint stacks = 20;
+
+   gluQuadricDrawStyle(sphereObj, GLU_FILL);
+   gluQuadricNormals(sphereObj, GLU_SMOOTH);
+   gluSphere(sphereObj, radius, slices, stacks);
 }
 
 
@@ -526,6 +539,8 @@ piglit_init(int argc, char **argv)
 
    create_frag_shader();
 
+   sphereObj = gluNewQuadric();
+
    if (!piglit_automatic) {
       printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
       printf("Left: Shader showing difference pixels (black=good, red=error)\n");
-- 
1.8.3.2



More information about the Piglit mailing list