Ejemplo n.º 1
0
void
piglit_init(int argc, char **argv)
{
	tex = make_depth_texture();
	prog = make_shader_program();
	vao = make_vao();
}
Ejemplo n.º 2
0
void
piglit_init(int argc, char **argv)
{
	piglit_require_extension("GL_ARB_post_depth_coverage");
	prog1 = make_shader_program1();
	prog2 = make_shader_program2();
	vao = make_vao();
	ssbo = make_ssbo();
}
Ejemplo n.º 3
0
VAO make_grid(unsigned span)
{
    if(!(span%2)) ++span;

    VAO vao = make_vao();

    unsigned vertex_count = 3*2*2*span;
    float start_coord = -(span-1.0f) / 2.0f;

    float vertices[vertex_count];

    int line_index = 0;
    for(unsigned i=0; i<vertex_count; )
    {
        vertices[i++] = start_coord + line_index;
        vertices[i++] = 0.0f;
        vertices[i++] = start_coord;

        vertices[i++] = start_coord + line_index;
        vertices[i++] = 0.0f;
        vertices[i++] = -start_coord;

        vertices[i++] = start_coord;
        vertices[i++] = 0.0f;
        vertices[i++] = start_coord + line_index;

        vertices[i++] = -start_coord;
        vertices[i++] = 0.0f;
        vertices[i++] = start_coord + line_index;

        ++line_index;
    }

    unsigned vbo = make_vbo(vertices, sizeof(vertices));
    glBindBuffer(GL_ARRAY_BUFFER, vbo);

    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
    glEnableVertexAttribArray(0);

    vao.count = sizeof(vertices) / sizeof(float) / 3;
    vao.mode = GL_LINES;

    return vao;
}