Files
magnum-boostrap-qtquick/README.md

27 lines
990 B
Markdown
Raw Normal View History

2020-06-23 16:39:30 -06:00
# Magnum + Qt Quick bootstrap
2020-06-23 20:07:48 -06:00
![Screen](images/screen.gif)
2020-06-23 18:36:33 -06:00
This app demonstrates Magnum rendering engine within a Qt Quick application, using
a shared framebuffer object..
2020-06-23 16:39:30 -06:00
## Common pitfalls
### Header inclusion order
2020-06-23 18:36:33 -06:00
Follow one simple rule: Always include Magnum's headers first. If you're including
your own headers, make sure that this rules is obeyed. It's very easy to violate it.
2020-06-23 16:39:30 -06:00
Common symptom is compiler errors about missing declarations for `glFinish`, `glFlush`
2020-06-23 18:36:33 -06:00
and `glGetError`, which some Qt headers (`QOpenGLFunctions`) are undefining.
2020-06-23 16:39:30 -06:00
For a bomb-proof solution, make a header file that includes all of your Magnum and Qt
dependencies in correct order.
### CMake AUTOMOC
CMake detects a Qt project and enables `moc` preprocessor automatically for certain
source files. This may not play well with Magnum's headers. If you see `moc` related
build errors in Magnum's headers, improve separation between Magnum and Qt code, ie.
move Magnum code to its own source files.