Commit graph

523 commits

Author SHA1 Message Date
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
Stefanos A
2d1df46d98 ES 3.0 strong enums for DrawArrays*() and Draw*Elements*()
The strongly-typed enums include core and extension varieties.
2013-11-07 10:17:33 +01:00
Stefanos A
0002b2e23e Fixed typo in ES3Generator.cs
The DllImports file should be named ES30Core.cs, not ES3Core.cs. Fixed
now.
2013-11-07 10:09:17 +01:00
Stefanos A
0f98f0e00b Fixed misspelled and missing enums 2013-11-07 09:47:27 +01:00
Stefanos A
93b8d4b86e Fixed enums for (Get)ObjectLabel
ObjectLabel and GetObjectLabel are part of KHR_debug.
2013-11-07 09:34:48 +01:00
Stefanos A
0598e02140 Fixed enums for GetDebugMessageLog
GetDebugMessageLog was misspelled as GetMessageDebugLog. This is now
fixed.
2013-11-07 08:39:57 +01:00
Stefanos A
de38df8820 Fixed strong-enums for GetDebugMessageLog
GetDebugMessageLog is part of KHR_debug.
2013-11-07 08:36:23 +01:00
Stefanos A
a2f2ab29ea Fixes for ES 3.0 strongly-typed enums
Fixed parameter mismatches in CopyBufferSubData and BlendFuncSeparate.
Implemented KHR_debug extension.
2013-11-07 08:33:17 +01:00
Stefanos A
2b4d10ffd7 Strongly-typed enums for ES 3.0 (complete)
Implemented sectiosn: Pixel Rectangles. Binding & Managing Framebuffer
Objects, Renderbuffer Objects, Attaching Renderbuffer Images to
Framebuffer, Attaching Texture Images to Framebuffer, Framebuffer
Completeness, Invaildating Framebuffer Contents, Renderbuffer Object
Queries, Simple Queries, String Queries.
2013-11-07 08:14:49 +01:00
Stefanos A
1a02457ddc Strongly-typed enums for ES 3.0 (WIP8)
Implemented sections: Hints and Sync Object Quries.
Renamed SyncParameter to SyncParameterName, as per the OpenGL naming
conventions.
2013-11-05 10:23:25 +01:00
Stefanos A
167c97dd84 Strongly-typed enums for ES 3.0 (WIP7)
Implemented section: Sync Objects and Fences [5.2].
Fixed desktop OpenGL wrapper for ClientWaitSync and FenceSync.
2013-11-05 09:53:34 +01:00
Stefanos A
2511cb1086 Implemented support for <overload> element
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.
2013-11-05 08:55:52 +01:00
Stefanos A
25b9939263 Strongly-typed enums for ES 3.0 (WIP6)
Implemented strongly-typed enums for sections: Selecting a Buffer for
Writing, Fine Control of Buffer Updates, Clearing the Buffers.
2013-11-04 23:25:02 +01:00