Commit graph

3026 commits

Author SHA1 Message Date
Stefanos A ac0fab7760 More compatibility overloads for OpenGL 2013-11-18 18:32:36 +01:00
Stefanos A. e7f70330b2 Implemented IEquatable<ColorFormat>
This eliminates memory allocations when storing and comparing
ColorFormat structures.
2013-11-18 13:49:06 +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 01d40c551a Aligned FBO API with desktop OpenGL 2013-11-17 23:57:38 +01:00
Stefanos A 358bcd4f88 Regenerated bindings 2013-11-17 01:49:10 +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 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. 0ee72856e4 Added workaround for wglMakeCurrent error 6
On some drivers and virtual machines, wglMakeCurrent may fail with a
code 6 when first called. The suggested workaround is to call it in a
loop until it succeeds. See
https://www.opengl.org/discussion_boards/showthread.php/171058-nVidia-wglMakeCurrent()-multiple-threads
2013-11-14 17:37:39 +01:00
Stefanos A 4fd6347de7 Mark untyped overloads as obsolete 2013-11-14 14:10:19 +01:00
Stefanos A b975eccd45 Regenerated bindings 2013-11-14 11:35:32 +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
thefiddler 1792f7bf29 Added Version20 overload to StencilFuncSeparate
Compatibility fix for OpenTK 1.0
2013-11-12 23:39:43 +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
Stefanos A 25f3305f3e Merge branch 'modes' 2013-11-11 11:45: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 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. 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. 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 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
parallels 7f921dae47 Merge branch 'master' of https://github.com/thefiddler/opentk into modes 2013-11-09 17:15:05 +01:00
parallels da684d233e Swallow DllNotFoundException in Sdl2 constructor 2013-11-09 17:13:24 +01:00
Stefanos A 95316829ec Updated WGL init sequence
WinGraphicsMode no longer creates a temporary context in order to create
the list of available modes. Instead, it requires to be passed an
existing context in its constructor.

WinGLContext now creates one temporary context in its static constructor
and hands that to WinGraphicsMode.

WinFactory no longer supports the CreateGraphicsMode API. This API will
be removed in the future, because the link because contexts and modes
cannot be separated in the general case.
2013-11-09 15:07:19 +01:00
Stefanos A 0f01a6d128 Stronger check for ES support
It is not enough to check for EGL, we also need to check that
ContextProfileFlags.ES is set.
2013-11-09 15:07:18 +01:00
Stefanos A ec2c64ee15 Remove static init of GetCurrentContext
The static initializer of GetCurrentContext would always default to the
desktop PlatformFactory, which caused problems when trying to run OpenGL
ES code on the desktop. The initializer is now removed and
GetCurrentContext is set in the context constructor, before creating any
contexts.
2013-11-09 15:07:17 +01:00
Stefanos A 440e3fe248 Load ES30 and OpenGL4 entry points 2013-11-09 15:07:16 +01:00
Stefanos A 2725b3cd08 Fix support for 3.2+ contexts (issue 3111)
glXGetProcAddress may return a non-null value even if a function is not
supported by the server. We need to check the extension string using
any GLX extensions. Fixes issue http://www.opentk.com/node/3111 "GLX
extension support is not checked correctly".

Furthermore, mode selection is now performed explicitly by the
X11GLContext constructor.
2013-11-09 11:16:14 +01:00
Stefanos A 3c71634667 Temp context not necessary for GLX
GLX entry points are not bound to a specific context. This means that, unlike WGL, GLX does not require a temporary context in order to load its entry points!
2013-11-09 11:07:37 +01:00
Stefanos A 6edaf8c3cf Deduplicate MacOSGraphicsMode and AglContext
The IGraphicsMode interface is gradually being removed and the
MacOSFactory will now throw an exception if an instance is requested.
AglContext no longer duplicates MacOSGraphicsMode functionality.
2013-11-08 18:44:02 +01:00
Stefanos A f77a6b11c3 SDL_GL_GetAttribute requires a valid context
Calling SDL_GL_GetAttribute when context construction has failed leads
to erroneous behavior. This call should only be made when a context has
been constructed correctly.
2013-11-08 17:31:54 +01:00
Stefanos A 5b5a395bbd Merge branch 'master' of https://github.com/thefiddler/opentk into modes 2013-11-08 16:41:20 +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 5a2fc1e411 Added missing doc comment 2013-11-08 15:33:41 +01:00
Stefanos A e0ffd9b42d More sane Sdl2Factory.CreateGetCurrentContext() implementation 2013-11-08 15:26:52 +01:00
Stefanos A 29fe1052de Added SDL_GL_GetCurrentContext method and TouchMouseID constant.
SDL_GL_GetCurrentContext will allow us to replace the weird
implementation in Sdl2Factory.CreateGetCurrentGraphicsContext()
and the latter to disable mouse emulation if we wish to.
Conflicts:
	Source/OpenTK/Platform/SDL2/Sdl2.cs
2013-11-08 15:25:42 +01:00