1 2/* 3 * Print GL, GLU and GLUT version and extension info 4 * 5 * Brian Paul This file in public domain. 6 * October 3, 1997 7 */ 8 9 10#include <stdio.h> 11#include "glut_wrap.h" 12 13 14int main( int argc, char *argv[] ) 15{ 16 glutInit( &argc, argv ); 17 glutInitDisplayMode( GLUT_RGB ); 18 glutCreateWindow(argv[0]); 19 20 printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION)); 21 printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER)); 22 printf("GL_VENDOR: %s\n", (char *) glGetString(GL_VENDOR)); 23 printf("GL_EXTENSIONS: %s\n", (char *) glGetString(GL_EXTENSIONS)); 24 25#ifdef GL_VERSION_2_0 26 { 27 const GLubyte *v = glGetString(GL_VERSION); 28 if (v[0] * 10 + v[2] >= 20) { 29 const GLubyte *slv = glGetString(GL_SHADING_LANGUAGE_VERSION); 30 printf("GL_SHADING_LANGUAGE_VERSION = %s\n", slv); 31 } 32 } 33#endif 34 35 printf("GLU_VERSION: %s\n", (char *) gluGetString(GLU_VERSION)); 36 printf("GLU_EXTENSIONS: %s\n", (char *) gluGetString(GLU_EXTENSIONS)); 37 printf("GLUT_API_VERSION: %d\n", GLUT_API_VERSION); 38#ifdef GLUT_XLIB_IMPLEMENTATION 39 printf("GLUT_XLIB_IMPLEMENTATION: %d\n", GLUT_XLIB_IMPLEMENTATION); 40#endif 41 42 return 0; 43} 44