GLUT (OpenGL Utility Toolkit) ist eine Bibliothef für OpenGL.
#include <GL/glut.h> void init(void) { glClearColor(0.0, 0.0, 0.0, 0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); } void display(void) { glClear(GL_COLOR_BUFFER_BIT); glFlush(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(800,600); glutInitWindowPosition(100,100); glutCreateWindow("OpenGL Glut"); init(); glutDisplayFunc(display); glutMainLoop(); return 0; }