本文整理汇总了C++中piglit_ortho_projection函数的典型用法代码示例。如果您正苦于以下问题:C++ piglit_ortho_projection函数的具体用法?C++ piglit_ortho_projection怎么用?C++ piglit_ortho_projection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了piglit_ortho_projection函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: create_fbo
static int
create_fbo(void)
{
GLuint tex, fb;
GLenum status;
int i, dim;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA,
dim, dim,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "FBO incomplete\n");
goto done;
}
glViewport(0, 0, TEX_WIDTH, TEX_HEIGHT);
piglit_ortho_projection(TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
glColor4fv(red);
piglit_draw_rect(0, 0, TEX_WIDTH / 2, TEX_HEIGHT / 2);
glColor4fv(green);
piglit_draw_rect(TEX_WIDTH / 2, 0, TEX_WIDTH, TEX_HEIGHT / 2);
glColor4fv(blue);
piglit_draw_rect(0, TEX_HEIGHT / 2, TEX_WIDTH/2, TEX_HEIGHT);
glColor4fv(white);
piglit_draw_rect(TEX_WIDTH / 2, TEX_HEIGHT / 2, TEX_WIDTH, TEX_HEIGHT);
glScissor(10, 10, 10, 10);
glEnable(GL_SCISSOR_TEST);
glGenerateMipmapEXT(GL_TEXTURE_2D);
glDisable(GL_SCISSOR_TEST);
done:
glDeleteFramebuffersEXT(1, &fb);
return tex;
}
开发者ID:nobled,项目名称:piglit,代码行数:54,代码来源:fbo-generatemipmap-scissor.c
示例2: piglit_init
void
piglit_init(int argc, char **argv)
{
printf("The test's expectation is that the implementation samples\n"
"at pixel centers to produce fragments, so the fourth\n"
"(subpixel offset = 0.6) rectangle in each axis will\n"
"be offset compared to the previous.\n\n");
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:11,代码来源:fragment-center.c
示例3: create_array_fbo_2d
static GLuint
create_array_fbo_2d(void)
{
GLuint tex, fb;
GLenum status;
int i, dim;
int layer;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
assert(glGetError() == 0);
for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, i, format,
dim, dim, num_layers, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
for (layer = 0; layer < num_layers; layer++) {
glFramebufferTextureLayer(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
tex,
0,
layer);
assert(glGetError() == 0);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
load_texture_2d_array();
goto done;
}
glViewport(0, 0, TEX_WIDTH, TEX_HEIGHT);
piglit_ortho_projection(TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
glColor4fv(layer_color[layer]);
piglit_draw_rect(0, 0, TEX_WIDTH / 2, TEX_HEIGHT / 2);
glColor4fv(green);
piglit_draw_rect(TEX_WIDTH / 2, 0, TEX_WIDTH, TEX_HEIGHT / 2);
glColor4fv(blue);
piglit_draw_rect(0, TEX_HEIGHT / 2, TEX_WIDTH/2, TEX_HEIGHT);
glColor4fv(white);
piglit_draw_rect(TEX_WIDTH / 2, TEX_HEIGHT / 2, TEX_WIDTH, TEX_HEIGHT);
}
done:
glGenerateMipmapEXT(GL_TEXTURE_2D_ARRAY_EXT);
glDeleteFramebuffersEXT(1, &fb);
return tex;
}
开发者ID:aphogat,项目名称:piglit,代码行数:54,代码来源:fbo-generatemipmap-array.c
示例4: piglit_init
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
exit(1);
}
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
开发者ID:blaztinn,项目名称:piglit,代码行数:11,代码来源:glsl-dlist-getattriblocation.c
示例5: create_3d_fbo
static int
create_3d_fbo(void)
{
GLuint tex, fb;
GLenum status;
int depth;
pot_depth = piglit_is_extension_supported("GL_ARB_texture_non_power_of_two") ?
NUM_DEPTHS: POT_DEPTHS;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_3D, tex);
/* allocate empty 3D texture */
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA,
BUF_WIDTH, BUF_HEIGHT, pot_depth,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
/* draw something into each slice of the 3D texture */
for (depth = 0; depth < NUM_DEPTHS; depth++) {
glFramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_3D,
tex,
0,
depth);
assert(glGetError() == 0);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "FBO incomplete\n");
goto done;
}
glViewport(0, 0, BUF_WIDTH, BUF_HEIGHT);
piglit_ortho_projection(BUF_WIDTH, BUF_HEIGHT, GL_FALSE);
/* solid color quad */
glColor4fv(depth_color[depth]);
piglit_draw_rect(-2, -2, BUF_WIDTH + 2, BUF_HEIGHT + 2);
}
done:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glDeleteFramebuffersEXT(1, &fb);
return tex;
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:54,代码来源:fbo-3d.c
示例6: create_fbo
static int
create_fbo(void)
{
GLuint tex, copied_tex, fb;
GLenum status;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
TEX_WIDTH, TEX_HEIGHT,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "FBO incomplete\n");
piglit_report_result(PIGLIT_SKIP);
}
glViewport(0, 0, TEX_WIDTH, TEX_HEIGHT);
piglit_ortho_projection(TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
glColor4fv(red);
piglit_draw_rect(0, 0, TEX_WIDTH / 2, TEX_HEIGHT / 2);
glColor4fv(green);
piglit_draw_rect(TEX_WIDTH / 2, 0, TEX_WIDTH, TEX_HEIGHT / 2);
glColor4fv(blue);
piglit_draw_rect(0, TEX_HEIGHT / 2, TEX_WIDTH/2, TEX_HEIGHT);
glColor4fv(white);
piglit_draw_rect(TEX_WIDTH / 2, TEX_HEIGHT / 2, TEX_WIDTH, TEX_HEIGHT);
glGenTextures(1, &copied_tex);
glBindTexture(GL_TEXTURE_2D, copied_tex);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, TEX_WIDTH, TEX_HEIGHT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glDeleteFramebuffersEXT(1, &fb);
glDeleteTextures(1, &tex);
return copied_tex;
}
开发者ID:aphogat,项目名称:piglit,代码行数:53,代码来源:fbo-copyteximage-simple.c
示例7: piglit_init
void piglit_init(int argc, char **argv)
{
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
glShadeModel(GL_FLAT);
glClearColor(0.2, 0.2, 0.2, 1.0);
}
开发者ID:nobled,项目名称:piglit,代码行数:12,代码来源:draw-vbo-bounds.c
示例8: piglit_display
PIGLIT_GL_TEST_CONFIG_END
enum piglit_result
piglit_display(void)
{
bool pass = true;
float green[] = {0, 1, 0, 0};
float clear[] = {0, 0, 0, 0};
piglit_ortho_projection(piglit_width, piglit_height, false);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor4f(0, 1, 0, 0);
/* Draw a rectangle, but set the flag to false for the verticals. */
glBegin(GL_QUADS);
glEdgeFlag(GL_TRUE);
glVertex2f(1.5, 1.5);
glEdgeFlag(GL_FALSE);
glVertex2f(5.5, 1.5);
glEdgeFlag(GL_TRUE);
glVertex2f(5.5, 5.5);
glEdgeFlag(GL_FALSE);
glVertex2f(1.5, 5.5);
glEdgeFlag(GL_TRUE);
glVertex2f(11.5, 1.5);
glEdgeFlag(GL_FALSE);
glVertex2f(15.5, 1.5);
glEdgeFlag(GL_TRUE);
glVertex2f(15.5, 5.5);
glEdgeFlag(GL_FALSE);
glVertex2f(11.5, 5.5);
glEnd();
pass = piglit_probe_pixel_rgba(3, 1, green) && pass;
pass = piglit_probe_pixel_rgba(3, 5, green) && pass;
pass = piglit_probe_pixel_rgba(1, 3, clear) && pass;
pass = piglit_probe_pixel_rgba(5, 3, clear) && pass;
pass = piglit_probe_pixel_rgba(13, 1, green) && pass;
pass = piglit_probe_pixel_rgba(13, 5, green) && pass;
pass = piglit_probe_pixel_rgba(11, 3, clear) && pass;
pass = piglit_probe_pixel_rgba(15, 3, clear) && pass;
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:53,代码来源:edgeflag-quads.c
示例9: piglit_init
void
piglit_init(int argc, char**argv)
{
piglit_require_extension("GL_EXT_framebuffer_object");
HaveExtension[0] = GL_TRUE;
HaveExtension[EXT_packed_depth_stencil] = glutExtensionSupported("GL_EXT_packed_depth_stencil");
HaveExtension[ARB_framebuffer_object] = glutExtensionSupported("GL_ARB_framebuffer_object");
HaveExtension[ARB_texture_rg] = glutExtensionSupported("GL_ARB_texture_rg");
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
开发者ID:nobled,项目名称:piglit,代码行数:12,代码来源:fbo-storage-formats.c
示例10: piglit_init
void
piglit_init(int argc, char **argv)
{
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
piglit_require_extension("GL_ARB_vertex_buffer_object");
glGenBuffersARB(1, &vbo);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 12 * sizeof(GLfloat),
NULL, GL_DYNAMIC_DRAW);
}
开发者ID:RAOF,项目名称:piglit,代码行数:12,代码来源:vbo-bufferdata.c
示例11: framebuffer_srgb_non_fbo
static GLboolean
framebuffer_srgb_non_fbo(void)
{
GLboolean pass;
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
pass = test_srgb();
piglit_present_results();
return pass;
}
开发者ID:RAOF,项目名称:piglit,代码行数:12,代码来源:framebuffer-srgb.c
示例12: create_array_fbo
static int
create_array_fbo(void)
{
GLuint tex, fb;
GLenum status;
int layer;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* allocate empty array texture */
glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, 0, GL_RGBA,
BUF_WIDTH, BUF_HEIGHT, num_layers,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
/* draw something into each layer of the array texture */
for (layer = 0; layer < NUM_LAYERS; layer++) {
glFramebufferTextureLayer(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
tex,
0,
layer);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
fprintf(stderr, "FBO incomplete\n");
goto done;
}
glViewport(0, 0, BUF_WIDTH, BUF_HEIGHT);
piglit_ortho_projection(BUF_WIDTH, BUF_HEIGHT, GL_FALSE);
/* solid color quad */
glColor4fv(layer_color[layer]);
piglit_draw_rect(-2, -2, BUF_WIDTH + 2, BUF_HEIGHT + 2);
}
done:
glDeleteFramebuffersEXT(1, &fb);
return tex;
}
开发者ID:chemecse,项目名称:piglit,代码行数:53,代码来源:fbo-array.c
示例13: piglit_init
void
piglit_init(int argc, char**argv)
{
enum piglit_result result;
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
piglit_require_extension("GL_ARB_blend_func_extended");
glGetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, &max_ds_buffers);
result = test();
piglit_report_result(result);
}
开发者ID:blaztinn,项目名称:piglit,代码行数:13,代码来源:fbo-extended-blend.c
示例14: piglit_init
void
piglit_init(int argc, char **argv)
{
glClearColor(0.0, 0.2, 0.3, 0.0);
glClearDepth(1.0);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
piglit_require_extension("GL_ARB_occlusion_query");
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
开发者ID:BNieuwenhuizen,项目名称:piglit,代码行数:13,代码来源:occlusion_query_conform.c
示例15: piglit_display
enum piglit_result
piglit_display(void)
{
GLboolean pass = GL_TRUE;
int x, y;
static float red[] = {1.0, 0.0, 0.0, 0.0};
static float green[] = {0.0, 1.0, 0.0, 0.0};
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glEnable(GL_DEPTH_TEST);
glClearColor(0.0, 1.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor4fv(red);
glClearDepth(0.5);
glClear(GL_DEPTH_BUFFER_BIT);
draw_rect_set(10);
glDepthRange(0.5, 1.0);
glClearDepth(0.5);
glClear(GL_DEPTH_BUFFER_BIT);
glDepthRange(0.0, 1.0);
draw_rect_set(30);
glDepthRange(0.0, 0.5);
glClearDepth(0.5);
glClear(GL_DEPTH_BUFFER_BIT);
glDepthRange(0.0, 1.0);
draw_rect_set(50);
for (y = 0; y < 3; y++) {
for (x = 0; x < 4; x++) {
float *expected;
if (x < 2)
expected = green;
else
expected = red;
pass &= piglit_probe_pixel_rgb(15 + x * 20, 15 + y * 20,
expected);
}
}
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:nobled,项目名称:piglit,代码行数:51,代码来源:depthrange-clear.c
示例16: 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;
int cx = piglit_width / 2;
int cy = piglit_height / 2;
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};
float white[3] = {1.0, 1.0, 1.0};
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);
draw_tex_sub_rect(cx, cy);
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);
pass &= piglit_probe_pixel_rgb(cx, cy, white);
glDeleteTextures(1, &tex);
glDisable(GL_TEXTURE_2D);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:RAOF,项目名称:piglit,代码行数:51,代码来源:fbo-maxsize.c
示例17: piglit_init
void
piglit_init(int argc, char **argv)
{
piglit_require_gl_version(20);
compileLinkProg();
loadTex();
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glEnable(GL_TEXTURE_2D);
glClearColor(0.6, 0.6, 0.6, 1.0);
}
开发者ID:kphillisjr,项目名称:piglit,代码行数:14,代码来源:glsl-fwidth.c
示例18: piglit_display
enum piglit_result
piglit_display(void)
{
bool pass = true;
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Clear the whole first texture with green */
glClearTexImage(texture[0], 0, GL_RGB, GL_FLOAT, green);
pass &= piglit_check_gl_error(GL_NO_ERROR);
/* Clear the left half of the second texture with blue */
glClearTexSubImage(texture[1], 0,
0, 0, 0,
32, 64, 1,
GL_RGB, GL_FLOAT, blue);
pass &= piglit_check_gl_error(GL_NO_ERROR);
/* And the right half with yellow */
glClearTexSubImage(texture[1], 0,
32, 0, 0,
32, 64, 1,
GL_RGB, GL_FLOAT, yellow);
pass &= piglit_check_gl_error(GL_NO_ERROR);
/* Render both textures to the screen */
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(GL_TEXTURE_2D, texture[0]);
piglit_draw_rect_tex(0, 0, 64, 64, 0, 0, 1, 1);
glBindTexture(GL_TEXTURE_2D, texture[1]);
piglit_draw_rect_tex(64, 0, 64, 64, 0, 0, 1, 1);
glDisable(GL_TEXTURE_2D);
glDeleteTextures(2, texture);
/* Check for the 3 separate regions */
pass &= piglit_probe_rect_rgb(0, 0, 64, 64, green);
pass &= piglit_probe_rect_rgb(64, 0, 32, 64, blue);
pass &= piglit_probe_rect_rgb(96, 0, 32, 64, yellow);
piglit_present_results();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
开发者ID:aphogat,项目名称:piglit,代码行数:50,代码来源:simple.c
示例19: hiz_run_test_stencil_test_common
/**
* Common functionality needed by hiz_run_test_stencil_test_fbo() and
* hiz_run_test_stencil_test_window().
*/
static bool
hiz_run_test_stencil_test_common()
{
static const float *expected_colors[9] = {
hiz_grey, hiz_blue, hiz_grey,
hiz_green, hiz_blue, hiz_grey,
hiz_green, hiz_green, hiz_grey,
};
const float dx = piglit_width / 3.0;
const float dy = piglit_height / 3.0;
/* Set up depth state. */
glDisable(GL_DEPTH_TEST);
glClearDepth(hiz_clear_z);
/* Set up stencil state. */
glEnable(GL_STENCIL_TEST);
glClearStencil(3); /* 3 is a good canary. */
glStencilFunc(GL_LESS, 3, ~0);
glStencilOp(GL_INCR, GL_INCR, GL_INCR);
glClearColor(hiz_grey[0], hiz_grey[1], hiz_grey[2], hiz_grey[3]);
glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
| GL_STENCIL_BUFFER_BIT);
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, false);
/* Draw rect 1. */
glColor4fv(hiz_grey);
piglit_draw_rect(0 * dx, 0 * dy, /* x, y */
2 * dx, 3 * dy); /* w, h */
/* Draw rect 2. */
glColor4fv(hiz_green);
piglit_draw_rect(0 * dx, 0 * dy, /* x, y */
2 * dx, 2 * dy); /* w, h */
/* Draw rect 3. */
glColor4fv(hiz_blue);
piglit_draw_rect(1 * dx, 1 * dy, /* x, y */
2 * dx, 2 * dy); /* w, h */
if (!piglit_check_gl_error(0))
return false;
return hiz_probe_color_buffer(expected_colors);
}
开发者ID:ThirteenFish,项目名称:piglit,代码行数:54,代码来源:hiz-util.c
示例20: piglit_init
void
piglit_init(int argc, char **argv)
{
piglit_require_gl_version(14);
piglit_require_extension("GL_EXT_vertex_array_bgra");
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glEnable(GL_COLOR_SUM);
glColor3f(0.0, 0.0, 0.0);
glClearColor(0.6, 0.6, 0.6, 1.0);
}
开发者ID:chadversary,项目名称:piglit,代码行数:14,代码来源:bgra-sec-color-pointer.c
注:本文中的piglit_ortho_projection函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论