Created
June 8, 2009 20:25
-
-
Save torsten/126040 to your computer and use it in GitHub Desktop.
Prints all available OpenGL extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -g -framework OpenGL -framework GLUT glextensions.c -o glextensions | |
#include <stdio.h> | |
#ifdef __APPLE__ | |
#include <OpenGL/gl.h> | |
#include <GLUT/glut.h> | |
#else | |
#include <GL/gl.h> | |
#include <GL/glut.h> | |
#endif | |
int main( int argc, char** argv ) | |
{ | |
glutInit(&argc, argv); | |
glutInitWindowSize(1, 1); | |
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE); | |
glutCreateWindow("(glextensions)"); | |
glEnable(GL_NORMALIZE); | |
char* ptr = (char*)glGetString(GL_EXTENSIONS); | |
if( ptr == NULL ) | |
{ | |
puts("argh, no extensions.."); | |
return -1; | |
} | |
for( ; *(ptr); ptr++ ) | |
switch( *ptr ) | |
{ | |
case 0: | |
case ' ': | |
putchar('\n'); | |
break; | |
default: | |
putchar(*ptr); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment