SDL_GL_MakeCurrent(IntPtr.Zero, IntPtr.Zero) is the correct way to
remove the current OpenGL context from the calling thread. Fixes
threaded rendering on Windows.
Using a separate, isolated process protects against incompatible interactions between the Example Browser (WinForms) and the executing example (native or SDL). It also protects the main GUI from crashes in the example code.
Git commit hashcodes are not compatible with the 16bit integer values found in .Net version numbers. Use the git commit count as a version number instead.
Added IDisposable interface to all classes holding native data that must be freed. OpenTK.Toolkit.Init() now returns an IDisposable instance that can be used to cleanup all native data held by OpenTK. This is useful when re-initializing OpenTK (possibly in a new AppDomain), as is the case in the Example browser.
SDL2 will refuse to create an OpenGL context on a window with the SDL_WINDOW_FOREIGN flag (i.e. windows that are passed to SDL2 through SDL_CreateWindowFrom). This must be fixed upstream.
On some systems, the Windows Raw Input driver fails to find the name of
a mouse device, causing a NRE. Since the name is not vital information,
a dummy name is generated as a workaround.
SDL2 does not report keydown and keyup events on modifiers keys until
you release them. Attempted to fix this using SDL_GetModifierState, but
this does not appear to work. Should hit upstream.
This resolves the issue where different layouts would return different
keys when pressing the same physical key. A new API must be introduced
for text input.
The SDL surface is no longer needed and will cause a memory leak if not
freed. Additionally, the decoded BitmapData should not be unlocked until
after updating the window icon, as it may be moved by the GC otherwise.
SDL2 suffers many of the issues we encountered when implementing
OpenTK.Platform.Windows. Workarounds are now in place to make
WindowState changes behave reasonably.
Wgl is implemented using the regular DllImport + delegate approach, in
order to support extensions. The delegates have not been armed at this
point, so we need to use the DllImport directly.
The whole wgl API should be revisited (we are using only a tiny
portion.)
The file had been added to the source tree, but was missing from the
OpenTK.Examples project configuration, causing hi-dpi mode to fail on
the examples window.
This is a new platform that can be used then sdl2 is installed on the target system. SDL2 is commercially supported by Valve and provides better support for MacOS compared to our current implementation (Cocoa vs Carbon). It will also help us introduce faster support for new platforms. Existing platforms remain as a fallback and will be automatically used if sdl2 is not installed.
Please note that this is still a work in progress. The new mouse and keyboard API is not supported yet. Due to limitations of sdl2, multiple mice/keyboards are also not supported.
Added application manifest with the necessary key to mark
OpenTK.Examples as high-dpi aware. This improves application
appearance when DPI scaling is enabled.
The platform factory for windows now calls SetProcessDPIAware
in order to enable support for high-dpi modes. The relevant
DllImport has been added to API.cs
Many Matrix*/Vector* implementations were throwing
IndexOutOfBoundsException when you tried to set their values via their
indexer due to a missing else statement.