-
Notifications
You must be signed in to change notification settings - Fork 110
GL \ API updates
Suppose you need a brand new extension exposed by the lastest OpenGL driver. How include it in OpenGL.Net? It is not that hard.
Follow the steps:
-
Checkout the OpenGL XML Registry at https://github.com/KhronosGroup/OpenGL-Registry. Copy the files
OpenGL-Registry/xml/gl.xml
,OpenGL-Registry/xml/wgl.xml
,OpenGL-Registry/xml/glx.xml
andOpenGL-Registry/xml/egl.xml
to theOpenGL.Net/GLSpecs/
directory. -
Open the a solution containing the BindingsGen (i.e.
/All*.sln
or/BindingsGen.sln
). Build the BindingsGen project, using the Release configuration. Then run it: it takes some minute and lots of ram. -
Try to compile the OpenGL.Net projects: if no compilation errors occurs, you have almost done. In the case of compilation errors, you should check how to fix them by configuring (or modifying) the BindingsGen executable, or adapting the XML specifications.
-
Check actual modifications on OpenGL.Net project. If they are correct and usable, commit them. Enjoy.
The BindingsGen code generator has configuration files that are embedded in the executable. They are XML files that adds metadata to OpenGL specification elements.
This is the main configuration file. This file configure the following actions:
- Add missing enumeration values
- Rename methods and arguments
- Configure method overload and behavior
They are simple databases of names. The code generator will create overloads and name reductions using those words. Sometimes API updates introduce new words, and the relative database must be updated, otherwise wrapper method names will be scorched, possibly introducing compilation errors.
As example, you can read the commit fixing name scorching in GL_NV_draw_vulkan_image wrapper.
It is a simple database of key and value pairs for translating OpenGL specification types to C# types. It contains a lot of XML elements like:
<type name="GLushort" value="UInt16" />
Most likely you will not need to update this configuration, most of the types are already there, and rarely API updates introduce a new type.