本文整理汇总了C++中piglit_probe_pixel_rgb函数的典型用法代码示例。如果您正苦于以下问题:C++ piglit_probe_pixel_rgb函数的具体用法?C++ piglit_probe_pixel_rgb怎么用?C++ piglit_probe_pixel_rgb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了piglit_probe_pixel_rgb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
float green[] = {0, 1, 0, 0};
int count, i;
glClearColor(0.5, 0.5, 0.5, 0.5);
glClear(GL_COLOR_BUFFER_BIT);
for (count = 1; count <= max_targets; count++) {
generate_and_display_drawbuffers(count);
}
for (count = 1; count <= max_targets; count++) {
for (i = 0; i < count; i++) {
pass = pass &&
piglit_probe_pixel_rgb(16 * i + 8,
16 * (count - 1) + 8,
green);
}
}
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例2: piglit_display
enum piglit_result
piglit_display(void)
{
static const float red[3] = {1, 0, 0},
green[3] = {0, 1, 0},
blue[3] = {0, 0, 1},
yellow[3] = {1, 1, 0},
cyan[3] = {0, 1, 1};
bool pass = true;
glClear(GL_COLOR_BUFFER_BIT);
glProvokingVertexEXT(GL_LAST_VERTEX_CONVENTION_EXT);
const int y1 = piglit_height / 3;
glBegin(GL_TRIANGLE_STRIP);
glColor3fv(cyan);
glVertex3i(piglit_width + 1, y1, 0);
glColor3fv(yellow);
glVertex3i(piglit_width + 2, y1, 0);
glColor3fv(blue);
glVertex3i(piglit_width + 3, y1, 0);
glColor3fv(green);
glVertex3i(piglit_width / 2, y1 * 2, 0);
glColor3fv(red);
glVertex3i(piglit_width - 1, y1 * 2, 0);
glEnd();
pass = pass && piglit_probe_pixel_rgb(piglit_width - 2, y1 * 3 / 2, red);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例3: draw
enum piglit_result
draw(Display *dpy)
{
GLboolean pass = GL_TRUE;
float green[] = {0.0, 1.0, 0.0, 0.0};
GLXContext ctx;
ctx = piglit_get_glx_context(dpy, visinfo);
glXMakeCurrent(dpy, win, ctx);
piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
glClearColor(1.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glXDestroyContext(dpy, ctx);
ctx = piglit_get_glx_context(dpy, visinfo);
glXMakeCurrent(dpy, win, ctx);
glClearColor(0.0, 1.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
pass &= piglit_probe_pixel_rgb(1, 1, green);
glXSwapBuffers(dpy, win);
/* Free our resources when we're done. */
glXMakeCurrent(dpy, None, NULL);
glXDestroyContext(dpy, ctx);
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例4: test_etc1_rgb8_texture_8x8
static int
test_etc1_rgb8_texture_8x8(const struct etc1_rgb8_texture_8x8 *tex)
{
const GLenum format = GL_ETC1_RGB8_OES;
const GLsizei width = 8, height = 8;
unsigned x, y;
int pass = GL_TRUE;
glCompressedTexImage2D(GL_TEXTURE_2D, 0,
format, width, height, 0, sizeof(tex->data), tex->data);
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
glEnable(GL_TEXTURE_2D);
piglit_draw_rect_tex(0, 0, width, height, 0.0f, 0.0f, 1.0f, 1.0f);
glDisable(GL_TEXTURE_2D);
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
const GLubyte *rgb = tex->rgb[y * width + x];
float expected[3] = {
rgb[0] / 255.0f,
rgb[1] / 255.0f,
rgb[2] / 255.0f
};
pass = piglit_probe_pixel_rgb(x, y, expected) && pass;
}
}
return pass;
}
示例5: test_depth
/**
* Test glDrawTex with non-zero z.
*/
static int
test_depth(void)
{
const GLint crop[4] = {
0, 0, TEXTURE_SIZE, TEXTURE_SIZE
};
const int x = piglit_width / 2 - 2;
const int y = piglit_height / 2 - 2;
int pass;
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
glEnable(GL_DEPTH_TEST);
/* draw at near plane */
piglit_glDrawTexiOES(0, 0, 0, piglit_width, piglit_height);
/* draw at far plane: should be no-op */
piglit_glDrawTexiOES(0, 0, 1, piglit_width / 2, piglit_height / 2);
glDisable(GL_DEPTH_TEST);
pass = piglit_probe_pixel_rgb(x, y, red);
if (!pass)
fprintf(stderr, "non-zero depth failed\n");
return pass;
}
示例6: piglit_display
enum piglit_result
piglit_display(void)
{
bool pass = true;
GLuint tex;
int i;
tex = create_texture();
clear_texture(tex);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
draw_faces();
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
glDeleteTextures(1, &tex);
for (i = 0; i < 6; i++)
pass &= piglit_probe_pixel_rgb(i, 0, faces[i].color);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例7: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
int x, y;
glClearColor(0.5, 0.5, 0.5, 0.5);
glClear(GL_COLOR_BUFFER_BIT);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
for (y = 8; y < piglit_height && pass; y += 16) {
for (x = 8; x < piglit_width; x += 16) {
float color[3];
color[0] = x / 256.0;
color[1] = y / 256.0;
color[2] = 0;
pass &= piglit_probe_pixel_rgb(x, y, color);
if (!pass)
break;
}
}
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例8: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
float red[] = {1,0,0,0};
float green[] = {0,1,0,0};
float *expected;
int x;
GLuint tex;
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
tex = create_1d_fbo();
draw_fbo_1d(10, 10);
for (x = 0; x < BUF_WIDTH; x++) {
if (x < BUF_WIDTH / 2)
expected = red;
else
expected = green;
pass &= piglit_probe_pixel_rgb(10 + x, 10, expected);
}
glDeleteTextures(1, &tex);
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例9: piglit_display
enum piglit_result
piglit_display(void)
{
static const float green[3] = { 0.0, 1.0, 0.0 };
static const float blue[3] = { 0.0, 0.0, 1.0 };
enum piglit_result result = PIGLIT_PASS;
glClear(GL_COLOR_BUFFER_BIT);
glColor3fv(blue);
/* Bind the separately linked vertex shader and the separately linked
* fragment shader using the new interfaces. This should produce a
* green box.
*/
glUseShaderProgramEXT(GL_VERTEX_SHADER, prog[0]);
glUseShaderProgramEXT(GL_FRAGMENT_SHADER, prog[1]);
piglit_draw_rect(10, 10, 10, 10);
if (!piglit_probe_pixel_rgb(15, 15, green))
result = PIGLIT_FAIL;
if (!piglit_automatic)
piglit_present_results();
return result;
}
示例10: piglit_display
enum piglit_result
piglit_display(void)
{
static const GLfloat color[4] = { 0.0, 1.0, 0.0, 1.0 };
enum piglit_result result = PIGLIT_PASS;
unsigned i;
glClear(GL_COLOR_BUFFER_BIT);
for (i = 0; i < ARRAY_SIZE(progs); i++) {
const int x = 1 + (i * (BOX_SIZE + 1));
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, progs[i]);
glEnable(GL_CLIP_PLANE0 + i);
piglit_draw_rect_tex(x, 1, BOX_SIZE, BOX_SIZE,
1.0, 1.0, -2.0, 0.0);
glDisable(GL_CLIP_PLANE0 + i);
if (!piglit_probe_pixel_rgb(x + (BOX_SIZE / 2),
1 + (BOX_SIZE / 2),
color)) {
result = PIGLIT_FAIL;
}
}
piglit_present_results();
return result;
}
示例11: check_red_box_surrounded_by_green
static GLboolean
check_red_box_surrounded_by_green(int x, int y, int w, int h)
{
GLboolean pass = GL_TRUE;
int probe_x, probe_y;
const float red[] = {1.0, 0.0, 0.0, 0.0};
const float green[] = {0.0, 1.0, 0.0, 0.0};
for (probe_y = y - 1; probe_y <= y + h; probe_y++) {
for (probe_x = x - 1; probe_x <= x + w; probe_x++) {
const float *expected;
if (probe_y < y || probe_y >= y + h ||
probe_x < x || probe_x >= x + w)
expected = green;
else
expected = red;
pass &= piglit_probe_pixel_rgb(probe_x, probe_y,
expected);
}
}
return pass;
}
示例12: piglit_display
enum piglit_result
piglit_display(void)
{
static const GLfloat green[4] = { 0.0, 1.0, 0.0, 1.0 };
static const GLfloat red[4] = { 1.0, 0.0, 0.0, 1.0 };
enum piglit_result result = PIGLIT_PASS;
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glColor4fv(green);
glVertex3f(-1.0, 1.0, 0.0);
glColor4fv(red);
glVertex3f( 2.0, 0.0, 1.0);
glColor4fv(green);
glVertex3f(-1.0, -1.0, 0.0);
glEnd();
if (!piglit_probe_pixel_rgb(piglit_width - 2,
piglit_height / 2,
clear_color)) {
result = PIGLIT_FAIL;
}
piglit_present_results();
return result;
}
示例13: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
unsigned i;
float x = 0, y = 0;
glClear(GL_COLOR_BUFFER_BIT);
glEnableClientState(GL_VERTEX_ARRAY);
for (i = 0; tests[i].test; i++) {
if (!user_va && tests[i].flag == USER)
continue;
glBindBuffer(GL_ARRAY_BUFFER, 0);
printf("%s\n", tests[i].name);
tests[i].test(x, y, x+20, y+20, tests[i].index);
assert(glGetError() == 0);
pass = piglit_probe_pixel_rgb(x+5, y+5, tests[i].expected_color) && pass;
x += 20;
if (x > 300) {
x = 0;
y += 20;
}
}
glFinish();
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
示例14: piglit_display
enum piglit_result
piglit_display(void)
{
static const GLfloat color[4] = { 0.0, 1.0, 0.0, 0.0 };
enum piglit_result result = PIGLIT_PASS;
unsigned i;
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glEnable(GL_VERTEX_PROGRAM_ARB);
glColor4f(1.0, 0.6, 0.3, 0.1);
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, vert_prog);
for (i = 0; i < ARRAY_SIZE(progs); i++) {
const int x = 1 + (i * (BOX_SIZE + 1));
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progs[i]);
piglit_draw_rect(x, 1, BOX_SIZE, BOX_SIZE);
if (!piglit_probe_pixel_rgb(x + (BOX_SIZE / 2),
1 + (BOX_SIZE / 2),
color)) {
result = PIGLIT_FAIL;
}
}
glutSwapBuffers();
return result;
}
示例15: test
static GLboolean test()
{
GLint prog, location;
GLboolean pass = GL_TRUE;
int i;
float color[4] = {0, 0, 0, 1};
float DEGREES_30 = 0.523598776;
prog = setup_shaders();
location = glGetUniformLocation(prog, "a");
for (i = 0; i <= 50; i++) {
glUniform1f(location, (i - 25) * DEGREES_30);
piglit_draw_rect((i % 10) * 10, (i / 10) * 10, 10, 10);
}
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
for (i = 0; i <= 50; i++) {
color[0] = color[1] = sin((i - 25) * DEGREES_30) * 0.5 + 0.5;
pass = piglit_probe_pixel_rgb((i % 10) * 10 + 5, (i / 10) * 10 + 5, color) && pass;
}
return pass;
}