Olle Håkansson
d1fb2597bb
Better handling of maximized window.
...
Used the “zoom” command before, but it has some limitations (e.g. no
event when zoom is done).
2014-04-24 13:45:05 +02:00
Olle Håkansson
7c3872531e
Disabled capturing when changing resolution.
...
Might be off here, but without capturing it seems like we get a
behaviour closer to that of the PC.
2014-04-24 13:45:05 +02:00
Olle Håkansson
50ed0ee9da
Bug fixes.
2014-04-24 13:45:05 +02:00
Olle Håkansson
63d0d057c5
Better fullscreen handling.
2014-04-24 13:45:05 +02:00
Olle Håkansson
59d7889ce0
Restored most window functionality.
2014-04-24 13:45:05 +02:00
Olle Håkansson
5457651676
Fixed swap interval.
2014-04-24 13:45:04 +02:00
Olle Håkansson
6c6beae4fc
Setup listening for window events.
2014-04-24 13:45:04 +02:00
Olle Håkansson
5e1b7c82ab
Cocoa bindings through libobjc.dylib
2014-04-24 13:45:04 +02:00
thefiddler
4ce1289d85
Merge branch 'es_docs' into develop
2014-04-02 09:27:23 +02:00
thefiddler
985aca3752
[Examples] Test mouse input under heavy load
2014-04-01 09:49:56 +02:00
thefiddler
74cff79d64
Merge remote-tracking branch 'frassle/issue76' into develop
2014-04-01 09:39:48 +02:00
thefiddler
d292d44b90
[Math] Replaced tab characters with spaces
2014-03-31 18:20:08 +02:00
thefiddler
e4fd62c0ff
Merge branch 'pr/84' into develop
2014-03-31 18:19:18 +02:00
thefiddler
bd920a15f2
[Bind] Corrected CSharpSpecWriter output and warning messages
...
CSharpSpecWriter now correctly outputs doc summaries on ARB_imaging
functions that do not have a version/deprecation string. Additionally,
it no longer warns about documentation parameter mismatches for
parameters matching C# keywords.
2014-03-31 17:40:15 +02:00
thefiddler
d68c31a561
[Bind] Move documentation generation to DocProcessor class
...
This de-duplicates a large amount of code that is shared between the
various ISpecWriter implementations.
2014-03-31 17:09:30 +02:00
thefiddler
8001d62599
[Bind] Make documentation output closer to previous xslt implementation
2014-03-31 10:10:56 +02:00
thefiddler
9012101e8c
[Bind] Propagate ComputeSize attribute in cloned Parameters
2014-03-31 10:09:33 +02:00
thefiddler
e11b7ca993
[Bind] More aggressive trimming of documentation strings
2014-03-31 09:51:15 +02:00
thefiddler
570d08fff1
[Bind] Add NoIndent option to BindStreamWriter
2014-03-31 09:50:51 +02:00
thefiddler
61791c91db
[Bind] Do not skip parameters in documentation
...
Multiple parameters may share a single description. The DocProcessor
will now correctly generate DocumentationParameters for each of them.
2014-03-30 19:16:30 +02:00
thefiddler
d1b99219ba
[Compatibility] Don't generate xml documentation
2014-03-30 11:01:30 +02:00
thefiddler
21b328992a
[Bind] Remove xmlns to simplify xpath processing
2014-03-30 11:01:03 +02:00
thefiddler
243f41b83f
[Bind] Use DocumentationParameter instead of KeyValuePair
2014-03-30 10:43:30 +02:00
thefiddler
bd9f760f4b
[Bind] Merge GL2 and GL4 documentation into one
2014-03-30 10:29:50 +02:00
thefiddler
033e0b7155
[Bind] Concatenate multiline documentation
2014-03-30 10:29:11 +02:00
thefiddler
67b0ead68b
[Bind] Process documentation from subdirectories
...
Instead of using xslt, we now process the documentation in code. This
allows us to fix mismatches from e.g. invalid parameter names that
sometimes creep in the specs.
2014-03-28 20:08:38 +01:00
thefiddler
22a706e44f
[Bind] Added documentation files for OpenGL ES
2014-03-28 20:06:55 +01:00
Fraser Waters
fbe6cc0a31
Use Marshal.GetLastWin32Error instead of GetLastError.
...
Also removes magic number 1171 and replaces with constant.
2014-03-23 22:31:32 +00:00
Fraser Waters
095d3f26c0
Use GetMouseMovePointsEx to smooth mouse input.
...
Uses GetMouseMovePointsEx to get mouse move history so mouse events aren't dropped even with low framerates.
Fixes #76 .
2014-03-23 16:26:24 +00:00
thefiddler
2a97192ef8
[Build] Updated copyright information
2014-03-18 14:29:41 +01:00
thefiddler
a24e1edeae
[Build] Set revision to 0 outside source control
...
This ensures that properly built packages take precedence to incorrectly
built packages.
2014-03-18 14:28:52 +01:00
thefiddler
db913ca3f4
[GL] Added missing [Rgba]16Snorm texture formats
...
See https://www.opengl.org/sdk/docs/man4/html/glTexImage2D.xhtml or the
4.4 spec, section 8.5, table "Sized internal color formats".
2014-03-18 12:08:02 +01:00
csantos
c48f6399e4
Centering the cursor at (width/2, height/2), effectively fixing
...
the issue described in https://github.com/mono/MonoGame/issues/2283
2014-03-18 01:44:52 -03:00
Phyyl
617131066a
Added multiplication operator to all vectors
2014-03-17 16:59:09 -04:00
thefiddler
ccb5408258
[Win] Invert vertical axes to match 1.0 API
...
The 1.0 API defines +y as up and -y as down. This matches XInput but
disagrees with WinMM, where we have to invert the vertical axes.
2014-03-17 00:43:36 +01:00
thefiddler
cae62151b8
[Input] LegacyJoystickDriver now reports hat pos
2014-03-17 00:30:19 +01:00
thefiddler
f93d464f62
[Input] JoystickHatState is now IEquatable
2014-03-17 00:30:04 +01:00
thefiddler
01c3b51be6
[Input] JoystickState.ToString now prints hat pos
2014-03-17 00:29:45 +01:00
thefiddler
05bbc0b3f4
[Win] Joystick driver now reports hat positions
2014-03-17 00:29:12 +01:00
thefiddler
f23b93b839
[SDL2] On Mac, OpenGL 3.0 or 3.1 should create 3.2 context
...
SDL2/Mac fails to create a 3.0 or 3.1 OpenGL context. We implicitly
bump version to 3.2, otherwise 3.0 or 3.1 would give a 2.1 context.
2014-03-16 22:50:12 +01:00
thefiddler
02bf55ad7e
[ES] Fixed loading of OpenGL ES core API
...
eglGetProcAddress cannot be used to retrieve
entry points of core functions. Instead, we
use [DllImport] for core functions and function
pointers for extension functions.
Squashed commit of the following:
commit 0b84aa6ef78dfa3600b81fc412eb192f2a87e40c
Author: thefiddler <stapostol@gmail.com>
Date: Sat Mar 15 02:24:58 2014 +0100
[Examples] Rolled back changes to Example browser
commit 1acfbaac3d17184debdbbe872c58ac07d1b37c0a
Author: thefiddler <stapostol@gmail.com>
Date: Sat Mar 15 02:20:57 2014 +0100
[Examples] Rolled back WinForms example
commit 835d9d6035a890bd3426566929fbfd25c493eca0
Author: thefiddler <stapostol@gmail.com>
Date: Sat Mar 15 01:15:01 2014 +0100
[Examples] Rolled back erroneous GLControl mods
commit 056418014f0e835e83fb85b54b8749519a555364
Author: thefiddler <stapostol@gmail.com>
Date: Fri Mar 14 23:11:11 2014 +0100
[Rewrite] Remove calli prototypes
When a function is called indirectly via a function pointer, its
prototype is not required (the prototype is added as a callsite at the
calli invocation.) Removing these prototypes reduces binary size by
roughly 400KB.
commit 353a16ec2836c597150d2fab28581e7c264b2b39
Author: thefiddler <stapostol@gmail.com>
Date: Fri Mar 14 22:31:25 2014 +0100
[Rewrite] Call DllImports directly
When a function does not have an allocated slot (i.e. slot = -1), then
we will call its DllImport signature directly.
commit 9a5313e4b7afb10b698d255e4b5637887bf71cf3
Author: thefiddler <stapostol@gmail.com>
Date: Fri Mar 14 22:30:04 2014 +0100
[Bind] Do not allocate slots for DllImports
commit 6ac5342409363cac0e59f9dc669948b319bd20a9
Author: thefiddler <stapostol@gmail.com>
Date: Fri Mar 14 22:29:07 2014 +0100
[Bind] Added option to use DllImports
This is necessary for the core functionality of OpenGL ES, where
eglGetProcAddress returns null or garbage (the latter on Android.)
2014-03-16 19:40:49 +01:00
thefiddler
242b8bbe6c
[Graphics] Init OpenTK when creating external context
...
Fixes issue #52
2014-03-13 19:51:29 +01:00
thefiddler
625ba5dcda
[Graphics] Regenerated with newest generator
2014-03-13 19:44:33 +01:00
thefiddler
d12bd18158
Merge branch 'gl_Mar2014' into develop
2014-03-13 19:39:37 +01:00
thefiddler
51c173e935
[Graphics] Documented parameter length
...
Fixes issue #15
2014-03-13 19:38:12 +01:00
thefiddler
baee71070e
Merge remote-tracking branch 'frassle/compsize' into develop
2014-03-13 19:34:58 +01:00
thefiddler
b3fac68b37
[Graphics] Synced with Khronos repository
...
Adds:
- INTEL_performance_query extension
- “count” attribute fixes for multiple functions
2014-03-13 18:46:01 +01:00
thefiddler
d7614f5718
[Bind] Clean up BindStreamWriter implementation
...
Instead of inheriting and overriding StreamWriter methods, it now
forwards its parameters to an internal StreamWriter, after applying the
necessary formatting changes.
This shields us from the StreamWriter implementation differences
between .Net and Mono.
2014-03-13 18:44:36 +01:00
thefiddler
cf728a631e
[Bind] Added overloads for backwards compatibility
2014-03-13 18:42:37 +01:00
thefiddler
a7516dc9b9
[Graphics] Improve compatibility with Feb2014 release (WIP)
2014-03-13 11:56:21 +01:00
thefiddler
13e80a7c06
Fix discrepancies between mono and .net
2014-03-12 18:13:05 +01:00
thefiddler
1c6cfc390b
Updated OpenGL definitions
2014-03-12 18:12:38 +01:00
thefiddler
6a3838757c
Fixed NRE when calling Toolkit.Dispose() more than once.
2014-03-11 16:00:25 +01:00
thefiddler
f5a4a4bd96
Merge branch 'issue69' into develop
2014-03-11 15:01:09 +01:00
thefiddler
3f8a62eaf7
Merge remote-tracking branch 'frassle/warnings' into develop
2014-03-11 14:57:36 +01:00
Fraser Waters
641225a312
Add length helper text to params.
...
If a param has ComputeSize text add [length: {0}] helper text to the documentation.
2014-03-10 22:13:53 +00:00
Fraser Waters
0c89435add
Store count attribue in ComputeSize.
...
Also remove the COMPSIZE() text if present.
2014-03-10 22:13:26 +00:00
Fraser Waters
7cdd880759
Add string ComputeSize to Parameter.
2014-03-10 21:40:26 +00:00
thefiddler
40a8a6d915
[GameWindow] Do not override Target*Frequency in GameWindow.Run()
...
This patch makes the following code work as expected:
```csharp
var gw = new GameWindow();
gw.TargetRenderFrequency = 60;
gw.Run();
```
Fixes issue #69
2014-03-06 14:16:30 +01:00
Paul Kratt
d9a7821319
Call the new code instead of leaving the old version untouched
2014-02-25 18:52:34 -06:00
Paul Kratt
0df7c55609
Update spacing and formatting to match existing style
2014-02-25 18:46:07 -06:00
Paul Kratt
ba0180ed77
Fix potential exception that I was ignoring.
...
This can happen, so we should handle it
2014-02-25 18:46:07 -06:00
Paul Kratt
794d45fdeb
Make GLControl work on OS X
...
This isn’t the greatest solution, but at least it doesn’t require us to
reference WinForms in OpenTK and it works perfectly for what I’m using.
2014-02-25 18:46:06 -06:00
Fraser Waters
b80bb86c5b
Remove unused fields and variables.
2014-02-25 10:31:17 +00:00
Fraser Waters
ab0751e7ec
ModalLoopCallback is never assigned.
...
ModalLoopCallback is never assigned, so always has it's default value
null. Replace all uses of ModalLoopCallback with null.
2014-02-25 10:31:17 +00:00
Fraser Waters
95bd094404
Disable Obsolete warning.
...
IGraphicsContext.VSync property is obsolete, but we have to call it in
the GraphicsContext.VSync implementation, so disable the obsolete
warning for this one use.
2014-02-25 10:31:17 +00:00
Fraser Waters
b89f79266b
Fix XML documentation.
2014-02-25 10:31:17 +00:00
Fraser Waters
366eb921a7
Fix compile warnings in Converter.
2014-02-25 10:31:17 +00:00
Fraser Waters
54f1e575d0
Fix compile warnings in Examples.
...
This commit fixes every current warning in the Example code bar two.
Both due to the use of the OpenTK.GameWindow.Joysticks.
2014-02-25 10:31:17 +00:00
thefiddler
2f4161108d
[X11] Fixed KeyUp event arguments
...
KeyUp event was incorrectly fired with KeyDownEventArgs instead of KeyUpEventArgs. This is now fixed.
2014-02-25 01:13:46 +01:00
thefiddler
d985362058
[Examples] Display modifier key information
2014-02-25 01:13:46 +01:00
thefiddler
ee1fb2a917
[X11] Implemented modifier keys
2014-02-25 01:13:46 +01:00
thefiddler
9ba21d6017
[Win] Implemented modifier keys
2014-02-25 01:13:45 +01:00
thefiddler
c92aabd807
[Input] Implemented GetModifiers() method
2014-02-25 01:13:45 +01:00
thefiddler
09f9bb3a17
[SDL2] Implemented modifier keys
...
Additionally, removed event watch callback in favor of calling
PollEvent() directly in ProcessEvents, which should be more efficient.
2014-02-25 01:13:45 +01:00
thefiddler
221d4661d4
[Input] Added modifier keys to KeyboardKeyEventArgs
2014-02-25 01:13:45 +01:00
thefiddler
0c262cd5b2
[SDL2] Added PeepEvents/PollEvent functions
2014-02-25 01:13:45 +01:00
thefiddler
14d53010b0
[SDL2] Corrected win/alt key mapping (was swapped previously)
2014-02-25 01:13:45 +01:00
thefiddler
56e4b3cc85
[Mac] Implemented modifier keys
2014-02-25 01:13:45 +01:00
thefiddler
4066ba8355
[Input] Added KeyModifiers enumeration
...
KeyModifiers are represented as a bitwise combination of the Alt,
Control and Shift keys.
2014-02-25 01:13:45 +01:00
thefiddler
346921981d
[Build] Added -debug to Rewrite commandline parameters
2014-02-25 01:08:53 +01:00
thefiddler
18ef634610
[Build] Fixed ErrorHelper local variable
...
We need to emit a ldloca instruction before constructing the
ErrorHelper instance, in order to reference it in the finally
block below.
2014-02-25 01:08:53 +01:00
thefiddler
2f3e7a9493
[Rewrite] Fixed exit from try-finally block
2014-02-25 01:08:53 +01:00
Fraser
10ca14ac6d
Add ErrorHelper to bindings.
...
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.
2014-02-25 01:08:53 +01:00
thefiddler
925abfdb10
[EGL] Removed unnecessary OpenTK.Platform.Windows reference
2014-02-21 14:04:33 +01:00
thefiddler
ae3f8cff55
[Doc] Fixed doxygen latex-to-pdf conversion
...
pdflatex will fail when a <seealso> elements is placed within a
<summary> element. This is now fixed.
2014-02-16 15:30:22 +01:00
Stefanos A.
0052ff435e
[Win] Do not raise KeyPress for control chars
...
This matches the documented behavior of the GameWindow.KeyPress event.
2014-02-13 14:01:35 +01:00
Stefanos A.
1c1607da56
[OpenTK] Make VB.Net overload resolution happy
...
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."
2014-02-12 16:14:00 +01:00
thefiddler
30571f7532
Merge pull request #58 from Frassle/develop
...
Replace non-breaking space.
2014-02-11 23:54:47 +01:00
Fraser Waters
a18fb1ebaa
Remove non-breaking space.
...
Causes the build on Ubuntu to fail.
2014-02-11 16:36:31 +00:00
Stefanos A
61f0ca89b4
Merge branch 'joyhat' into develop
2014-02-10 10:54:22 +01:00
thefiddler
ccd1ad0fd7
[GL] Do not limit strings to StringBuilder.Capacity. Fixes issue #57
...
We let StringBuilder grow to fit the unmanaged string. This appears to
match the default CLR marshaling behavior, which was used in OpenTK 1.0.
2014-02-07 15:57:36 +01:00
thefiddler
63dd4597c7
[GL][ES] Mark DebugProc* delegates as unmanaged function pointers
...
Calling convention is platform-dependent: stdcall on Windows, cdecl
elsewhere. This maps to CallingConvention.Winapi in .Net parlance.
2014-02-06 15:01:22 +01:00
thefiddler
bb741579c6
Merge pull request #56 from l3m/matrix4d-axis-angle
...
Updated Matrix4d.FromAxisAngle to mirror the Matrix4 version.
2014-02-06 10:33:09 +01:00
thefiddler
2bcf153475
[GL] Fixed invalid IL instruction in Get*() and Delete*() functions
2014-02-04 16:07:58 +01:00
thefiddler
d8eda71a2c
[GL] Added missing ActiveUniformType.FloatMat3x2 token
2014-02-04 14:26:52 +01:00
Jonas Boesch
e2ecba7274
Updated Matrix4d.FromAxisAngle to mirror the Matrix4 version.
2014-02-04 14:03:59 +01:00
thefiddler
6856fe5e71
Merged remote-tracking branch 'l3m/matrix4d-quat-fix' into develop
...
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.
2014-02-03 11:11:36 +01:00
Stefanos A.
d0522f1073
[Win] Do not create second WinMMJoystick instance
2014-02-01 16:03:07 +01:00
Stefanos A.
45df508f8f
[Win] Query WinMM joysticks on devicechange event
2014-02-01 16:02:02 +01:00
Stefanos A.
2d110728aa
[Win] Cache WinMM joystick capabilities
2014-02-01 16:01:33 +01:00
Stefanos A.
2dee96d918
[Input] Fixed SetButton index check
2014-01-31 16:40:57 +01:00
Stefanos A.
4fceca2f80
[Input] Fixed compilation error
2014-01-31 16:37:36 +01:00
thefiddler
5145ebceb7
[Mac] Implemented JoystickHat support
2014-01-31 16:17:04 +01:00
thefiddler
a7228274aa
[Input] Added JoystickCapabilities.HatCount
2014-01-31 15:40:07 +01:00
thefiddler
168c45f0e2
[SDL2] Implemented support for hat state
2014-01-31 15:03:51 +01:00
thefiddler
801d6ead04
[Input] Added hat state to JoystickState
2014-01-31 15:03:30 +01:00
thefiddler
0cacdf6ae4
[Input] Do not use a bitfield for hat position
...
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#.)
2014-01-31 15:03:19 +01:00
thefiddler
a4ce2182d2
[Input] Added JoystickHatState structure
2014-01-31 15:01:35 +01:00
thefiddler
5fe2d60857
[Input] Added structures for joystick hat input
2014-01-30 17:40:26 +01:00
thefiddler
41a23ca371
[Input] Fixed off-by-one error in internal max axes/buttons
2014-01-30 17:36:59 +01:00
Stefanos A.
0e7f237d5e
[Examples] BindAttribLocation must precede LinkProgram
2014-01-30 11:42:07 +01:00
Stefanos A.
bc95477488
[Examples] Updated to use 1.1 API
2014-01-30 11:40:01 +01:00
thefiddler
71d6da80de
[Win] Faster WinMM GetCapabilities() and GetState()
...
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.
2014-01-30 10:18:11 +01:00
thefiddler
eeaa3276f1
[Input] Implemented axis-button mappings
2014-01-29 10:39:18 +01:00
thefiddler
ef429aff01
[Input] Added support for JoystickButtons 16-31
2014-01-29 10:28:06 +01:00
thefiddler
c73e4785cd
Merge remote-tracking branch 'cwassall/develop' into develop
2014-01-26 12:19:51 +01:00
thefiddler
b9426006ef
[GLControl] Warn when accessing GL properties on non-current context
2014-01-26 11:08:08 +01:00
thefiddler
c9a86a63ab
[GLControl] Use IGraphicsContext.SwapInterval to get/set vsync
...
This patch fixes warnings related to the deprecated
IGraphicsContext.VSync property.
2014-01-26 10:39:39 +01:00
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.
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
cwassall
7b591962e8
Change original_resolution field to a property
...
As the original_resolution field needs to be accessed from outside the
module, it should be an internal property as opposed to an internal
field
2014-01-20 12:51:55 +00:00
cwassall
5f6c8e654c
Remember DisplayDevice original resolutions
...
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.
2014-01-19 19:44:12 +00: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.
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
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
Stefanos A.
19eb72b3a9
[OpenTK] Fixed Utilities.CreateSdl2WindowInfo
...
Utilities.CreateSdl2WindowInfo should store the specified windowHandle
directly instead of trying to call SDL.SDL.CreateWindowFrom.
2014-01-10 16:56:26 +01:00
Stefanos A.
aff9719872
[SDL2] Implemented GetWindowWMInfo
2014-01-10 16:55:20 +01:00
Stefanos A.
bdfcf43e0b
[Win] More robust pixel format selection
...
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
2014-01-10 15:41:57 +01:00
Stefanos A.
ef5aedba6f
[Win] More robust WGL extension detection
...
Affects issue #42 and issue #45
2014-01-10 09:24:59 +01:00
thefiddler
a4d2a31386
[Mac] OpenGL 3.x/4.x require core profile flag
...
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
2014-01-09 23:36:28 +01:00
Stefanos A.
7f64945079
[OpenTK] Do not raise *Frame events when time = 0
...
Affects issue #40
2014-01-09 00:51:09 +01:00
Stefanos A.
28ac3cec0b
[Win] Fix issue #35 (OpenTK over Remote Desktop)
...
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.
2014-01-09 00:14:25 +01:00
Stefanos A.
1b3b510376
[Win] Check registry keys before accessing
...
Fixes crashes when using OpenTK over the Remote Desktop Client for Mac
(version 2010).
2014-01-09 00:10:41 +01:00
Stefanos A.
4af9d30ccb
[Win] Fix issue #33 ; fix issue #34
...
This patch adds a workaround for WM_STYLECHANGED messages that are not
delivered when running on Mono/Windows. If we detect Mono, then we call
HandleStyleChanged() directly in order to update the internal state of
our WinGLNative instance.
2014-01-08 22:29:22 +01:00
Stefanos A.
51ad513dbb
[Win] Do not overload internal SetWindowLong
...
The internal function is now appended with "Internal".
2014-01-08 19:22:03 +01:00
Stefanos A.
7363cfee7b
[Win] Do not unregister class twice
...
Only the parent window would register a class, but both the parent and
the child window would unregister it. This is now fixed.
2014-01-08 19:21:29 +01:00
Stefanos A.
51baed7286
[Win] Remove unnecessary #if clauses
2014-01-08 00:45:42 +01:00
Stefanos A.
e260a42954
[Win] Refactor huge wndproc into functions
2014-01-08 00:02:27 +01:00
Stefanos A.
a961fb3db3
[Examples] Added keys to modify timing
...
Use [ and ] to decrease and increase the UpdateFrame frequency.
Use < and > to decrease and increase the RenderFrame frequency.
2014-01-07 22:09:52 +01:00
Stefanos A.
b6a806a568
[OpenTK] Improved timing stability
...
OpenTK now directly calculates the elapsed time between UpdateFrame
(RenderFrame) events and compares that directly to TargetUpdatePeriod
(TargetRenderPeriod). This significantly simplifies the implementation
and improves timing stability.
2014-01-07 22:09:02 +01:00
Stefanos A.
6e03d501ae
[OpenTK] Fixed Update/RenderTime calculation
...
These values should only be re-calculated when an Update/RenderFrame
event is raised. Otherwise, they should retain their previous values.
2014-01-07 15:55:11 +01:00
thefiddler
251f5717ae
[Examples] Improve timing information; add vsync toggle
2014-01-07 09:12:35 +01:00
thefiddler
99df27b635
[OpenTK] Corrected GameWindow.Update/RenderFrequency information
2014-01-07 09:11:55 +01:00
thefiddler
56a3dd91e5
[OpenTK] Implemented GameWindow.UpdateTime and RenderTime properties
2014-01-07 09:09:43 +01:00
thefiddler
3856fcd48e
[OpenTK] More robust timing for UpdateFrame and RenderFrame
...
FrameEventArgs.Time should no longer drift from clock time measured
outside GameWindow.
2014-01-07 08:52:02 +01:00
thefiddler
c5dcc8a93b
[Examples] Calculate timing information in GameWindowStates
2014-01-07 01:01:00 +01:00
thefiddler
d49dacb5b3
[Examples] Cleaned up input device printing in GameWindowStates
2014-01-07 00:48:09 +01:00
thefiddler
94c3c24bfb
[OpenTK] Platform backends should inherit from PlatformFactoryBase
...
This reduces code duplication wrt deprecated interfaces and common
support code between backends.
2014-01-06 14:49:05 +01:00
thefiddler
d84be0d594
[OpenTK] Added base IPlatformFactory implementation
...
PlatformFactoryBase provides a common base interface for platform
backends. Platform backends should inherit from PlatformFactoryBase in
order to reduce code duplication.
2014-01-06 14:47:58 +01:00
thefiddler
a94a293732
[Platform] Implemented legacy IJoystickDriver
...
LegacyJoystickDriver implements the legacy IJoystickDriver interface
(GameWindow.Joysticks) in terms of the new IJoystickDriver2 interface
(OpenTK.Input.Joystick).
This removes a large chunk of code from each platform backend, as they
no longer need to implement IJoystickDriver themselves. Additionally,
it adds support for device hot plugging which was previously missing.
2014-01-06 14:25:05 +01:00
Stefanos A.
83f54f70aa
[OpenTK] Simplify and improve timing calculations
...
This patch modifies GameWindow.Run() to use a single stopwatch instead
of two separate stopwatches for timing UpdateFrame and RenderFrame
events.
It improves timing accuracy for issue #20 (FrameEventArgs.Time
Inconsistencies)
2014-01-06 01:57:54 +01:00
Stefanos A.
88c57db5b6
[Math] Added MathHelper.Clamp
2014-01-06 01:52:08 +01:00
thefiddler
a9ab3650da
[Mac] Do not store *State structs directly
...
Storing Mouse/KeyboardState structs directly makes updates more
difficult than they should be. It is simpler to create simple classes
instead.
2014-01-05 23:58:05 +01:00
thefiddler
4d660fdeba
[Input] Added Keyboard/MouseState.SetIsConnected to mirror JoystickState
2014-01-05 23:50:17 +01:00
thefiddler
fda2d32d2d
[Mac] Map GamePads, MultiAxisControllers and Wheels to joysticks
2014-01-05 22:44:58 +01:00
thefiddler
a1123834a0
[Mac] Call DeviceRemoved() in Dispose() event
...
The necessary cleanup code already exists in DeviceRemoved(). No need
to duplicate this in the Dispose() event.
2014-01-05 22:38:26 +01:00
thefiddler
ab85afd5ba
[Mac] Avoid IOHIDDeviceConformsTo call in DeviceRemoved handler
...
DeviceAdded already checks that devices conform to the desired usage
pages. Checking again in DeviceRemoved is unnecessary - if a device
exists, then it has already passed muster.
2014-01-05 22:36:01 +01:00
thefiddler
9e223486f6
[Mac] Implement Joystick.GetGuid()
2014-01-05 22:15:55 +01:00
thefiddler
5c5afb3ea3
[Mac] Calculate joystick Guid for USB devices
2014-01-05 22:06:19 +01:00
thefiddler
b458b40683
[Mac] Use out/ref parameters instead of unsafe pointers in bindings
2014-01-05 22:05:54 +01:00
thefiddler
fa386dc991
[Mac] Connect devices to first available index
2014-01-05 21:53:28 +01:00
thefiddler
fc81f30251
[Examples] Draw device index for Joysticks and GamePads
2014-01-05 21:32:24 +01:00
thefiddler
05af21e61b
[Mac] Do not call CFRelease on HID properties
...
HID properties are callee-owned and should not be released by the
caller. Fixes crash (memory corruption) on device hot plugging.
2014-01-05 21:27:34 +01:00
thefiddler
02c9f471ea
[Mac] DllImport must be marked as extern
2014-01-05 21:18:20 +01:00
thefiddler
7388bd935d
[Mac] Correctly unschedule HIDManager from run loop
2014-01-05 20:17:03 +01:00
thefiddler
4c7f6a92a7
[Mac] Don't let exceptions escape to unmanaged code
2014-01-05 04:20:51 +01:00
thefiddler
892d129e54
[Mac] Fixed DllEntryPointNotFound crash on device unplugging
2014-01-05 04:15:30 +01:00
thefiddler
2ee24efb2f
[Mac] Implemented joystick buttons
2014-01-05 04:11:11 +01:00
thefiddler
fad42994e1
[Mac] Implemented joystick axis movement
2014-01-05 03:54:53 +01:00
thefiddler
92635b3f35
[Input] Added JoystickAxis/Button.Last; added JoystickAxis.Axis10.
...
JoystickAxis/Button.Last is used internally to allocate the correct
amount of storage for joystick axes and buttons. JoystickAxis.Axis10 is
required to support the maximum number of axes available on Mac OS X.
2014-01-05 03:54:34 +01:00
thefiddler
59249c2624
[Mac] Implemented joystick device detection
2014-01-05 03:03:46 +01:00
thefiddler
07bcda0f57
[Mac] Retrieve HID joystick name
2014-01-05 02:42:47 +01:00
thefiddler
6dadbd3570
[Mac] Implemented necessary CFString methods
2014-01-05 02:42:33 +01:00
thefiddler
32653d2c64
[Mac] Construct JoystickDevice when joysticks are connected
2014-01-05 00:47:40 +01:00
thefiddler
3757db9978
[Input] Allow extending JoystickDevice<>
2014-01-05 00:46:59 +01:00
thefiddler
bf8efea121
[Mac] Only add callbacks for recognized USB HID devices
2014-01-05 00:00:49 +01:00
thefiddler
c44b477388
[Mac] Implement device added/removed events for joysticks
2014-01-04 23:58:59 +01:00
thefiddler
9659a1d786
[Mac] Add skeleton HID input implementation for joysticks
2014-01-04 23:55:38 +01:00
thefiddler
3a63496b6d
Merge branch 'gamepad' into develop
...
Conflicts:
Source/OpenTK/OpenTK.csproj
2014-01-03 02:23:02 +01:00
thefiddler
514390fc9a
[Graphics] Added missing documentation comment
2014-01-03 02:18:28 +01:00
thefiddler
53552b0070
[Input] Corrected malformed documentation comments
2014-01-03 02:17:42 +01:00
thefiddler
3095afa18a
[Input] Documented all public members
2014-01-03 01:58:16 +01:00
thefiddler
b35aad1503
[Input] Removed JoystickState.GetAxis(int) overload
2014-01-03 01:58:08 +01:00
thefiddler
8649e4a044
[Input] Added SetVibration() API skeleton
2014-01-02 19:52:00 +01:00
thefiddler
ec43b9ff85
[Input] GamePad and Joystick classes should be sealed
2014-01-02 19:27:04 +01:00
thefiddler
b513e35ea8
[SDL2] Implemented PacketNumber property
2014-01-02 19:24:38 +01:00
thefiddler
1ccf7e5ad2
[Input] Added PacketNumber property
2014-01-02 19:24:15 +01:00
thefiddler
b5d42b7992
[Input] Implemented GetState() and simplified GetCapabilities()
2014-01-02 18:37:53 +01:00
thefiddler
d49af2787f
[Input] Simplified configuration parser and added GetEnumerator()
2014-01-02 18:37:20 +01:00
thefiddler
8f00bbc9f2
[Input] Added internal Joystick.GetAxisRaw() method
2014-01-02 18:36:27 +01:00
thefiddler
0593ea62e6
[Input] Added Source and Target to GamePadConfigurationItem
2014-01-02 18:36:09 +01:00
thefiddler
bf5d2a738d
[Input] Made configuration database non-static
2014-01-02 02:42:51 +01:00
thefiddler
9e4827bf67
[SDL2] Fixed SDL_JoystickGetGUID capitalization
2014-01-02 02:20:51 +01:00
thefiddler
a8fb977017
[Input] Initialize JoystickDevice.Details in constructor
2014-01-02 02:20:25 +01:00
thefiddler
fb57a9062d
[Input] Renamed GamePadMap to GamePadConfiguration
2014-01-02 01:38:12 +01:00
thefiddler
dc1ffab78d
[Input] Implemented IGamePadDriver.GetName()
2014-01-02 01:34:21 +01:00
thefiddler
c2c76f2ab2
[Input] Made the Name property public
...
We can use the name property to implement a hypothetical
GamePad.GetName() method in the future.
2014-01-02 01:33:57 +01:00
thefiddler
b056a50e73
[Input] Added xml documentation for GamePadCapabilities
2014-01-02 01:33:08 +01:00
thefiddler
a0dad7f698
[Input] Implemented MappedGamePadDriver.GetCapabilities()
2014-01-02 01:13:20 +01:00
thefiddler
f0fbb26efe
[Input] Added ability to parse SDL configuration db strings
2014-01-02 01:07:21 +01:00
thefiddler
5e75fac056
[Input] Added configuration db for GamePads
...
The database is based on the SDL bindings found at
https://hg.libsdl.org/SDL/file/b744b3f8754b/src/joystick/SDL_gamecontrol
lerdb.h
2014-01-02 01:06:47 +01:00
thefiddler
b9a8e365de
[Input] Added IJoystickDriver2.GetGuid() API
2013-12-31 14:09:17 +01:00
thefiddler
cd143af60a
[SDL2] Added JoystickGetGUID method
2013-12-31 14:08:28 +01:00
thefiddler
1687518ef5
[SDL2] Add compile-time check for SDL2 GameController vs MappedGamePadDriver
2013-12-31 11:46:40 +01:00
thefiddler
ef7f31099d
[Input] Removed unnecessary #region
2013-12-31 01:02:07 +01:00
thefiddler
7d4d116ce9
[Input] Renamed GamePadMapping to GamePadMap
2013-12-31 01:01:52 +01:00
thefiddler
d4348c5083
[SDL2] Fixed joystick/controller hotplugging support
2013-12-30 17:22:45 +01:00
thefiddler
9c8a5f5028
[SDL2] Fixed GameControllerButton to Buttons translation
2013-12-30 17:15:49 +01:00