EGL API and Extension Registry; The Khronos Group (2016).
npm install egl.csh
$ npm i egl.c
`
And then include egl.h, and related files, as follows:
`c
// main.c
#define EGL_IMPLEMENTATION
#include // Khronos platform-specific types and definitions
#include // Core EGL API
#include // EGL extensions
#include // EGL platform-specific types and definitions
int main() {
int version = gladLoaderLoadEGL(EGL_NO_DISPLAY);
if (version == 0) return -1;
/ ... /
}
`
Finally, compile while adding the path node_modules/egl.c to your compiler's include paths.
`bash
$ clang -I./node_modules/egl.c main.c # or, use gcc
$ gcc -I./node_modules/egl.c main.c
`
You may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
`bash
$ cpoach clang main.c # or, use gcc
$ cpoach gcc main.c
`
> [!NOTE]
> This package uses the glad EGL loader.
> Further, the system or local directory must contain libEGL.so or equivalent
> shared library for your platform, so that the EGL functions can be loaded.
Reserving EGL Enumerant Ranges
EGL enumerants are documented in api/egl.xml . New ranges can be allocated
by proposing a pull request to main modifying this file, following the
existing examples. Allocate ranges starting at the lowest free values
available (search for "Reservable for future use"). Ranges are not
officially allocated until your pull request is accepted into main. At
that point you can use values from your assigned range for API extensions.
Adding Extension Specifications
Extension specification documents can be added by proposing a pull request
to main, adding the specification .txt file and related changes under
extensions/\/filename.txt. Your pull request must also:
* Allocate an extension number in registry.tcl (follow the existing
`` examples, search for "Next free extension number", and use
the lowest available extension number).
* Include that extension number in the extension specification document.
* Define the interfaces introduced by this extension in api/egl.xml,
following the examples of existing extensions. If you have difficulty
doing this, consult the registry schema documentation in the GL registry
at www.khronos.org/registry/gl/; you may also create Issues in the
EGL-Registry repository to request help.
* Verify that the EGL headers regenerate properly after applying your XML
changes. In the api/ directory, you must be able to do the following without
errors:
`bash
Validate XML changes
make validate
Verify headers build and are legal C
make clobber
make
make tests
`
* Finally, add a link from the extensions section of index.php to the
extension document, using the specified extension number, so it shows up
in the web view (this could in principle be generated automatically from
registry.tcl / egl.xml, but isn't at present).
Sometimes extension text files contain inappropriate UTF-8 characters. They
should be restricted to the ASCII subset of UTF-8 at present. They can be
removed using the iconv Linux command-line tool via
`bash
iconv -c -f utf-8 -t ascii filename.txt
``