Add GLVND OpenGL detection as a GLX(X11) alternative and remove the glut header #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there @TurningWheel
I wanted Barony running on X11-less systems, which offer the lowest possible latency.
Since Barony runs on OpenGL (not GLES, to my knowledge) and accesses the GL functions directly, the only way is to add suport for the modern and vendor-neutral GLVND GL, which is provided by MESA when built with GLVND support on: this way, we don't depend on any X11-related library, yet we can have full OpenGL without X11.
I have also removed the line trying to use
glu.h
in src/main.hpp, since GLUT is not used anymore (Good! Old GLUT stuff is not needed anymore) and trying to useglu.h
causes building to fail on X11-less systems which of course don't have GLUT either.So: This allows the Barony engine to be built on modern GNU/Linux systems without depending on X11.
For example, I have just built it on my Raspberry Pi4 running aacrh64 GNU/Linux with latest stable MESA (21.0.1 as of today) with no X11.
(Just remember that MESA with GLVND support is needed for building against GLVND OpenGL! Most modern common desktop distros support it anyway.)