Wrap new generated binding calls with using ErrorHelper. Sets up a try
to call the method in and a finally block to call Dispose on the
ErrorHelper. Currently hardcoded to only work for the graphics modules.
GLHelper.cs contains a number of overloads that cannot be resolved by
VB.Net. We cannot remove them, as that will break
backward-compatibility, but we can hide them by moving them after the
autogenerated overloads in GL.cs.
Terrible hack, but it appears to work.
Issue originally reported at http://www.opentk.com/node/3554 as "OpenTK
1.1, VB.net and ambiguous functions."
Updated the Matrix4d CreateFromQuaternion methods to actually create
Matrix4d. They now mirror the Matrix4 CreateFromQuaternion methods,
just using doubles and the -d classes.
Previously, Matrix4d.CreateFromQuaterion actually created a Matrix4
from a single-precision Quaterion.
Using a bitfield does not save storage space in this case, and also
stops pattern matching from working (switch() statement in C# or match
… with expressions in F#.)
joyGetDevCaps() is an extremely slow call that allocates memory.
WinMMJoystick is now caching its results for a significant speedup in
Joystick.GetCapabilities() and GetState().
The cache is updated whenever a joystick device is removed. WIP to
handle device added notifications.
This protects against a potential denial-of-service issue during mode
selection, where the platform backend will try to reduce AA level until
a supported mode is found.
When refreshing the AvailableDevices list, it is important to set the
original resolution on any DisplayDevices that were previously available
to allow the RestoreResolution() method to work correctly.
Creating a GraphicsContext with null parameters is not a guarantee that
we will get a dummy context that does not call any OpenGL functions. We
need to explicitly define and construct a dummy context that is safe to
use inside the designer.
Affects issue #49
Most OpenGL versions work with single-byte ASCII strings exclusively.
OpenGL 4.2 adds UTF8 encoded comments to GLSL shaders. Unfortunately,
UTF16 (.Net) to UTF8 conversions will usually modify the length of the
resulting byte array.
This is not currently possible to implement inside OpenTK, since the
binding generator does not know which length parameter corresponds to a
string parameter.
For this reason, and to maintain compatibility with older OpenGL
versions, we perform a destructive UTF16-to-ASCII encoding, which
replaces unsupported characters by '?'. This allows multi-byte post-4.2.
GLSL shaders to work as expected.
If non-destructive round-tripping of strings is required, the user will
have to use the IntPtr overload for string parameters and perform the
UTF16-to-UTF8 encoding/decoding manually. This need is very unlikely to
arise in practice.
OpenTK will now detect when an UpdateFrame handler is consistently
taking too long to finish, and stop raising UpdateFrame events. This
gives ProcessEvents() a chance to execute and will protect the
application from hanging up.
GameWindowStates will now display the average fps and draw three moving
boxes based on different timing methods.
If the timing implementation in OpenTK is working correctly, all three
boxes should be moving at the same speed.
The UpdateFrame event rate will now match TargetUpdatePeriod even if
vsync is enabled. Previously, it would be quantized to a multiple or
integer fraction of of the vsync rate.
Alc.GetString() could crash if the unmanaged code returned null due to
any kind of failure. This is now fixed and better documented.
Additionally, the array overload for Alc.GetString() will now correctly
forward the ‘device’ parameter to unmanaged code.
Multiple UpdateFrame events should be raised to match the desired
TargetUpdateFrequency, when TargetUpdateFrequency > 0. The loop would
incorrectly check for TargetRenderFrequency instead.
Affects issue #43
This patch adds more robust checks for WGL_ARB_pixel_format and
WGL_ARB_multisample before using the relevant extensions, and adds
checks whether Wgl.Arb.ChoosePixelFormat() returns a valid pixel format
before trying to use it (thanks to Repetier for catching this edge
case.)
Additionally, the ChoosePixelFormatPFD code-path now heavily penalizes
single-buffered modes when the user requests a double-buffered mode.
Affects issues #42 and #45
SDL will fail to construct an OpenGL 3.x/4.x context on Mac OS X,
unless ContextProfileFlags.CORE is specified.
Fixes issue #44
Upstream enhancement request at
https://bugzilla.libsdl.org/show_bug.cgi?id=2342
When running over remote desktop without hardware acceleration, there
are no GraphicsModes that support desktop composition. This patch adds
logic to avoid requesting composition-capable modes when running over
RDP.
Additionally, it changes the mode selection logic to consider modes that
support features partially (e.g. 16bpp color instead of 32bpp), albeit
with a heavy penalty over fully supported modes.