#define _GNU_SOURCE #if defined(_MSC_VER) #define bool BOOL #define true 1 #define false 0 #else #include #endif #include #include #include "piglit-gles2-util.h" #include "piglit-egl-gles2-framework.h" #include int piglit_width = 250, piglit_height = 250; const char *vs_code = "attribute vec4 piglit_Position;\n" "void main()\n" "{\n" " gl_Position = piglit_Position;\n" " gl_PointSize = 8.0;\n" "}\n"; const char *fs_code = "void main()\n" "{\n" " gl_FragColor = vec4(gl_PointCoord.xy,0.0,1.0);\n" "}\n"; enum piglit_result piglit_display(void) { GLboolean pass; GLboolean pass1; GLboolean pass2; GLfloat VexterTemp; int error = 0; GLuint myProgram, myVertex, myFrag; char info[100]; myVertex = glCreateShader(GL_VERTEX_SHADER); myFrag = glCreateShader(GL_FRAGMENT_SHADER); myProgram = glCreateProgram(); glBindAttribLocation(myProgram, PIGLIT_ATTRIB_POS, "piglit_Position"); glShaderSource(myVertex, 1, (const GLchar**)&vs_code,NULL); glShaderSource(myFrag, 1, (const GLchar**)&fs_code,NULL); glCompileShader(myVertex); glCompileShader(myFrag); glAttachShader(myProgram, myVertex); glAttachShader(myProgram, myFrag); glLinkProgram(myProgram); glUseProgram(myProgram); glViewport(0,0,piglit_width, piglit_height); glClear(GL_COLOR_BUFFER_BIT); GLfloat vVertices[] = {0.0f,0.0f,0.0f}; glVertexAttribPointer(PIGLIT_ATTRIB_POS,1,GL_FLOAT,GL_FALSE,0,vVertices); glEnableVertexAttribArray(PIGLIT_ATTRIB_POS); glDrawArrays(GL_POINTS,0,1); const float expected1[] = {0.375,0.375,0.0}; pass1 = piglit_probe_rect_rgb(124, 124, piglit_width, piglit_height, expected1); const float expected2[] = {0.5,0.5,0.0}; pass2 = piglit_probe_rect_rgb(125, 125, piglit_width, piglit_height, expected2); pass = pass1&&pass2; return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE; } void piglit_init(int argc, char **argv) { }