Im using OS X and QT. On my mac i can easily find GLUT.framework installed in my libraries, but when i try to use it in QT, it just throws me an error:
/Users/Astroy/ProjektiQT/RacunalniskaGrafika1-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Debug/…/RacunalniskaGrafika1/main.cpp:3:
error: GL/glut.h: No such file or directory
and because of that also:
error: ‘glutInit’ was not declared in this scope
GLUT+Qt == asking for trouble. GLUT provides making a window, some UI stuff, it’s own “event system” etc. The Qt SDK from Nokia(or I guess now Digia) does NOT include GLUT, nor should it (it looks like your environment is MS-Windows).
If you are already having Qt as a dependency, why would you want to use GLUT? The ritual for using GL on Qt is roughly:
[ol]
[li]Derive from QGLWidget[/li][li]Optionally implement initializeGL() to perform one-time init that requires a GL context. This is done because in Qt, the GL context is not active (or even made actually) at constructor of QGLWidget.[/li][li]Implement paintGL() to do your drawing[/li][li]Implement various event handling functions: mousePressEvent, mouseReleaseEvent, mouseMoveEvent, keyPressEvent, keyReleaseEvent, etc. Optionally implement resizeGL to capture when your window changes sizes (reimplement resizeGL, NOT resizeEvent to make sure your GL context is current).[/li][/ol]