Page MenuHomeWildfire Games

[WIP] Libepoxy GL loader
AbandonedPublic

Authored by Stan on Jul 13 2020, 5:42 PM.

Details

Reviewers
vladislavbelov
Summary

Currently we depend on a bunch of files for all platforms save linux to get the GL headers, this is problematic because that forces us to add new code each time we neeed it .
another alternative is D721 an advantage of libepoxy is that it doesn't need initialization and shouldn't add more platform specific features. A downside is that it requires python and meson to build, and it can be a little tricky on mac if you do not use brew or something.

epoxy has another advantage compared to glad, which is to alias identical functions coming from different extensions.

On windows

I unzipped the 1.5.4 archive in \libraries\source\libepoxy

I had to patch a file

and ran

REM Add the vs variables
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86
meson
ninja -j13
Test Plan

Compile and run the game

Event Timeline

Stan created this revision.Jul 13 2020, 5:42 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2631/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2098/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/999/display/redirect

Thanks!

source/lib/external_libraries/glext_funcs.h
131

You can now remove all (?) of these, as epoxy does symbol aliasing.

source/lib/external_libraries/opengl.h
44–50

You can simplify that with a single #include.

69

I’m pretty sure you don’t want to include GLX on macOS (and arguably, neither on Linux since it would tie you to X11).

source/lib/res/graphics/ogl_tex.cpp
882

I’m only commenting here, but you will probably want to remove the ARB suffix from all function calls, and the _ARB suffix from all defines.

Since you are already modifying them all to remove the p prefix, it would be nice to do it in one go.

Stan edited the summary of this revision. (Show Details)Jul 13 2020, 5:53 PM
Stan updated this revision to Diff 12656.Jul 13 2020, 6:26 PM
Stan marked 4 inline comments as done.

Some cleanup

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2632/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1000/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2099/display/redirect

Stan abandoned this revision.Sep 19 2022, 8:45 AM

We merged the other GL loader.