luciusDXL / TheForceEngine

Modern "Jedi Engine" replacement supporting Dark Forces, mods, and in the future Outlaws.
https://TheForceEngine.github.io
GNU General Public License v2.0
976 stars 71 forks source link

Drop GLEW in favour of built-in GLAD #418

Closed mlauss2 closed 2 months ago

mlauss2 commented 3 months ago

Drop GLEW in favor of GLAD-generated built-in loader.

The GLAD loader is GL4.6, while TFE's minimum is still GL3.3; the Anisotropy stuff, which is core GL4.5, has been wrapped around availability of EXT_texture_filter_anisotropic (which most GL2 drivers support).

This PR also updates ImGUI to version 1.90.9 because after the current in-tree 1.72 it also dropped GLEW.

This should also fix #395 which was caused by TFE explicitly linking to an OpenGL library, which, after this PR, is no longer necessary.

After applying this PR, the dependencies change to:

-Shared library: [libOpenGL.so.0]
-Shared library: [libGLX.so.0]
-Shared library: [libGLU.so.1]
-Shared library: [libGLEW.so.2.2]
-Shared library: [libGL.so.1]
-Shared library: [libX11.so.6]
 Shared library: [libSDL2-2.0.so.0]
 Shared library: [libSDL2_image-2.0.so.0]
 Shared library: [librtmidi.so.7]

i.e. no explicit dependency on OpenGL and windowing system, just SDL2.

Another nice sideeffect at least on Linux is that "zink" (OpenGL over Vulkan) also works now: image Performance on my radeon is about 66% of the direct opengl path.

mlauss2 commented 2 months ago

editor needs more imgui fixing

mlauss2 commented 2 months ago

I fixed up the non-opening modal windows in the editor.

mlauss2 commented 2 months ago

I've also now tested this successfully on Windows as well.

mlauss2 commented 2 months ago

I've split the 2 patches into separate PRs (with #421 to start)

luciusDXL commented 2 months ago

I don't have any specific attachment to GLEW (other than using it in several projects), so this seems fine. I will patch it in after the next release.