/** * Shader runner for OpenGL * * author Sun Yi */ #include "piglit-util.h" #include "piglit-framework.h" int piglit_window_mode = GLUT_RGB; int piglit_width = 250, piglit_height = 250; char test[255]; const char *vs_code = "attribute float VertexTemp;" "void main()\n\0" "{\n" " gl_Position = VertexTemp; // vec4(1.0,0.0,0.0,0.0); //piglit_Position;\n" "}\n"; const char *fs_code = "void main()\n" "{\n" " gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n" "}\n"; enum piglit_result piglit_display(void) { GLboolean pass; GLfloat VexterTemp; int error = 0; GLuint myProgram, myVertex, myFrag; myVertex = glCreateShader(GL_VERTEX_SHADER); myFrag = glCreateShader(GL_FRAGMENT_SHADER); myProgram = glCreateProgram(); glAttachShader(myProgram, myVertex); glAttachShader(myProgram, myFrag); glShaderSource(myVertex, 1, (const GLchar**)&vs_code,NULL); glShaderSource(myFrag, 1, (const GLchar**)&fs_code,NULL); glCompileShader(myVertex); glCompileShader(myFrag); glLinkProgram(myProgram); glVertexAttrib1f(0,234.5); glGetVertexAttribfv(0,GL_CURRENT_VERTEX_ATTRIB,&VexterTemp); error = glGetError(); if(error == GL_NO_ERROR && 234.5 == VexterTemp) pass = GL_TRUE; else pass = GL_FALSE; return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE; } void piglit_init(int argc, char **argv) { }