Commit graph

5213 commits

Author SHA1 Message Date
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. 21069ee34c Do not scale in normal-dpi modes 2013-11-14 09:25:53 +01:00
Stefanos A. 7c8cc5f746 Scale window size on hi-dpi mode
Follow high-dpi guidelines for scaling a window on high-dpi modes.
2013-11-14 09:02:47 +01:00
Stefanos A. 94e2649704 Cleaned up context profile selection
Added support for WGL_create_context profiles and added methods for the
selection of context flags and profile.
2013-11-14 08:30:11 +01:00
Stefanos A. 803c575201 Corrected core profile selection
According to GLX_create_context, the correct flag for a core profile is
GLX_CONTEXT_CORE_PROFILE_BIT_ARB.
2013-11-14 08:29:06 +01:00
Stefanos A. f142dbdfc3 Improved WinGLContext initialization
Cleaned up and added debugging information to the temporary context
construction in WinGLContext. Simplified WinGraphicsMode constructor.
2013-11-14 08:05:08 +01:00
Stefanos A. 5d6ca5c7da Added GetDeviceCaps (windows platform)
We will use this method to read out the logical DPI of the monitor and
scale window elements accordingly.
2013-11-14 01:43:40 +01:00
Stefanos A. f9fdddea64 Re-added WindowHandle property
There are projects that use reflection to access
*WindowInfo.WindowHandle directly. This change ensures we don't break
them.
2013-11-13 18:25:49 +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
Stefanos A. 52a8653f52 Hack for GLControl support
Added a hack to allow GLControl examples to run even if SDL is
installed.
2013-11-12 20:38:02 +01:00
Stefanos A. ab58d41353 GLControl requires native backend
SDL does not currently support embedding into Windows Forms (this is an
upstream limitation.) To ensure that existing WinForms applications
continue to function even if SDL is installed, GLControl will now try to
initialize OpenTK with a native backend. The user can still override
this behavior using OpenTK.Toolkit.Init(ToolkitOptions), as normal.
2013-11-12 20:37:23 +01:00
Stefanos A. b9fcf7c3c3 Cleaner startup sequence
OpenTK.Toolkit will now initialize OpenTK.Configuration and
OpenTK.Platform.Factory explicitly. It can also receive an optional
ToolkitOptions parameter to influence the OpenTK.Platform implementation
that will be chosen. Finally, it explicitly implements IDisposable to
clean up after itself.
2013-11-12 20:34:53 +01:00
Stefanos A. 663864f083 Refactored environment config detection
This significantly cleans up the startup sequence on all platforms:
- X11 is not detected on non-Linux platforms unless the user explicitly
requests it
- Supports selection of platform abstractions (SDL) vs native
implementations.
- Returns correct flags on Android and iOS.

This contains a semantic change: OpenTK.Configuration will not return
correct values until OpenTK.Toolkit.Init() has been called, either
directly or indirectly (e.g. by creating a window.)
2013-11-12 20:32:31 +01:00
Stefanos A. 7503a87b3f Added ToolkitOptions class
ToolkitOptions allows the user to influence the implementation of
OpenTK.Platform at runtime.
2013-11-12 20:22:08 +01:00
thefiddler 289103168f Updated README file 2013-11-12 11:24:25 +01:00
thefiddler 2215841f0f Added OpenAL/GL/GL ES documentation 2013-11-12 10:58:20 +01:00
thefiddler 5e502ce02d Merge branch 'master' of https://github.com/thefiddler/opentk 2013-11-12 02:03:46 +01:00
thefiddler 7af4912632 Updated readme file 2013-11-12 02:03:24 +01:00
Stefanos A 25f3305f3e Merge branch 'modes' 2013-11-11 11:45:15 +01:00
Stefanos A. 873f8fb6eb Cleaned up test code committed by mistake. 2013-11-11 11:44:21 +01:00
Stefanos A. 12005e0792 Try to create Embedded context first
By mistake, this code would always create a desktop context. The correct
approach is to create an embedded (EGL) context and only fallback to
desktop if that doesn't work.
2013-11-11 11:43:15 +01:00
Stefanos A. 0d0f578788 Enabled SAMPLE_BUFFERS EGL attribute
This attribute is required for multisampling support.
2013-11-11 11:42:30 +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
thefiddler 2c9d574b08 Merge branch 'modes' of https://github.com/thefiddler/opentk 2013-11-10 19:11:05 +01:00
Stefanos A. c66b22a1f3 Updated convenience overloads 2013-11-10 19:04:18 +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. 8003d06315 Move convenience overloads to generator
The generator now handles the creation of convenience overloads. These
must be removed from the helper classes to avoid redefinition errors.
2013-11-10 15:36: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. 5aad11f6ee Generate bindings for testing (WIP2) 2013-11-10 09:18:15 +01:00
Stefanos A. 06ad3bf1dc Generate bindings for testing (WIP) 2013-11-10 09:14:30 +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 dc093f8fa9 Added mapping for libXi
On Debian-based distributions, libXi.so does not exist. We have to lookup libXi.so.6 instead.
2013-11-09 18:55:35 +01:00
Stefanos A b08e59e861 Allow non-realized GraphicsMode
It is now possible to pass a non-realized GraphicsMode to the X11GLContext and X11GLNative constructors. A non-realized GraphicsMode is a GraphicsMode with a null Index (i.e. which has not passed through SelectGraphicsMode()).
2013-11-09 18:55:17 +01:00
parallels 62d6791736 Use glXGetProcAddressARB
According to the Linux OpenGL ABI, glXGetProcAddressARB must be statically exported by libGL. This does *not* hold true for glXGetProcAddress. We must used the ARB version instead.
Furthermore, glx entry points, unlike wgl, do not depend on any specific OpenGL context. This means we can load them in the constructor of the Glx class.
2013-11-09 18:50:53 +01:00