2 * Copyright © 2009 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27 * \author Ian Romanick <ian.d.romanick@intel.com>
30 #include "piglit-util.h"
31 #include "piglit-framework.h"
33 #define ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
38 int piglit_window_mode
= GLUT_DOUBLE
;
39 int piglit_width
= 100;
40 int piglit_height
= 100;
45 static const GLfloat clear_color
[4] = { 0.5, 0.5, 0.5, 1.0 };
51 static const GLfloat green
[4] = { 0.0, 1.0, 0.0, 1.0 };
52 static const GLfloat red
[4] = { 1.0, 0.0, 0.0, 1.0 };
53 enum piglit_result result
= PIGLIT_SUCCESS
;
55 glClear(GL_COLOR_BUFFER_BIT
);
57 glBegin(GL_TRIANGLES
);
59 glVertex3f(-1.0, 1.0, 0.0);
61 glVertex3f( 2.0, 0.0, 1.0);
63 glVertex3f(-1.0, -1.0, 0.0);
66 if (!piglit_probe_pixel_rgb(piglit_width
- 2,
69 result
= PIGLIT_FAILURE
;
78 piglit_init(int argc
, char **argv
)
80 GLdouble clip_plane
[4] = {
87 glClearColor(clear_color
[0],
92 glClipPlane(GL_CLIP_PLANE0
, clip_plane
);
93 glEnable(GL_CLIP_PLANE0
);