The GLWidget library contains a single class: GLWidget . The main purpose of this class, which is derived from QGLWidget, is to provide a very basic implementation of the well-known methods initializeGL() , paintGL() and resizeGL().
GLWidget has little OpenGL rendering code. Instead, most of the GLWidget implementation is devoted to enable users to load an arbitrary number of plugins that provide the typical functionalities of a 3D application: setting up the OpenGL state (for example, loading images to be used as textures), loading shaders, drawing the scene by issuing OpenGL rendering calls, and enabling some user interaction (object selection, camera control...).
GLWidget does not implement none of the functionalities above. These functionalities must be provided through plugins. Learning advanced Computer Graphics techniques through plugin development has multiple advantages: allows for very-focused, self-contained, independent exercises, enforces modularity and facillitates code reusability.
The viewer application makes use of this library. Indeed, the plugins you will create will also require using this library to get access to important objects such as the 3D scene and the camera.
The GLWidget class holds basically three different pieces of information:
Most of the code in GLWidget deals with invoking appropriate methods from the plugins. In a nutshell,
For further information, check the GLWidget class documentation.
Please remember that you should not modify any of the files of the glwidget library.
Remember that the plugins you write must work when linked with the original, unmodified files.