1
0
forked from 0ad/0ad

Some glad improvements

- Silence a MSVC warning in vulkan.cpp, refs #6987
- Document the patching of gl.h for macOS, from r26094
- Fix shellcheck warnings in the generation script
This commit is contained in:
Nicolas Auvray 2024-09-08 09:26:46 +02:00
parent 35d998694f
commit 0f87124b98
Signed by: Itms
GPG Key ID: C7E52BD14CE14E09
4 changed files with 17 additions and 8 deletions

View File

@ -959,6 +959,10 @@ function setup_all_libs ()
files { glad_path.."src/egl.cpp", glad_path.."src/glx.cpp" }
end
end
-- on Windows, silence a build warning in vulkan.cpp
filter "action:vs*"
buildoptions { "/wd4551" }
filter {}
-- Third-party libraries that are built as part of the main project,

View File

@ -15,6 +15,9 @@ cd glad
pip install -r requirements.txt
```
Do not revert the WFG patch in include/glad/gl.h (around line 1765):
do not add the change reverting it after the generation of the file
Build the source files for all four backends with their respective extensions
- GL
```sh

View File

@ -1763,6 +1763,7 @@ typedef void *GLeglImageOES;
typedef char GLchar;
typedef char GLcharARB;
#ifdef __APPLE__
// --- Patched by WFG
// See https://bugs.freedesktop.org/show_bug.cgi?id=66346
// macOS considers those to be different.
// typedef void *GLhandleARB;

View File

@ -1,12 +1,13 @@
#!/bin/sh
cd glad
python -m glad --api="gl:core=2.1" --extensions="../extensions/gl.txt" --out-path="../" c
python -m glad --api="gles2=2.0" --extensions="../extensions/gles2.txt" --out-path="../" c
python -m glad --api="glx=1.4" --extensions="../extensions/glx.txt" --out-path="../" c
python -m glad --api="wgl=1.0" --extensions="../extensions/wgl.txt" --out-path="../" c
python -m glad --api="egl=1.5" --extensions="../extensions/egl.txt" --out-path="../" c
python -m glad --api="vulkan=1.1" --extensions="../extensions/vulkan.txt" --out-path="../" c
cd ..
(
cd glad || exit
python -m glad --api="gl:core=2.1" --extensions="../extensions/gl.txt" --out-path="../" c
python -m glad --api="gles2=2.0" --extensions="../extensions/gles2.txt" --out-path="../" c
python -m glad --api="glx=1.4" --extensions="../extensions/glx.txt" --out-path="../" c
python -m glad --api="wgl=1.0" --extensions="../extensions/wgl.txt" --out-path="../" c
python -m glad --api="egl=1.5" --extensions="../extensions/egl.txt" --out-path="../" c
python -m glad --api="vulkan=1.1" --extensions="../extensions/vulkan.txt" --out-path="../" c
)
mv src/gl.c src/gl.cpp
mv src/gles2.c src/gles2.cpp
mv src/glx.c src/glx.cpp