-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt: Replace QOpenGLWidget with QWidget #366
Conversation
e91fc2c
to
139c998
Compare
e40c204
to
32b9c06
Compare
Fixed. Didn't expect it to fire events so early.
It is quick. Had to wrestle with CMake so it finds the correct Python installation, pardon the CI spam. Still need someone to verify updated building instructions for macOS and FreeBSD. The last commit implements OpenGL context version checking. If it's not new enough (I'm looking at you, Intel HD 3000 on Windows), an error message is shown, and the program closes. Couldn't think of a better way than to introduce yet another initialization function, but perhaps some more stuff could be put into it in the future. If there are no objections on the current overall design, then I'll move the PR out of draft. |
No objections on my part. Just retested on Windows 10, seems to be fixed. Good job! |
Tested with both Qt 5 and 6 on Linux (X.org and Wayland sessions), but only with Qt 5 on Windows 10. Checked the error message by running with Oh, by the way, maybe check whether the changes affect #253. |
This PR switches
QOpenGLWidget
withQWidget
andQOpenGLContext
for context management and graphics output. Also, GLEW was replaced with glad, as otherwise Qt would complain about function redefinitions.Prerequisite for #332.
RFC. The changes seem to work just fine on Linux (both X11 and Wayland), but I have a couple of questions.
First of all, there are two ways to integrate glad: by including the pre-generated sources (like currently done in this PR), and (since 2.0.5) by generating sources via CMake during the build process. The latter option keeps the source tree cleaner, but introduces a build-time dependency on either system-provided glad generator or Python (for use with FetchContent-obtained glad). I'm leaning towards the latter option, in line with other external dependencies, but would like to get your preference.
Second, right now there's no handling of Qt creating <3.3 context. That's the case with
QOpenGLWidget
implementation as well. It's easy to check which context version you got and show a message box, but I'm not sure what to do afterwards: for instance, callingQCoreApplication::exit()
doesn't work untilexec()
is called. Best case, users will get a black screen, as shaders won't compile. Worst case, it can segfault due to calling null functions.Lastly, what is the convention on commit messages naming, specifically prefixes?