[Piglit] [PATCH 09/14] util: Move more GLUT initializtion code into piglit-framework-glut.c
Chad Versace
chad.versace at linux.intel.com
Tue Jun 12 16:02:55 PDT 2012
Why move initialize GLUT in two different places?
This patch moves the GLUT initiliazation code located in piglit-util.c
into piglit_framework_glut_init().
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
tests/util/piglit-framework-glut.c | 14 +++++++++++++-
tests/util/piglit-util.c | 18 ------------------
tests/util/piglit-util.h | 5 -----
3 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/tests/util/piglit-framework-glut.c b/tests/util/piglit-framework-glut.c
index fdb76fb..f02860b 100644
--- a/tests/util/piglit-framework-glut.c
+++ b/tests/util/piglit-framework-glut.c
@@ -80,7 +80,19 @@ piglit_present_results()
void
piglit_framework_glut_init(int argc, char *argv[])
{
- piglit_glutInit(argc, argv);
+ glutInit(&argc, argv);
+
+# if defined(USE_WAFFLE)
+# if defined(USE_OPENGL)
+ glutInitAPIMask(GLUT_OPENGL_BIT);
+# elif defined(USE_OPENGL_ES1)
+ glutInitAPIMask(GLUT_OPENGL_ES1_BIT);
+# elif defined(USE_OPENGL_ES2)
+ glutInitAPIMask(GLUT_OPENGL_ES2_BIT);
+# else
+# error
+# endif
+# endif
glutInitWindowPosition(0, 0);
glutInitWindowSize(piglit_width, piglit_height);
diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index ea51209..2d367c5 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -91,24 +91,6 @@ int asprintf(char **strp, const char *fmt, ...)
#endif /* _WIN32 */
-
-void piglit_glutInit(int argc, char **argv)
-{
- glutInit(&argc, argv);
-
-# if defined(USE_WAFFLE)
-# if defined(USE_OPENGL)
- glutInitAPIMask(GLUT_OPENGL_BIT);
-# elif defined(USE_OPENGL_ES1)
- glutInitAPIMask(GLUT_OPENGL_ES1_BIT);
-# elif defined(USE_OPENGL_ES2)
- glutInitAPIMask(GLUT_OPENGL_ES2_BIT);
-# else
-# error
-# endif
-# endif
-}
-
bool piglit_is_gles()
{
const char *version_string = (const char *) glGetString(GL_VERSION);
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index c1f848d..3f5ffd9 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -112,11 +112,6 @@ extern const unsigned int fdo_bitmap_width;
extern const unsigned int fdo_bitmap_height;
/**
- * Call glutInit() and, if glut_waffle is used, also call glutInitAPIMask().
- */
-void piglit_glutInit(int argc, char **argv);
-
-/**
* Determine if the API is OpenGL ES.
*/
bool piglit_is_gles();
--
1.7.10.4
More information about the Piglit
mailing list