Right now, a game that build with GLFW is not supported. Because GLFW require window manager (X11, Wayland, etc.). Most handheld only support KMS/DRM (with OpenGL ES).
There are 2 solutions:
- If the game is open source and use GLFW then replace GLFW with SDL.
- Overhaul GLFW library so that can support KMS DRM.
Each solution has plus and minus.
Solution No 1:
- It's theoretically doable.
- If the game is updated then the port may need to be updated too.
Solution No 2:
- (until now) the GLFW developer is not interested in this option and none haven't done yet.
- The port will be easier to keep up with the source of the game development. Just recompile / rebuild it.
So here is the good news...
I've learned about KMS/DRM how it works.
I've learned about the structure of GLFW library.
And here is the result:
a GLFW library with KMS/DRM support
The library is based in GLFW version 3.5.
The library i made is far from perfect. But it can do basic support for handheld (include gamepad support)
Build it in Linux aarch64.
How to build GLFW that support KMS/DRM:
git clone https://github.com/leonkasovan/glfw-plus.git
cmake -B build -D GLFW_BUILD_X11=0 -D GLFW_BUILD_WAYLAND=0 -D GLFW_BUILD_KMSDRM=1 .
make -j8 -C build
it will generate static and dynamic library.
It also build examples that use GLFW.
To test it, run this example in handheld:
./build/examples/triangle-opengles