#include #include #include int main() { GLuint prog; const char *testcode = "!!ARBvp1.0\n" "PARAM C[66] = { program.env[0..65] };\n" "ADDRESS A0;" "ARL A0.x, 0.0;\n" "MOV result.position, C[A0.x + 65];\n" "END\n"; /* minimal initialization, to get gl up and running */ SDL_Init(SDL_INIT_VIDEO); SDL_SetVideoMode(320, 240, 32, SDL_OPENGL); /* create and bind a vertex program */ glGenProgramsARB(1, &prog); glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog); /* here's where we crash */ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(testcode), testcode); printf("This text will never be printed, as i965_dri.so" " segfaults before it has a chance to.\n"); /* clean up anyway, just for looks */ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0); glDeleteProgramsARB(1, &prog); SDL_Quit(); return 0; }