3D Studio
Computer Graphics and Visualization
Anton Eriksson (tfy12aen@cs.umu.se)
Department of Computing Science
Umeå University
System design
Written in C++
GLFW for GL context
GLM for vectors/matrices
GTK for GUI. (Thought about using gtkmm.)
(Almost) no global variables! (Save for GTK objects.)
A WindowManager class effectively acts as a singleton through glfwSetWindowUserPointer. (Worse?)
Source code
-
Not a lot of code in main.cpp
3d-studio git/master
❯ wc -l *.{cpp,c,h}
114 main.cpp
[...]
2351 total
-
Even less in the main loop
while (!window->shouldClose()) {
buffer->clear();
updateUniforms();
buffer->draw();
window->swapBuffers();
gtk_main_iteration_do(0);
}
Reflections
- Would prefer OOP GUI lib GL context directly,
e.g. QT, gtkmm.
- Biggest hurdle: make GTK + GLFW not segfault on my machine. ~ 20 h of debugging.
- Still haven't found a way to run my application under a profiler.
- Maybe not the best situation to learn C++.
- The incremental addition of features made the design somewhat crufty, but most of the
initial design stuck.
3D Studio
Computer Graphics and Visualization
Anton Eriksson (tfy12aen@cs.umu.se)
Department of Computing Science
Umeå University