thefiddler [Thu, 1 May 2014 12:27:20 +0000 (14:27 +0200)]
[SDL][Win] Destroy custom cursor on Close()
X11 destroys the cursor after setting it and Cocoa uses an autorelease
pool, so that should not be necessary there.
thefiddler [Wed, 30 Apr 2014 18:04:31 +0000 (20:04 +0200)]
[OpenTK] Rearranged MouseCursor parameters
MouseCursor and WindowIcon now match GL.TexImage2D in the way they
arrange their parameters. The expected values of each parameter are now
documented.
thefiddler [Wed, 30 Apr 2014 11:46:44 +0000 (13:46 +0200)]
[SDL] Fixed MouseCursor getting stuck after multiple changes
thefiddler [Wed, 30 Apr 2014 11:36:16 +0000 (13:36 +0200)]
[SDL] Fixed custom MouseCursor
thefiddler [Wed, 30 Apr 2014 07:06:30 +0000 (09:06 +0200)]
[Example] Test custom cursor
thefiddler [Wed, 30 Apr 2014 07:06:18 +0000 (09:06 +0200)]
[Mac] Fixed cursor byte order
thefiddler [Wed, 30 Apr 2014 06:45:27 +0000 (08:45 +0200)]
[OpenTK] Fixed compilation error
thefiddler [Wed, 30 Apr 2014 06:44:48 +0000 (08:44 +0200)]
[OpenTK] Renamed x/y to hotx/hoty
The new name matches their functionality closer.
thefiddler [Wed, 30 Apr 2014 06:38:57 +0000 (08:38 +0200)]
[Platform] Renamed MouseCursor.Rgba to Argb
This matches the default format of System.Drawing.Bitmap.
thefiddler [Wed, 30 Apr 2014 06:38:19 +0000 (08:38 +0200)]
[Mac] Implement NSCursor rectangles
thefiddler [Wed, 30 Apr 2014 06:37:34 +0000 (08:37 +0200)]
[Platform] Make MouseCursor actor public
thefiddler [Tue, 29 Apr 2014 06:48:49 +0000 (08:48 +0200)]
[Win] Log wglSwapIntervalEXT errors
Note that we cannot use Marshal.GetLastWin32Error because we are not
using regular DllImports for WGL extensions.
thefiddler [Tue, 29 Apr 2014 06:31:47 +0000 (08:31 +0200)]
[OpenTK] Query the driver for VSyncMode getter
Otherwise, the user could call Context.SwapInterval directly, causing
the vsync property to fall out of sync.
thefiddler [Tue, 29 Apr 2014 06:10:18 +0000 (08:10 +0200)]
[All] Fixed checks for EXT_swap_control_tear
EGL and NSOpenGL do not offer an EXT_swap_control_tear equivalent so
use regular vsync for now. The relevant extension string is now
correctly checked on WGL and GLX.
thefiddler [Mon, 28 Apr 2014 15:17:34 +0000 (17:17 +0200)]
[Mac] Removed unused CarbonGLNative.cs
thefiddler [Fri, 4 Apr 2014 06:46:32 +0000 (08:46 +0200)]
[Mac] Remove call to NewEventHandlerUPP
NewEventHandlerUPP fails to load when running through MonoKickstart. It
appears that this function is only used for old PPC systems that had
trouble with function pointers - sample code online indicates that we
do not need to call this.
thefiddler [Thu, 3 Apr 2014 21:19:31 +0000 (23:19 +0200)]
[Mac] CGDisplayBounds signature now matches Mac ABI
This resolves a crash in CGDisplayBounds when running through monokick.
thefiddler [Mon, 28 Apr 2014 14:19:17 +0000 (16:19 +0200)]
Merge branch 'pr/105' into develop
thefiddler [Mon, 28 Apr 2014 14:19:04 +0000 (16:19 +0200)]
[Mac] Cmd-Q should raise Closing events
It should also be cancelable.
thefiddler [Mon, 28 Apr 2014 07:38:54 +0000 (09:38 +0200)]
Merge branch 'thefiddler-cursor' into develop
thefiddler [Mon, 28 Apr 2014 07:37:16 +0000 (09:37 +0200)]
[Win] Fixed MouseCursor.Default
It is now possible to switch from a custom cursor back to
MouseCursor.Default.
thefiddler [Mon, 28 Apr 2014 05:07:47 +0000 (07:07 +0200)]
Merge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor
thefiddler [Sun, 27 Apr 2014 23:29:34 +0000 (01:29 +0200)]
[X11] Fixed SGI_swap_control query
GLX can return valid function pointer to unsupported functions.
We need to check for extension support in addition to the
function pointer.
Fixes crash on OpenSUSE 13.1 in VirtualBox.
thefiddler [Sun, 27 Apr 2014 20:47:04 +0000 (22:47 +0200)]
[GL] Added GetPName.Max*ImageUniforms
These tokens were introduced in OpenGL 4.2 and 4.3.
thefiddler [Sun, 27 Apr 2014 20:41:24 +0000 (22:41 +0200)]
[OpenTK] Only init X11 if SDL2 is not used
thefiddler [Sun, 27 Apr 2014 20:28:10 +0000 (22:28 +0200)]
[X11] Fixed INativeWindow.Cursor getter
thefiddler [Sun, 27 Apr 2014 20:27:18 +0000 (22:27 +0200)]
[Input] Fixed key modifiers in KeyboardDevice events
thefiddler [Sun, 27 Apr 2014 19:09:51 +0000 (21:09 +0200)]
[SDL] Fixed cursor support
SDL.CreateColorCursor takes 3 arguments, not 5.
thefiddler [Sun, 27 Apr 2014 17:45:20 +0000 (19:45 +0200)]
[Mac] Implement INativeWindow.Cursor
thefiddler [Sun, 27 Apr 2014 17:45:08 +0000 (19:45 +0200)]
[OpenTK] Treat null as MouseCursor.Empty
thefiddler [Sun, 27 Apr 2014 17:44:45 +0000 (19:44 +0200)]
[OpenTK] Disable custom MouseCursors
They require further development, due to byte-order differences between
platforms.
MouseCursor is now derived from WindowIcon, which we will use for
INativeWindow.Icon support in the future, in order to remove the
dependency to System.Drawing.
thefiddler [Sun, 27 Apr 2014 17:43:16 +0000 (19:43 +0200)]
[Examples] Set a predefined cursor on Key.Space
Custom cursor are not enabled for OpenTK 1.1.2. They will be part of
OpenTK 1.1.3.
thefiddler [Sun, 27 Apr 2014 08:56:08 +0000 (10:56 +0200)]
[Mac] Stubbed INativeWindow.Cursor
Fraser Waters [Mon, 24 Feb 2014 12:58:41 +0000 (12:58 +0000)]
Fix a bug in X11 CursorVisble with custom cursors.
CursorVisible reset to the default cursor when showing the cursor, it
should instead show the custom cursor if it's defined (else the default
cursor).
Fraser Waters [Sat, 22 Feb 2014 14:08:18 +0000 (14:08 +0000)]
Change bool to IntPtr.
WindowProc returns an IntPtr not a bool, so let Handle* functions return
IntPtr?. If they return a value we return that, if they return null we
call DefWindowProc and return the result from that.
Fraser Waters [Sat, 22 Feb 2014 14:04:53 +0000 (14:04 +0000)]
Custom cursors on X11.
Fraser Waters [Sat, 22 Feb 2014 14:04:01 +0000 (14:04 +0000)]
Add XcursorImageLoadCursor function.
Fraser Waters [Sat, 22 Feb 2014 14:03:46 +0000 (14:03 +0000)]
Make xcursor fields public.
Fraser Waters [Sat, 22 Feb 2014 13:34:28 +0000 (13:34 +0000)]
Change xcursor library name.
Fraser Waters [Sat, 22 Feb 2014 12:54:34 +0000 (12:54 +0000)]
Create and Destroy functions for XcursorImage.
Fraser Waters [Sat, 22 Feb 2014 12:54:11 +0000 (12:54 +0000)]
Xcursor types.
Fraser [Fri, 21 Feb 2014 19:46:13 +0000 (19:46 +0000)]
Respond to WM_SETCURSOR messages.
Calling SetCursor on mouse moves is not enough, we need to respond to
SETCURSOR messages. If we have a custom cursor we need to call SetCursor
and then NOT call DefWindowProc, otherwise we just call DefWindowProc
for the forms default cursor.
Fraser [Fri, 21 Feb 2014 19:44:51 +0000 (19:44 +0000)]
No need for named variable.
Fraser [Fri, 21 Feb 2014 19:35:34 +0000 (19:35 +0000)]
Copy to correct offset.
Offset into image is y * stride, not y * bpp.
Fraser Waters [Fri, 21 Feb 2014 11:35:15 +0000 (11:35 +0000)]
Don't hardcode cursor.png path.
Fraser Waters [Fri, 21 Feb 2014 11:27:51 +0000 (11:27 +0000)]
Copy cursor.png to output.
Fraser [Fri, 21 Feb 2014 00:24:24 +0000 (00:24 +0000)]
Partial implementation of Windows MouseCursor.
Very buggy, but starting to show results.
Fraser [Fri, 21 Feb 2014 00:23:20 +0000 (00:23 +0000)]
MouseCursor example.
Small example to show how the MouseCursor class can be used.
Fraser [Fri, 21 Feb 2014 00:10:57 +0000 (00:10 +0000)]
DestroyIcon function.
Fraser [Fri, 21 Feb 2014 00:01:27 +0000 (00:01 +0000)]
GetCursor function.
Fraser [Thu, 20 Feb 2014 23:40:40 +0000 (23:40 +0000)]
SetCursor function.
Fraser [Thu, 20 Feb 2014 23:40:22 +0000 (23:40 +0000)]
GetIconInfo function.
Fraser [Thu, 20 Feb 2014 22:26:53 +0000 (22:26 +0000)]
CreateIconIndirect function.
Fraser [Thu, 20 Feb 2014 22:20:10 +0000 (22:20 +0000)]
IconInfo structure.
thefiddler [Tue, 18 Feb 2014 15:44:28 +0000 (16:44 +0100)]
[All] Initial implementation of INativeWindow.Cursor property
Affects issue #9
thefiddler [Tue, 18 Feb 2014 15:43:47 +0000 (16:43 +0100)]
[SDL2] Implemented cursor APIs
Affects issue #9
thefiddler [Tue, 18 Feb 2014 15:43:21 +0000 (16:43 +0100)]
[Core] Added MouseCursor class
This branch marks the beginning of hardware cursor support (affects
issue #9)
Olle Håkansson [Sun, 27 Apr 2014 08:52:28 +0000 (10:52 +0200)]
Added Quit menu item + shortcut (Cmd+Q).
Olle Håkansson [Sun, 27 Apr 2014 07:58:05 +0000 (09:58 +0200)]
Fixed creating contexts without native windows.
To create a context for the GTK GLWidget, you need to be able to
specify the exact NSView you want the OpenGL context to apply to. Also,
you don’t want to initialise the NSApplication in this situation, which
the CocoaContext did before (unintentionally).
thefiddler [Sun, 27 Apr 2014 07:53:22 +0000 (09:53 +0200)]
[ES][GL] Synced with April Khronos specification
thefiddler [Sat, 26 Apr 2014 18:27:00 +0000 (20:27 +0200)]
[X11] Set WM_CLASS property
This allows Ubuntu Unity and Gnome Shell to detect and display
the correct application name.
thefiddler [Sat, 26 Apr 2014 17:26:07 +0000 (19:26 +0200)]
Merge pull request #103 from thefiddler/memopt
Memory optimizations. Memory consumption reduced by up to 80% and memory allocations reduced by up to 70%, depending on the platform.
thefiddler [Sat, 26 Apr 2014 17:13:03 +0000 (19:13 +0200)]
[GL] Only print debug info in debug mode
thefiddler [Sat, 26 Apr 2014 17:12:49 +0000 (19:12 +0200)]
[GL] Removed unused code
thefiddler [Sat, 26 Apr 2014 16:28:51 +0000 (18:28 +0200)]
[OpenTK] Removed reflection binding loading
This code is no longer in use.
thefiddler [Sat, 26 Apr 2014 16:24:13 +0000 (18:24 +0200)]
[X11] Implemented new-style bindings for GLX
Replaced delegates with call instructions and completely removed the
old extension loading code.
thefiddler [Sat, 26 Apr 2014 16:22:50 +0000 (18:22 +0200)]
[Win] Fixed warnings
Protected object in static class and wrong parameter names in
documentation
thefiddler [Sat, 26 Apr 2014 12:23:52 +0000 (14:23 +0200)]
[GL][ES] Regenerated bindings
thefiddler [Sat, 26 Apr 2014 12:23:29 +0000 (14:23 +0200)]
[GL][ES] Do not break public API
Even if that API is not meant to be used by applications.
thefiddler [Sat, 26 Apr 2014 12:22:37 +0000 (14:22 +0200)]
[Bind] Do not generate DllImports
These break dynamic loading of OpenGL ES and bloat OpenTK.dll with
duplicated strings. The new extension loading mechanism is now fast
enough to make DllImports unnecessary.
thefiddler [Sat, 26 Apr 2014 12:21:26 +0000 (14:21 +0200)]
[Mac] Sped up extension loading
From ~200ms down to ~65ms on a rMBP with Nvidia 650M and Mac OS X
10.9.2.
thefiddler [Sat, 26 Apr 2014 12:20:17 +0000 (14:20 +0200)]
[Graphics] GetAddress(string) is no longer needed
thefiddler [Sat, 26 Apr 2014 12:19:19 +0000 (14:19 +0200)]
[Graphics] Redirect GetAddress(string)
GetAddress(string) now calls GetAddress(IntPtr) internally. This
reduces the number of APIs that must be implemented for each platform.
thefiddler [Fri, 25 Apr 2014 19:55:00 +0000 (21:55 +0200)]
[X11] Optimized XKey translation
thefiddler [Fri, 25 Apr 2014 15:25:20 +0000 (17:25 +0200)]
[Bind][ES][GL] Output entry points as byte[]
Moving from string[] to byte[] reduces startup memory allocations
tremendously (up to 70% lower memory use on Windows!)
thefiddler [Fri, 25 Apr 2014 15:23:06 +0000 (17:23 +0200)]
[Win] Wgl no longer inherits GraphicsBindingsBase
This is a necessary step for the next commit.
thefiddler [Fri, 25 Apr 2014 12:50:55 +0000 (14:50 +0200)]
[ES] ES10 does not require initialization
It consists solely of DllImports that will be initialized on first use,
regardless of the existence of an OpenGL context.
thefiddler [Fri, 25 Apr 2014 12:15:06 +0000 (14:15 +0200)]
[Input] Use Key.LastKey instead of Enum.GetValues
This avoids unnecessary memory allocations in the KeyboardDevice
constructor.
thefiddler [Fri, 25 Apr 2014 12:13:55 +0000 (14:13 +0200)]
[Win] Replaced KeyMap dictionary with switch
This reduces the amount of allocations on the startup path.
thefiddler [Fri, 25 Apr 2014 11:38:53 +0000 (13:38 +0200)]
[OpenTK] Rebased on develop
thefiddler [Wed, 2 Apr 2014 11:19:41 +0000 (13:19 +0200)]
[Bind] Do not generate slots for OpenGL <= v1.1
We can use DllImports for OpenGL functions <= v1.1 on all platforms,
including Windows. This allows us to reduce the number of required
GetProcAddress calls by 474, reducing startup time and memory
consumption.
This setting can be turned off through Settings.Legacy.UseDllImports
and UseWindowsCompatibleGL.
thefiddler [Wed, 2 Apr 2014 11:17:07 +0000 (13:17 +0200)]
[OpenTK] Fixed DllImport library for OpenGL on Mac OS X
thefiddler [Wed, 2 Apr 2014 11:16:45 +0000 (13:16 +0200)]
[Examples] Improved ExternalContext test
Also added documentation
thefiddler [Wed, 2 Apr 2014 09:03:51 +0000 (11:03 +0200)]
[SDL2] Optimized Sdl2KeyCode translation
Also fixed Key.WinLeft, WinRight and Menu translation.
thefiddler [Wed, 2 Apr 2014 08:33:06 +0000 (10:33 +0200)]
[Mac] Optimized MacOSKeyCode translation
This also reduces memory allocations on startup by ~10K.
thefiddler [Fri, 25 Apr 2014 09:11:42 +0000 (11:11 +0200)]
[GL] Added missing GetPName.MaxPatchVertices
thefiddler [Thu, 24 Apr 2014 07:22:46 +0000 (09:22 +0200)]
[Mac] Removed most legacy Carbon code
thefiddler [Thu, 24 Apr 2014 07:09:11 +0000 (09:09 +0200)]
[Mac] Removed unused Carbon APIs
thefiddler [Wed, 23 Apr 2014 23:14:40 +0000 (01:14 +0200)]
[Mac] Migrated AglContext to OpenTK.GLControl
thefiddler [Wed, 23 Apr 2014 20:14:09 +0000 (22:14 +0200)]
[Mac] Mouse coordinates are reported in pixels
thefiddler [Wed, 23 Apr 2014 20:13:53 +0000 (22:13 +0200)]
[Mac] SendFloat should use _fpret on i386
thefiddler [Wed, 23 Apr 2014 19:20:18 +0000 (21:20 +0200)]
[Mac] Use scrollFactor variable
thefiddler [Wed, 23 Apr 2014 19:17:58 +0000 (21:17 +0200)]
[Mac] Fixed a warning related to volatile UniqueId
Also changed the class name to OpenTK_GameWindow
thefiddler [Wed, 23 Apr 2014 19:00:24 +0000 (21:00 +0200)]
[Mac] Window should be invisible on startup
Also fixes the initial position of the window.
thefiddler [Thu, 24 Apr 2014 11:45:17 +0000 (13:45 +0200)]
Merge branch 'pr/101' into develop
Olle Håkansson [Wed, 23 Apr 2014 18:15:09 +0000 (20:15 +0200)]
Licensed files under MIT/X11.
thefiddler [Tue, 22 Apr 2014 22:05:34 +0000 (00:05 +0200)]
[Mac] Avoid class conflicts for multiple windows
When creating multiple windows, their classes must have different class
names or they will fail to construct.
This commit ensures their names are unique. It also fixes a potential
memory leak in the Icon setter.
thefiddler [Tue, 22 Apr 2014 22:03:07 +0000 (00:03 +0200)]
[Mac] Add CocoaContext.GetGraphicsMode via CGL
Once the context is constructed, we use GetGraphicsMode to retrieve the
exact GraphicsMode that was selected by CocoaContext.
Olle Håkansson [Tue, 22 Apr 2014 19:39:17 +0000 (21:39 +0200)]
Fixed too high mouse scrolling speed.
Olle Håkansson [Tue, 22 Apr 2014 19:29:03 +0000 (21:29 +0200)]
Much improved handling of window/border states.