New WrapperTypes for convenience functions: ConvenienceReturnType to
replace an "out" parameter by a return value, and
ConvenienceArrayReturnType to replace an out array parameter by a
single return value (array count of 1 only).
We should only generate delegates for actual OpenGL entry points, not
for overloaded functions that resolve to the same entry point. This
improves loading speeds and reduces the size of the compiled dll.
Paths that don't define a "version" attribute will now match all
possible versions. This will make it easier to add support for newer
APIs as they are introduced.
After the previous commit, several ES 2.0 functions would refer to
enums found in ES 3.0. These enums have been copied to ES 2.0, either
as core enums or as extensions.
ES 3.0 includes ES 2.0 verbatim. We can significantly reduce
duplication by using the same <replace> node for both APIs. Note that
the enumerations must remain separate, as ES 2.0 and 3.0 support
different tokens.
The <overload> element simplifies the addition of overloads for
backwards compatibility. It is defined similar to the <replace>
element, but instead of replacing the parameters of a function
in-place, it adds a new overload and modifies the overload instead.
Sometimes an enum may reuse the tokens of another enum verbatim
(possibly adding a few extra tokens.) The reuse directive simplifies
the handling of this case:
<enum name="Foo">
<reuse enum="Bar" />
</enum>
Added strongly-typed enums for sections: Vertices, Shaders and
Programs. Added a number of missing enums for ES 2.0. Normalized
several APIs between OpenGL and OpenGL ES.
When a Delegate is defined multiple times in the spec, we should check
if any of these definitions contains a proper Delegate.Version and
store that. This improves the self-documentation aspect of the bindings.
Now that we support function overloads, it is safe to ignore functions
that are defined multiple times. We just merge their Category
properties if they are not identical.
It is now possible to define multiple overloads of the same function,
each with different parameters. This is extremely useful for
maintaining backwards compatibility in the face of the changes between
GL 4.3 and 4.4.
Tokens are now sorted according to their value, exactly is in the
upstream gl.xml spec. Additionally, gles1 and gles2 now include the
pre-defined groups in the specification.
Sometimes elements in overrides.xml contain extra spaces due to typos,
which are quite difficult to track down. The XmlSpecReader can now
cope with that.
OpenTK does not currently support generating bindings for pointers of
order 3 or higher. No OpenGL or OpenGL ES API currently uses such
pointers, so we just issue a warning message if such an API is
encountered in the future.
The registry reuses the "gles2" apiname for both OpenGL ES 2.0 and 3.0.
The generator will now use the apiversion attribute to distinguish
between the two APIs.
GetOverridesPath encapsulates the code that retrieves an override enum
or function from overrides.xml. Additionally, it now supports names and
extensions with multiple values (e.g. extension="Core|Ext").
Explicit Settings objects are now created for each generator. A new
-mode:all option has been added, which generates bindings for all APIs
in one go (useful for the post-GL4.4 specs, which collect all APIs in a
single file.)
ISpecWriter implementations must now store explicit references to a
Settings object. Additionally, all code generation is now handled inside
the ISpecWriter implementation (it used to be scattered over all Type,
Parameter, etc classes resulting in unmaintainable spaghetti code.)
IBind implementations must now store explicit references to Settings,
GLTypes and CSTypes instances. This allows us to use multiple
configurations in the same process.
FuncProcessor now implements all translation logic for types, parameters
and functions. This used to be scattered in the various classes (Type,
Parameter, etc) resulting in a rather disgusting spaghetti. Code
generation has been removed from FuncProcessor and is now handled by the
various language-specific ISpecWriter backends.
This is part of a long-due series of source cleanup patches. ToString()
is no longer used for code generation (code generation is handled by an
ISpecWriter instance.) Enum is no longer public. EnumCollection now
exposes its backing store through an interface, rather than a concrete
class (simpler to change backing store in the future.)
This is part of a long-due series of source cleanup patches. ToString()
is no longer used for code generation (this is handled by an ISpecWriter
implementation). This class is no longer public.
This is part of a long-due series of source cleanup patches. All
translation logic is now part of FuncProcessor. Code generation is now
handled by an ISpecWriter implementation. Minor improvements to
IEquatable and ToString() implementations. Reduced the surface of the
public API.
This is part of a long-due cleanup patch series. All translation logic
is now part of the FuncProcessor. Language-specific code generation is
now part of the ISpecWriter, not the delegate class. Implemented the
IEquatable interface.
This is part of a long-due source cleanup series. All Translate*()
methods are now part of the FuncProcessor. Additionally, ToString() has
been improved and the IEquatable interface is now implemented.
ParameterCollection now has better control of when its cache should be
rebuilt.
This is part of a long-due source cleanup operation. GLTypes and CSTypes
are no longer global singletons, but must now be accessed through an
IBind instance. All Translate*() methods are now part of the
FuncProcessor. ToString() has been improved and the IEquatable interface
is now explicitly implemented.
Settings, GLTypes and CSTypes are no longer global singletons. Instead,
explicit instances must be stored in the IBind implementation. This
allows us to use multiple configurations in the same process.
Utilities.Keywords now accepts an explicit parameter, instead of
accessing Settings directly. This allows us to use multiple
configurations in the same process.
Additionally, the Utilities class is no longer public (the Bind project
is not meant to be consumed as a dll.)
A Settings object is now passed directly as a parameter, in order to
support different configurations in the same process. The XmlSpecReader
can now distinguish between, and support both, pre-GL4.4 and post-GL4.4
specs.
A function redefinition usually stems from a bug in the OpenGL specs, or
a bug in the spec converter. The binding generator now logs a warning,
instead of crashing, when a redefinition is encountered.
GL4.4 renamed PixelInternalFormat to InternalFormat. The missing tokens
are now re-added, since a lot of functions depend on them. Additionally,
a number of 'open' <use> elements now define a specific enum reference.
This is not necessary, but is good for documentation purposes.
Instead of recursing, we use a simple do..while loop to resolve the
transitive reference of a constant. If there is a loop at any point, we
stop and use a brute force search over all tokens. If this still fails
to resolve the reference, then we report this reference as unresolved.
Function overrides are now looked up in the following order: specific
name (e.g. ProgramParameteriARB), extensionless name (e.g.
ProgramParameteri) and generic mame (e.g. ProgramParameter). This
improves the override resolution for functions with multiple extension
forms (core, ext, arb, etc).
An EnumProcessor or FuncProcessor instance is now required in order to
call their Translate*() methods. A number of transformations that
relied on calling the static methods have now been moved inside the
processor classes.
Instead of hardcoding a list of extensions, extensions are now read
directly from the signatures.xml file. Acronyms for new texture
formats are now listed.
Instead of using a hardcoded list of extensions, the parser will now
use a regex to detect extension names. This gives better results on
new specs without manual editing.
ShaderSource is supposed to accept an array of string lengths as the
last parameter. The count="1" statement in the registry is wrong.
GL.VertexArrayFogCoordOffsetEXT is supposed to receive a
FogPointerType.
For instance, if we override both ClearBufferfi and ClearBuffer, then
ClearBuffer{i f ui}v will be overriden be ClearBuffer and
ClearBufferfi will be overriden by ClearBufferfi. This allows us to
specialize overrides when necessary.