本文整理汇总了C++中piglit_probe_pixel_rgb函数的典型用法代码示例。如果您正苦于以下问题:C++ piglit_probe_pixel_rgb函数的具体用法?C++ piglit_probe_pixel_rgb怎么用?C++ piglit_probe_pixel_rgb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了piglit_probe_pixel_rgb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:nobled,项目名称:piglit,代码行数:27,代码来源:fbo-drawbuffers-maxtargets.c
示例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;
}
开发者ID:dumbbell,项目名称:piglit,代码行数:35,代码来源:clipped-geometry-flatshading.c
示例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;
}
开发者ID:RAOF,项目名称:piglit,代码行数:30,代码来源:glx-destroycontext-2.c
示例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;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:33,代码来源:oes_compressed_etc1_rgb8_texture-basic.c
示例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;
}
开发者ID:RAOF,项目名称:piglit,代码行数:31,代码来源:oes_draw_texture.c
示例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;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:26,代码来源:cube.c
示例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;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:29,代码来源:glsl-fs-fragcoord.c
示例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;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:32,代码来源:fbo-1d.c
示例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;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:25,代码来源:sso-uniforms-02.c
示例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;
}
开发者ID:RAOF,项目名称:piglit,代码行数:28,代码来源:vp-clipdistance-03.c
示例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;
}
开发者ID:nobled,项目名称:piglit,代码行数:25,代码来源:scissor-copypixels.c
示例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;
}
开发者ID:aphogat,项目名称:piglit,代码行数:27,代码来源:user-clip.c
示例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;
}
开发者ID:RAOF,项目名称:piglit,代码行数:33,代码来源:draw-vertices.c
示例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;
}
开发者ID:nobled,项目名称:piglit,代码行数:32,代码来源:fp-abs-01.c
示例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;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:25,代码来源:glsl-sin.c
示例16: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
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);
}
/* walk over rows */
for (count = 1; count <= max_targets; count++) {
/* walk over columns */
for (i = 0; i < count; i++) {
pass = pass &&
piglit_probe_pixel_rgb(16 * i + 8,
16 * (count - 1) + 8,
colors[i]);
}
}
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:29,代码来源:fbo-drawbuffers-maxtargets.c
示例17: piglit_display
enum piglit_result
piglit_display(void)
{
#ifdef GL_ARB_ES2_compatibility
GLboolean pass = GL_TRUE;
float red[4] = {1.0, 0.0, 0.0, 0.0};
float green[4] = {0.0, 1.0, 0.0, 0.0};
float blue[4] = {0.0, 0.0, 1.0, 0.0};
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glClearColor(0.0, 0.0, 1.0, 0.0);
glClearDepthf(0.5);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
/* Keep in mind that the ortho projection flips near and far's signs,
* so 1.0 to quad()'s z maps to glDepthRange's near, and -1.0 maps to
* glDepthRange's far.
*/
glColor4fv(green);
glDepthRangef(0, 1);
piglit_draw_rect_z(0.5,
0, 0,
piglit_width / 2, piglit_height);
glColor4fv(red);
glDepthRangef(1, 0);
piglit_draw_rect_z(0.5,
piglit_width / 2, 0,
piglit_width, piglit_height);
pass = piglit_probe_pixel_rgb(piglit_width * 1 / 4, piglit_height / 2,
green) && pass;
pass = piglit_probe_pixel_rgb(piglit_width * 3 / 4, piglit_height / 2,
blue) && pass;
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
#else
return PIGLIT_SKIP;
#endif /* GL_ARB_ES2_compatibility */
}
开发者ID:nobled,项目名称:piglit,代码行数:47,代码来源:arb_es2_compatibility-depthrangef.c
示例18: probe_cell
static void probe_cell(const char* testname, int x, int y, const float* expected)
{
if (!piglit_probe_pixel_rgb((2*x+1)*piglit_width/8, (2*y+1)*piglit_height/8, expected)) {
fprintf(stderr, "%s: %i,%i failed\n", testname, x, y);
if (piglit_automatic)
piglit_report_result(PIGLIT_FAIL);
}
}
开发者ID:RAOF,项目名称:piglit,代码行数:8,代码来源:texgen.c
示例19: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
GLuint tex;
int x1 = piglit_width / 4;
int x2 = (piglit_width / 4) * 3;
int y1 = piglit_height / 4;
int y2 = (piglit_height / 4) * 3;
float c1[3] = {0.25, 0.25, 0.25};
float c2[3] = {0.75, 0.25, 0.25};
float c3[3] = {0.25, 0.75, 0.75};
float c4[3] = {0.75, 0.75, 0.75};
glClearColor(0.5, 0.5, 0.5, 0.5);
glClear(GL_COLOR_BUFFER_BIT);
tex = create_fbo();
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
draw_tex_sub_rect(x1, y1);
draw_tex_sub_rect(x2, y1);
draw_tex_sub_rect(x1, y2);
draw_tex_sub_rect(x2, y2);
pass &= piglit_probe_pixel_rgb(x1, y1, c1);
pass &= piglit_probe_pixel_rgb(x2, y1, c2);
pass &= piglit_probe_pixel_rgb(x1, y2, c3);
pass &= piglit_probe_pixel_rgb(x2, y2, c4);
glDeleteTextures(1, &tex);
glDisable(GL_TEXTURE_2D);
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:blaztinn,项目名称:piglit,代码行数:46,代码来源:fbo-maxsize.c
示例20: piglit_display
PIGLIT_GL_TEST_CONFIG_END
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
static float blue[] = {0.0, 0.0, 1.0, 0.0};
float *pixels;
GLuint pbo;
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glClearColor(0.5, 0.5, 0.5, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glGenBuffersARB(1, &pbo);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, pbo);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER, 4 * 4 * sizeof(float),
NULL, GL_STREAM_DRAW_ARB);
pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY_ARB);
memcpy(pixels + 0, red, sizeof(red));
memcpy(pixels + 4, green, sizeof(green));
memcpy(pixels + 8, blue, sizeof(blue));
memcpy(pixels + 12, red, sizeof(red));
glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER);
glRasterPos2i(10, 10);
glDrawPixels(2, 2, GL_RGBA, GL_FLOAT, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0);
glDeleteBuffersARB(1, &pbo);
pass &= piglit_probe_pixel_rgb(10, 10, red);
pass &= piglit_probe_pixel_rgb(11, 10, green);
pass &= piglit_probe_pixel_rgb(10, 11, blue);
pass &= piglit_probe_pixel_rgb(11, 11, red);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:45,代码来源:pbo-drawpixels.c
注:本文中的piglit_probe_pixel_rgb函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论