example.cpp 527 B

12345678910111213141516171819202122
  1. #ifdef __APPLE__
  2. # include <GLUT/glut.h>
  3. #else
  4. # include <GL/glut.h>
  5. #endif
  6. #include <cstdio>
  7. int main(int argc,char * argv[])
  8. {
  9. // Make GLUT window just to get a valid OpenGL context
  10. glutInit(&argc,argv);
  11. glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
  12. glutInitWindowSize(640, 480);
  13. glutCreateWindow("Dummy");
  14. glutCreateMenu(NULL);
  15. printf("GL_VERSION: %s\n",
  16. glGetString(GL_VERSION));
  17. printf("GL_SHADING_LANGUAGE_VERSION: %s\n",
  18. glGetString(GL_SHADING_LANGUAGE_VERSION));
  19. return 0;
  20. }