0ad/source/third_party/glad
Vladislav Belov 456e2a0b56
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
Removes dummy GL functions as replaced by core
2026-04-25 17:47:06 +02:00
..
extensions Removes dummy GL functions as replaced by core 2026-04-25 17:47:06 +02:00
include Removes dummy GL functions as replaced by core 2026-04-25 17:47:06 +02:00
src Removes dummy GL functions as replaced by core 2026-04-25 17:47:06 +02:00
fix_macos.patch Adds a patch to automatically apply the macOS fix to glad after its generation. 2024-11-03 20:26:13 +01:00
README.md Improve script generating glad headers 2024-11-06 16:35:57 +01:00
update-headers.cmd Adds a patch to automatically apply the macOS fix to glad after its generation. 2024-11-03 20:26:13 +01:00
update-headers.sh Improve script generating glad headers 2024-11-06 16:35:57 +01:00

Introduction

This folder contains the files generated by the glad GL loader for the game.

Instructions

Install glad via package manager or pip, for the latter create a venv if necessary. Alternatively fetch the glad git repo as outlined below. On Windows fetching the git repo is assumed.

Download glad v2:

git clone https://github.com/Dav1dde/glad.git -b glad2

Install the python dependencies

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 Currently it's automatically applied by running the update-headers script. On Windows you need to run it under Git Bash or with the patch program in PATH.

Build the source files for all four backends with their respective extensions

  • GL
    python -m glad --api="gl:core=2.1" --extensions="../extensions/gl.txt" --out-path="../" c
    
  • GLES2
    python -m glad --api="gles2=2.0" --extensions="../extensions/gles2.txt" --out-path="../" c
    
  • GLX
    python -m glad --api="glx=1.4" --extensions="../extensions/glx.txt" --out-path="../" c
    
  • WGL
    python -m glad --api="wgl=1.0" --extensions="../extensions/wgl.txt" --out-path="../" c
    
  • EGL
    python -m glad --api="egl=1.5" --extensions="../extensions/egl.txt" --out-path="../" c
    
  • Vulkan
    python -m glad --api="vulkan=1.1" --extensions="../extensions/vulkan.txt" --out-path="../" c
    

Rename all files to .cpp to prevent compilation warnings