Commit graph

3054 commits

Author SHA1 Message Date
Stefanos A. 442f8b6131 Added rewrite postbuild event 2013-11-25 00:58:39 +01:00
Stefanos A. e65f206554 Fixed core loading on Windows
On Windows, entry points for OpenGL 1.0 and 1.1 are not exposed by
wglGetProcAddress. We fall back to LoadLibrary+GetProcAddress when
wglProcAddress fails.
2013-11-25 00:26:20 +01:00
Stefanos A. 0434f623e1 Added InteropHelper file 2013-11-25 00:20:22 +01:00
Stefanos A. 74159da199 Regenerated bindings 2013-11-25 00:19:18 +01:00
Stefanos A. 1e6a819b07 Removed GLObsolete.cs helper
This file must be recreated using the new loading mechanism.
2013-11-24 13:59:15 +01:00
Stefanos A. 811b04e880 Regenerated bindings with new loading mechanism 2013-11-24 13:58:54 +01:00
Stefanos A. fec958c8dc Hooked up new loading mechanism 2013-11-24 13:58:30 +01:00
Stefanos A. 657c447737 Hooked up new loading mechanism 2013-11-24 13:58:12 +01:00
Stefanos A. 825ed3621f Implemented new loading mechanism 2013-11-24 13:57:43 +01:00
Stefanos A. 7a57c9c3d2 Clarified GetAddress documentation 2013-11-24 13:57:23 +01:00
Stefanos A. 475e7ea797 Allow overriding of loading methods 2013-11-24 13:57:08 +01:00
Stefanos A. 1e71ca9122 Removed delegates and DllImports 2013-11-24 13:56:35 +01:00
Stefanos A 8ee2152709 Moved delegate loaders to the Delegates class 2013-11-23 17:23:26 +01:00
Stefanos A 03a26ed12f Regenerated bindings with lazy loading 2013-11-22 20:07:01 +01:00
Stefanos A 5d0e7a4acf Moved GetExtensionDelegate to the correct position 2013-11-22 20:06:28 +01:00
Stefanos A ffe934fa5d Added static GetExtensionDelegate implementation 2013-11-22 20:06:04 +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. e2404d2cfc Fix "CursorVisible bugs"
When we enter the modal resize loop on Windows with ClipCursor set, we
cause a feedback loop where every resize causes the cursor to move and
every move causes a new resize. To fix this, we need to ungrab the
cursor when we are enter the modal loop.
2013-11-22 14:10:21 +01:00
Stefanos A. b7af883cff Fix exceptions on reused OpenGL context handles
Implementations may reuse OpenGL context handles that have been
destroyed. If a context is finalized but not Disposed, then OpenTK may
keep a reference to the old context handle, causing a crash when the
same handle is returned for a new context. To fix that, new context
handles will now replace old handles in case of a clash.
2013-11-21 09:34:06 +01:00
Stefanos A. 08701d318c Destroy SDL window when finalized
SDL_DestroyWindow must be called on the main thread. If the window is
finalized, the finalizer will push a CLOSE event to the event loop
(thread-safe) and the window will be destroyed on the main thread.
2013-11-21 09:31:32 +01:00
Stefanos A. 75d4f3d07c Fixed #5
We need to release the cursor before closing a GameWindow, otherwise
subsequent GameWindows may fail to receive mouse events.
2013-11-20 18:05:45 +01:00
Stefanos A. 486130c01e Toolkit.Init() now returns a concrete class
This gives us room for expansion in the future, if necessary.
2013-11-20 13:12:42 +01:00
Stefanos A. 1d19a80b53 Removed incorrect comment 2013-11-20 13:05:49 +01:00
Stefanos A. 48803bb4d6 Fixed #4
Sdl2InputDriver.Dispose() would call SDL_DelEventWatch with a different
"user_data" parameter than SDL_AdEventWatch. This caused the EventFilter
to remain registered and subsequently crash when closing and reopening a
window.
2013-11-20 09:10:12 +01:00
Stefanos A 255f4e9083 Completed compatibility overloads for OpenTK 1.0 2013-11-20 08:16:07 +01:00
Stefanos A 02120f429f Do not trim 's' from Groups 2013-11-20 08:16:06 +01:00
Stefanos A. 8c5887e996 Aligned GL core and compat enums 2013-11-18 18:51:38 +01:00
Stefanos A. 32828ecd8a Do not call SDL.GetVersion unless requested 2013-11-18 18:35:23 +01:00
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