[Piglit] [PATCH 15/29] tests: Include glu.h where glu is used

Paul Berry stereotype441 at gmail.com
Fri May 25 09:48:24 PDT 2012


On 21 May 2012 11:08, Pauli Nieminen <pauli.nieminen at linux.intel.com> wrote:

> There is a few places where glu is used without including the header.
> That produces warnings about missing functions. To silence compiler
> warnings glu header needs to be included.
>

If I'm not mistaken, glu is *usually* present on a conformant GL
implementation, but it's not a guarantee, and it's usually not present on a
conformant GLES implementation.  So I would rather decrease our dependence
on it if possible.

It looks to like there are only two things we use glu for in these files:

(a) Calling gluErrorString() to translate an error enum to its string
representation
(b) Calling gluPerspective() to set up a perspective transformation

These uses are simple enough that I think we would be better off just
replacing them with code that doesn't use the glu library at all.  The
calls to gluErrorString() can probably just be directly replaced with calls
to piglit_get_gl_error_name().

As for the call to gluPerspective(), I think we could just replace it with
a direct call to glFrustum() for now.  In the longer term we'll probably
want to modify this test so that it doesn't rely on deprecated matrix stack
functionality (that way it will be able to be run on GLES implementations
and forward compatible contexts), but I think that can wait.


>
> Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
> ---
>  .../arb_shader_texture_lod/execution/texgrad.c     |    1 +
>  tests/spec/gl-2.0/api/clip-flag-behavior.c         |    1 +
>  tests/texturing/teximage-errors.c                  |    1 +
>  tests/texturing/texture-integer.c                  |    1 +
>  4 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/tests/spec/arb_shader_texture_lod/execution/texgrad.c
> b/tests/spec/arb_shader_texture_lod/execution/texgrad.c
> index a7bf6ec..64e8f49 100644
> --- a/tests/spec/arb_shader_texture_lod/execution/texgrad.c
> +++ b/tests/spec/arb_shader_texture_lod/execution/texgrad.c
> @@ -30,6 +30,7 @@
>  */
>
>  #include "piglit-util.h"
> +#include <GL/glu.h>
>
>  int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
>  int piglit_width = 512;
> diff --git a/tests/spec/gl-2.0/api/clip-flag-behavior.c
> b/tests/spec/gl-2.0/api/clip-flag-behavior.c
> index f429c22..1b9450a 100644
> --- a/tests/spec/gl-2.0/api/clip-flag-behavior.c
> +++ b/tests/spec/gl-2.0/api/clip-flag-behavior.c
> @@ -37,6 +37,7 @@
>  */
>
>  #include "piglit-util.h"
> +#include <GL/glu.h>
>
>  int piglit_width = 100, piglit_height = 100;
>  int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
> diff --git a/tests/texturing/teximage-errors.c
> b/tests/texturing/teximage-errors.c
> index 4a0aac7..6918329 100644
> --- a/tests/texturing/teximage-errors.c
> +++ b/tests/texturing/teximage-errors.c
> @@ -28,6 +28,7 @@
>  */
>
>  #include "piglit-util.h"
> +#include <GL/glu.h>
>
>  int piglit_width = 100, piglit_height = 100;
>  int piglit_window_mode = GLUT_RGB;
> diff --git a/tests/texturing/texture-integer.c
> b/tests/texturing/texture-integer.c
> index a256e0a..a055c4b 100644
> --- a/tests/texturing/texture-integer.c
> +++ b/tests/texturing/texture-integer.c
> @@ -28,6 +28,7 @@
>  */
>
>  #include "piglit-util.h"
> +#include <GL/glu.h>
>
>
>  int piglit_width = 100, piglit_height = 100;
> --
> 1.7.5.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20120525/2d7fe4f8/attachment.htm>


More information about the Piglit mailing list