Commit graph

535 commits

Author SHA1 Message Date
Stefanos A
ac0fab7760 More compatibility overloads for OpenGL 2013-11-18 18:32:36 +01:00
Stefanos A
5d4c42672f Improved suffix detection. Support index-based parameter overloading. 2013-11-18 18:32:34 +01:00
Stefanos A
3d50554903 Added OpenGL overloads for OpenTK-1.0 compatibility 2013-11-18 13:28:44 +01:00
Stefanos A
e572f418af Added compatibility overloads for ES 2.0 2013-11-18 01:10:01 +01:00
Stefanos A
0865b0f200 Allow overriding of function names 2013-11-17 23:56:51 +01:00
Stefanos A
fbcae3b2fe Removed debugging code 2013-11-17 21:27:22 +01:00
Stefanos A
b652145977 Handle overloads with different element counts 2013-11-17 21:27:09 +01:00
Stefanos A
c175a486fc Improved and documented IEquatable vs IComparable 2013-11-17 21:26:28 +01:00
Stefanos A
13d3bdb47f OpenGL overrides for compatibility
Added overrides to maintain backwards compatibility with
OpenTK.Graphics.OpenGL.GL. These were generated
through the apitest tool.
2013-11-17 01:49:07 +01:00
Stefanos A
f8a81f396e Cleaned up ending trim regex
Trim regex will now correctly match GetInteger64 and other functions
ending in "64". It also uses a correct ending anchor to avoid matches
in the middle of a function name.
2013-11-17 01:49:07 +01:00
Stefanos A
fd910e6a6c Added int/uint to the c# typemap 2013-11-17 01:49:07 +01:00
Stefanos A
afd076a83d Speed up enum code generator
Scan through the list of wrappers once, instead of multiple times, in
order to find out which functions use which enums. This speeds up enum
generation tremendously.
2013-11-17 01:49:07 +01:00
Stefanos A
f9deeaead7 Improved compatibility with OpenTK 1.0
Added overloads for enumerations with name changes. Reduced differences
between ES and GL APIs.
2013-11-15 01:59:50 +01:00
Stefanos A
cdd6259fee Removed debug leftovers 2013-11-14 23:38:17 +01:00
Stefanos A
431202d830 Corrected convenience wrappers for Get* and Delete*
GetBoolean, GetInteger6, GetFixedvOES and Delete* are now matched in
the convenience wrapper generator. Methods returning vectors of fixed
size (e.g. 4 ints) are no longer matched.
2013-11-14 17:40:06 +01:00
Stefanos A
2e14ca59b2 AMD_performance_monitors is not const-correct
Workaround fo  bug in rhe specification of AMD_performance_monitors.
Upstream bug report here:
https://www.khronos.org/bugzilla/show_bug.cgi?id=1035
2013-11-14 16:17:20 +01:00
Stefanos A
4fd6347de7 Mark untyped overloads as obsolete 2013-11-14 14:10:19 +01:00
Stefanos A
11070bb52a Added support for obsolete attribute
Functions marked with the obsolete attribute will now add [Obsolete] to
the generated output.
2013-11-14 13:46:42 +01:00
Stefanos A
5b4d3edf39 ES11 compatibility overloads (WIP1) 2013-11-14 11:34:46 +01:00
Stefanos A
c5591e9968 Clear qualifier path when changing type
This fixes a bug where overriding an enum parameter with a non-enum
parameter would result in the wrong qualifier path.
2013-11-14 11:33:52 +01:00
Stefanos A
ce7a7c7cf3 New Add() methods analogous to FunctionCollection 2013-11-14 11:32:25 +01:00
Stefanos A
5f7008d746 Improved override/overload lookup
The lookup for function overrides and overloads now tries to work
around extension case mismatches (e.g. IBM vs Ibm). This fixes a few
specific cases of missing overrides.
2013-11-14 11:31:36 +01:00
Stefanos A
d28c428e99 Correctly set generator mode. 2013-11-14 09:28:27 +01:00
Stefanos A.
4fd5cc30d5 Corrected option parsing 2013-11-13 14:29:06 +01:00
thefiddler
1792f7bf29 Added Version20 overload to StencilFuncSeparate
Compatibility fix for OpenTK 1.0
2013-11-12 23:39:43 +01:00
thefiddler
4f6c2ac2b4 Support multiple overloads
It is now possible to specify multiple overloads for the same function.
This is helpful for maintaining backwards compatibility with previous
releases.
2013-11-12 23:38:09 +01:00
thefiddler
8360b7a2ba Generate overloads without strong enums for 1.0 compat
OpenTK 1.0 and Xamarin Android/iOS do not use strongly-typed enums for
OpenGL ES. Generate overloads with the "All" enum in order to maintain
compatibility.
2013-11-11 10:03:24 +01:00
thefiddler
4d717dcdda Allow '+' and '-' cmdline options for compatibility settings 2013-11-11 10:02:08 +01:00
thefiddler
8e9a9355b0 Allow overriding of Settings.Compatibility 2013-11-11 10:01:30 +01:00
thefiddler
0fcf3a2f40 Minor code cleanup 2013-11-11 10:01:15 +01:00
thefiddler
af16be42d5 Corrected Parameter.IsEnum property 2013-11-11 10:00:54 +01:00
thefiddler
dde7c645c4 Removed unused code 2013-11-11 10:00:32 +01:00
Stefanos A.
d0e025b86d Restrict convenience overloads
Only Get*, Gen*, Delete* and New* functions get convenience overloads.
This avoids issues with functions such as Rect() that have similar
signatures but cannot use such overloads.

This restriction will be relaxed in the future.
2013-11-10 19:03:49 +01:00
Stefanos A.
293c020151 Added WrapperTypes.ConvenienceArrayType
These are convenience parameters for function receiving a size and an
array parameter, like DeleteTextures(int n, int[] ids). The generator
will now add overloads taking a single parameter, such as
DeleteTexture(int id).
2013-11-10 18:29:53 +01:00
Stefanos A.
af7fdea449 Return types must be cls-compliant
CreateCLSCompliantWrappers must always change return types into
cls-compliant types. The reason is that we cannot overload on return
type alone, so we should always choose the compliant version.
2013-11-10 15:35:47 +01:00
Stefanos A.
6098fa05ce Plural name to singular in convenience overloads 2013-11-10 10:16:47 +01:00
Stefanos A.
11c1071625 Corrected declarations in convenience overloads 2013-11-10 10:08:04 +01:00
Stefanos A.
089c108ea0 Corrected indentation 2013-11-10 09:20:54 +01:00
Stefanos A.
c1cb70d215 Improve indentation for doc comments
Doc comments are now split at their source, as a first step in
normalizing their indentation between VS and MD.
2013-11-10 09:12:42 +01:00
thefiddler
d126d25215 Add helper overload generation
Functions returning a value or array via an 'out' parameter will now get a convenience overload that returns the result via a return statement. In the case of arrays, only single-valued arrays will be supported. For example:

void GetIntegerv(enum pname, out int value)

will be get an overload of

int GetIntegerv(enum pname)

This will reduce the amount of helper overloads that must be maintained manually in GLHelpers.cs.
2013-11-10 08:28:58 +01:00
thefiddler
0d73706c88 Added new WrapperTypes; removed unused code
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).
2013-11-09 19:24:43 +01:00
thefiddler
417aa67139 Implemented Add and AddRange methods
These supplant the static Utilities.Merge() overloads.
2013-11-09 19:22:31 +01:00
Stefanos A
49df5ff453 Do not generate delegates for overloads
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.
2013-11-08 16:40:43 +01:00
Stefanos A
7ab5e3ab6c Use paths without apiversion attribute
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.
2013-11-07 16:48:11 +01:00
Stefanos A
1f6d445021 Removed non-existent token from OpenGL
COMPRESSED_ALPHA_BPTC_UNORM does not appear to be defined anywhere.
Removed.
2013-11-07 16:46:38 +01:00
Stefanos A
be8f7c6311 Corrected ES 2.0 enums
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.
2013-11-07 16:25:19 +01:00
Stefanos A
735d05e496 Merged ES2.0 and ES3.0 replacements
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.
2013-11-07 11:37:51 +01:00
Stefanos A
7c54a19708 ES 3.0 fixed enums for GetIntegeri_v and GetInteger64i_v
These functions have a first parameter named "target", not "pname".
Fixed now.
2013-11-07 10:58:02 +01:00
Stefanos A
e59c95f2f9 ES 3.0 fixed enums for GetInteger64*
GetInteger64v should accept GetPName, while GetInteger64i_v should
accept GetIndexedPName.
2013-11-07 10:39:20 +01:00
Stefanos A
8de24c97fb ES 3.0 strong enums for DrawBuffersEXT and NV
Relax the extension constraint in DrawBuffers, in order to add strong
enums to the extension varieties of this function.
2013-11-07 10:33:02 +01:00