Commit graph

5681 commits

Author SHA1 Message Date
thefiddler
24be068742 [GLControl] Clarified docs regarding multiple contexts 2014-01-26 10:36:52 +01:00
thefiddler
cd42f92c12 [Input] Corrected GamePadState range to byte [0,255] 2014-01-25 17:05:06 +01:00
Stefanos A
40ce2c4288 Merge branch 'graphicsmode' into develop 2014-01-22 23:32:51 +01:00
Stefanos A.
06a3d7e1a7 [OpenTK] Don't skip AA modes in RelaxGraphicsMode
Previously, specifying an odd AA mode (e.g. 5x) would have been relaxed
to 0x. Now, it will be correctly relaxed to 4x.
2014-01-22 23:25:11 +01:00
thefiddler
417a6bedc1 [SDL2] Use RelaxGraphicsMode to find optimal mode
For SDL2, RelaxGraphicsMode requires us to clear context attributes
between consecutive attempts. This is implemented by calling
ClearGLAttributes().
2014-01-22 11:37:37 +01:00
thefiddler
0575e63a27 [Max] Use RelaxGraphicsMode to find optimal mode 2014-01-22 11:03:40 +01:00
thefiddler
6ba475e23f [Win] Use RelaxGraphicsMode to find optimal mode 2014-01-22 10:49:55 +01:00
thefiddler
615df9201b [OpenTK] Moved RelaxGraphicsMode to Utilities
This functionality is useful for all platform backends and is not
specific to the X11 backend.
2014-01-22 10:49:27 +01:00
thefiddler
6f3951e825 [OpenTK] Allow a GraphicsMode.Buffers value of 0
0 in this case means “don’t care”.
2014-01-22 10:48:40 +01:00
thefiddler
ff36f0f35a [OpenTK] Clamp max AA level to 64x
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.
2014-01-22 10:35:08 +01:00
thefiddler
2b6aec3b23 [OpenTK] Removed unused GraphicsMode field 2014-01-22 10:31:01 +01:00
Stefanos A.
770b697583 [Win] Clear extension list on reload 2014-01-21 09:04:27 +01:00
Stefanos A.
88ae446781 [Win] Removed WGL delegates in favor of calli 2014-01-21 09:00:57 +01:00
Stefanos A.
5379deaf63 [Win] Implemented calli-based interop for WGL 2014-01-21 09:00:25 +01:00
Stefanos A.
c2e3328f59 [GLControl] Use dummy context in design mode
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
2014-01-18 18:33:25 +01:00
Stefanos A.
b87b9e0a27 [Win] Fix X1/X2 mouse buttons (fixes issue #27) 2014-01-16 17:16:03 +01:00
Stefanos A
e1ef27d593 Merge branch 'utf8' into develop 2014-01-16 14:38:18 +01:00
Stefanos A.
8cb3538767 [Examples] Move UTF8 sample to Test folder 2014-01-16 14:37:27 +01:00
Stefanos A
51e99fe638 Merge branch 'utf8_test' of https://github.com/ganaware/opentk into utf8 2014-01-16 14:33:15 +01:00
Stefanos A.
b9f57ba4d2 [OpenTK] Use ASCII encoding
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.
2014-01-16 14:32:11 +01:00
Stefanos A
606b4ddcd1 Merge branch 'develop' of https://github.com/opentk/opentk into utf8 2014-01-16 11:44:34 +01:00
Stefanos A
9268b5ed7f Merge branch 'develop' into utf8 2014-01-16 11:39:22 +01:00
Nayuta Taga
b15f91a0f2 shader source with Japanese comment test 2014-01-16 18:27:32 +09:00
Nayuta Taga
1929cf60fa Merge branch 'utf8' into utf8_test 2014-01-16 18:05:03 +09:00
Stefanos A.
3b65e66958 [Docs] Updated readme file for release 2014-01-15 14:16:00 +01:00
thefiddler
e02093bb90 Merge branch 'linux_joystick' into develop 2014-01-15 01:25:49 +01:00
thefiddler
44e2576c86 [OpenTK] Protect against invalid axis/button ids 2014-01-15 01:24:20 +01:00
thefiddler
e6a9adf494 [OpenTK] Fixed polling 2014-01-15 01:19:45 +01:00
thefiddler
e7f037b0a2 [OpenTK] Fixed legacy joystick hotplugging & events 2014-01-15 01:13:39 +01:00
thefiddler
df7d7ae8eb [Linux] Implemented joystick guid detection 2014-01-15 00:57:28 +01:00
thefiddler
73e3b66038 [OpenTK] Use LegacyJoystickDriver for IJoystickDriver implementation 2014-01-14 23:53:24 +01:00
thefiddler
fb917a6d89 [Linux] Implemented joystick hotplugging 2014-01-14 23:51:31 +01:00
thefiddler
4ca8c78764 [OpenTK] Suggest alternative to obsolete INativeWindow.InputDriver property 2014-01-14 23:40:23 +01:00
Stefanos A.
4473c8373e [X11] Implemented joystick hotplugging
This is a work in progress.
2014-01-14 18:37:16 +01:00
Stefanos A.
b004dc7a0a [X11] Added INotify.cs to project files 2014-01-14 18:36:36 +01:00
Stefanos A.
4203c14b22 [X11] Removed IJoystickDriver from X11Joystick
Legacy IJoystickDriver support is now implemented through a
LegacyJoystickDriver instance.
2014-01-14 18:36:19 +01:00
Stefanos A
f3036e5f10 Merge branch 'develop' into linux_joystick 2014-01-14 18:26:05 +01:00
Stefanos A
cb4e4d5e72 Merge branch 'legacy_joystick' into linux_joystick 2014-01-14 18:17:05 +01:00
Stefanos A.
d467629ad8 [Linux] Added INotify bindings
These are not currently used.
2014-01-14 18:15:53 +01:00
Stefanos A
962a9f7733 Merge branch 'issue43_unstablefps' into develop 2014-01-14 14:21:19 +01:00
Stefanos A.
0c9b612bff [OpenTK] Increase max Update/RenderFrame rates
Given the new 144Hz monitors on the market today, it makes sense to
increase the Update/RenderFrame limit from 200Hz to 500Hz.
2014-01-14 14:20:38 +01:00
Stefanos A.
1f44cf27a1 [OpenTK] Do not hang when update rate too high
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.
2014-01-14 13:55:24 +01:00
Stefanos A.
95d71bc0cc [OpenTK] Respect a TargetUpdatePeriod of zero 2014-01-14 13:33:41 +01:00
Stefanos A.
7b98255626 [Examples] Improved timing display
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.
2014-01-14 13:27:09 +01:00
Stefanos A.
97e49b76b2 [OpenTK] Fix UpdateFrame quantization error
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.
2014-01-14 13:04:30 +01:00
Stefanos A.
3eccb89821 [OpenTK] Remove Thread.Sleep() from loop timing 2014-01-13 11:36:56 +01:00
Stefanos A.
b3554bb74c [OpenTK] Simplified update and render loops 2014-01-13 11:22:33 +01:00
thefiddler
7afe48c979 [Audio] Don't crash when Alc.GetString() returns null
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.
2014-01-12 22:05:15 +01:00
Stefanos A.
fca9f930e4 [OpenTK] Fix UpdateFrame loop condition
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
2014-01-12 21:37:18 +01:00
Stefanos A.
c31f64f7e1 [OpenTK] Frameskip needs TargetUpdateFrequency!=0 2014-01-11 01:46:38 +01:00