Commit graph

28 commits

Author SHA1 Message Date
Stefanos A 78c0c0d16e Removed unused code 2013-12-02 16:30:14 +01:00
Stefanos A 438f83c8d9 Mark slots with [DllImport]; remove "core" and "delegates" generation
We should be able to use static pinvokes on platforms that do not
provide or require extensions and calli instructions on platforms with
extension APIs. This dinstiction will be implemented as a parameter in
the rewriter.
2013-12-01 21:17:15 +01:00
Stefanos A 2290e06cbd Use untyped int for enums in unmanaged callsites
By using untyped integers instead of typed integers in the unmanaged
callsites, we allow monolinker to keep the exact set of enums that are
used by the user. Without this, we’d have to keep every single enum in
place to avoid missing type exceptions.

This does not affect the public signatures or the generated code in any
way.
2013-12-01 18:26:01 +01:00
Stefanos A 82b0b477da Emit native signatures
The patcher uses those signatures to implement wrapper functionality
for the various wrapper types that exist in OpenTK.
2013-11-27 00:02:26 +01:00
Stefanos A 4149cdfa88 Do not emit method bodies. 2013-11-26 01:31:29 +01:00
Stefanos A. 84a1e5a739 Initial work on Pin<> statements (WIP) 2013-11-25 20:00:22 +01:00
Stefanos A. c8e753d2da Moved address parameter to last place
This way, it is the last item on the evaluation stack before calling the
unmanaged function pointer. This simplifies the calli rewrite procedure.
2013-11-25 00:18:43 +01:00
Stefanos A. 7b93a87bb0 Generate entry point tables 2013-11-24 13:54:52 +01:00
Stefanos A 8ee2152709 Moved delegate loaders to the Delegates class 2013-11-23 17:23:26 +01:00
Stefanos A 0fea0a19b7 Added support for lazy binding loading 2013-11-22 20:06:49 +01:00
Stefanos A 2ace001203 Implemented direct binding loading
OpenTK normally uses reflection to load bindings, instead of generating
huge constructors. Although reflection is faster on first load (thanks
to reduced JIT overhead), it fails to work correctly with monolinker.
This branch explores the performance of a direct binding.
2013-11-22 17:32:17 +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 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
thefiddler dde7c645c4 Removed unused code 2013-11-11 10:00:32 +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. 11c1071625 Corrected declarations in convenience overloads 2013-11-10 10:08:04 +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
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 2d33b10e1a Improve debug output
Function parameters are now displayed during binding generation.
2013-11-03 20:28:57 +01:00
Stefanos A. 9789225e0c Allow overloads of the same function
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.
2013-11-03 16:09:11 +01:00
Stefanos A ab61e3f6a0 Added missing newline
Methods are now separated by a single newline.
2013-11-03 01:27:33 +01:00
Stefanos A. bf0f42be82 Avoid singletons; collect code generation
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.)
2013-11-01 09:27:46 +01:00
thefiddler 8dcb8601a2 Normalized line endings
Hopefully this is the first and last time we have to do this.
2013-10-11 01:58:54 +02:00
the_fiddler 81b188ffca Added documentation comments to generated enums.
Improved ISpecWriter API by removing low-level implementation details.
Made Constant implement IComparable so it can be sorted before being written to output.
2011-07-20 10:10:33 +00:00
the_fiddler 3021f668ad Re-added missing gl.tm file.
Added initial C++ spec writer.
Refactored IBind and ISpecWriter interfaces.
2010-12-03 10:21:50 +00:00
the_fiddler c3bfa7dc9a Moved output filenames to Settings class. 2010-12-02 21:58:49 +00:00
the_fiddler 0ce332b318 Refactored spec reading / writing functionality into its own classes.
Removed legacy spec reader.
2010-12-02 21:36:05 +00:00