platform/core/csapi/opentk.git
10 years ago[Mac] Fixed initial window position
thefiddler [Fri, 2 May 2014 13:13:38 +0000 (15:13 +0200)]
[Mac] Fixed initial window position

Cocoa sets the desktop origin at the bottom-left of the main screen,
with +y going up. OpenTK is setting the origin at the top-left of the
main screen, so we need to invert the y-axis.

10 years ago[Mac] Fixed cursor coords when CursorVisible=false
thefiddler [Fri, 2 May 2014 12:21:32 +0000 (14:21 +0200)]
[Mac] Fixed cursor coords when CursorVisible=false

10 years ago[Platform] Added INativeWindow.Mouse* events
thefiddler [Fri, 2 May 2014 12:18:52 +0000 (14:18 +0200)]
[Platform] Added INativeWindow.Mouse* events

10 years ago[Platform] Inherit NativeWindowBase
thefiddler [Fri, 2 May 2014 12:18:40 +0000 (14:18 +0200)]
[Platform] Inherit NativeWindowBase

10 years ago[Mac] Use On* methods from base class
thefiddler [Sun, 27 Apr 2014 07:39:30 +0000 (09:39 +0200)]
[Mac] Use On* methods from base class

10 years ago[OpenTK] Add On* methods to raise events
thefiddler [Sun, 27 Apr 2014 07:39:18 +0000 (09:39 +0200)]
[OpenTK] Add On* methods to raise events

10 years ago[Input] Added internal MouseDevice.Position getter
thefiddler [Sun, 27 Apr 2014 07:38:55 +0000 (09:38 +0200)]
[Input] Added internal MouseDevice.Position getter

10 years ago[Mac] Inherit from NativeWindowBase
thefiddler [Sun, 27 Apr 2014 07:21:33 +0000 (09:21 +0200)]
[Mac] Inherit from NativeWindowBase

This reduces code duplication significantly.

10 years ago[OpenTK] Added NativeWindowBase
thefiddler [Sun, 27 Apr 2014 07:20:33 +0000 (09:20 +0200)]
[OpenTK] Added NativeWindowBase

This acts as a common base class to INativeWindow implementations and
can be used to reduce code duplication.

10 years ago[Examples] Use Key.Enter to capture mouse
thefiddler [Thu, 1 May 2014 21:56:25 +0000 (23:56 +0200)]
[Examples] Use Key.Enter to capture mouse

10 years ago[Examples] Fixed cursor hotspot
thefiddler [Thu, 1 May 2014 20:17:06 +0000 (22:17 +0200)]
[Examples] Fixed cursor hotspot

10 years ago[Examples] Improved MouseCursor example
thefiddler [Thu, 1 May 2014 15:03:47 +0000 (17:03 +0200)]
[Examples] Improved MouseCursor example

10 years ago[Win] Only set MouseCursor in client area
thefiddler [Thu, 1 May 2014 14:49:23 +0000 (16:49 +0200)]
[Win] Only set MouseCursor in client area

This is required according to the windows documentation.

10 years ago[SDL][Win] Destroy custom cursor on Close()
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.

10 years ago[OpenTK] Rearranged MouseCursor parameters
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.

10 years ago[SDL] Fixed MouseCursor getting stuck after multiple changes
thefiddler [Wed, 30 Apr 2014 11:46:44 +0000 (13:46 +0200)]
[SDL] Fixed MouseCursor getting stuck after multiple changes

10 years ago[SDL] Fixed custom MouseCursor
thefiddler [Wed, 30 Apr 2014 11:36:16 +0000 (13:36 +0200)]
[SDL] Fixed custom MouseCursor

10 years ago[Example] Test custom cursor
thefiddler [Wed, 30 Apr 2014 07:06:30 +0000 (09:06 +0200)]
[Example] Test custom cursor

10 years ago[Mac] Fixed cursor byte order
thefiddler [Wed, 30 Apr 2014 07:06:18 +0000 (09:06 +0200)]
[Mac] Fixed cursor byte order

10 years ago[OpenTK] Fixed compilation error
thefiddler [Wed, 30 Apr 2014 06:45:27 +0000 (08:45 +0200)]
[OpenTK] Fixed compilation error

10 years ago[OpenTK] Renamed x/y to hotx/hoty
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.

10 years ago[Platform] Renamed MouseCursor.Rgba to Argb
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.

10 years ago[Mac] Implement NSCursor rectangles
thefiddler [Wed, 30 Apr 2014 06:38:19 +0000 (08:38 +0200)]
[Mac] Implement NSCursor rectangles

10 years ago[Platform] Make MouseCursor actor public
thefiddler [Wed, 30 Apr 2014 06:37:34 +0000 (08:37 +0200)]
[Platform] Make MouseCursor actor public

10 years ago[Win] Log wglSwapIntervalEXT errors
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.

10 years ago[OpenTK] Query the driver for VSyncMode getter
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.

10 years ago[All] Fixed checks for EXT_swap_control_tear
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.

10 years ago[Mac] Removed unused CarbonGLNative.cs
thefiddler [Mon, 28 Apr 2014 15:17:34 +0000 (17:17 +0200)]
[Mac] Removed unused CarbonGLNative.cs

10 years ago[Mac] Remove call to NewEventHandlerUPP
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.

10 years ago[Mac] CGDisplayBounds signature now matches Mac ABI
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.

10 years agoMerge branch 'pr/105' into develop
thefiddler [Mon, 28 Apr 2014 14:19:17 +0000 (16:19 +0200)]
Merge branch 'pr/105' into develop

10 years ago[Mac] Cmd-Q should raise Closing events
thefiddler [Mon, 28 Apr 2014 14:19:04 +0000 (16:19 +0200)]
[Mac] Cmd-Q should raise Closing events

It should also be cancelable.

10 years agoMerge branch 'thefiddler-cursor' into develop
thefiddler [Mon, 28 Apr 2014 07:38:54 +0000 (09:38 +0200)]
Merge branch 'thefiddler-cursor' into develop

10 years ago[Win] Fixed MouseCursor.Default
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.

10 years agoMerge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor
thefiddler [Mon, 28 Apr 2014 05:07:47 +0000 (07:07 +0200)]
Merge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor

10 years ago[X11] Fixed SGI_swap_control query
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.

10 years ago[GL] Added GetPName.Max*ImageUniforms
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.

10 years ago[OpenTK] Only init X11 if SDL2 is not used
thefiddler [Sun, 27 Apr 2014 20:41:24 +0000 (22:41 +0200)]
[OpenTK] Only init X11 if SDL2 is not used

10 years ago[X11] Fixed INativeWindow.Cursor getter
thefiddler [Sun, 27 Apr 2014 20:28:10 +0000 (22:28 +0200)]
[X11] Fixed INativeWindow.Cursor getter

10 years ago[Input] Fixed key modifiers in KeyboardDevice events
thefiddler [Sun, 27 Apr 2014 20:27:18 +0000 (22:27 +0200)]
[Input] Fixed key modifiers in KeyboardDevice events

10 years ago[SDL] Fixed cursor support
thefiddler [Sun, 27 Apr 2014 19:09:51 +0000 (21:09 +0200)]
[SDL] Fixed cursor support

SDL.CreateColorCursor takes 3 arguments, not 5.

10 years ago[Mac] Implement INativeWindow.Cursor
thefiddler [Sun, 27 Apr 2014 17:45:20 +0000 (19:45 +0200)]
[Mac] Implement INativeWindow.Cursor

10 years ago[OpenTK] Treat null as MouseCursor.Empty
thefiddler [Sun, 27 Apr 2014 17:45:08 +0000 (19:45 +0200)]
[OpenTK] Treat null as MouseCursor.Empty

10 years ago[OpenTK] Disable custom MouseCursors
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.

10 years ago[Examples] Set a predefined cursor on Key.Space
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.

10 years ago[Mac] Stubbed INativeWindow.Cursor
thefiddler [Sun, 27 Apr 2014 08:56:08 +0000 (10:56 +0200)]
[Mac] Stubbed INativeWindow.Cursor

10 years agoFix a bug in X11 CursorVisble with custom cursors.
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).

10 years agoChange bool to IntPtr.
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.

10 years agoCustom cursors on X11.
Fraser Waters [Sat, 22 Feb 2014 14:04:53 +0000 (14:04 +0000)]
Custom cursors on X11.

10 years agoAdd XcursorImageLoadCursor function.
Fraser Waters [Sat, 22 Feb 2014 14:04:01 +0000 (14:04 +0000)]
Add XcursorImageLoadCursor function.

10 years agoMake xcursor fields public.
Fraser Waters [Sat, 22 Feb 2014 14:03:46 +0000 (14:03 +0000)]
Make xcursor fields public.

10 years agoChange xcursor library name.
Fraser Waters [Sat, 22 Feb 2014 13:34:28 +0000 (13:34 +0000)]
Change xcursor library name.

10 years agoCreate and Destroy functions for XcursorImage.
Fraser Waters [Sat, 22 Feb 2014 12:54:34 +0000 (12:54 +0000)]
Create and Destroy functions for XcursorImage.

10 years agoXcursor types.
Fraser Waters [Sat, 22 Feb 2014 12:54:11 +0000 (12:54 +0000)]
Xcursor types.

10 years agoRespond to WM_SETCURSOR messages.
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.

10 years agoNo need for named variable.
Fraser [Fri, 21 Feb 2014 19:44:51 +0000 (19:44 +0000)]
No need for named variable.

10 years agoCopy to correct offset.
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.

10 years agoDon't hardcode cursor.png path.
Fraser Waters [Fri, 21 Feb 2014 11:35:15 +0000 (11:35 +0000)]
Don't hardcode cursor.png path.

10 years agoCopy cursor.png to output.
Fraser Waters [Fri, 21 Feb 2014 11:27:51 +0000 (11:27 +0000)]
Copy cursor.png to output.

10 years agoPartial implementation of Windows MouseCursor.
Fraser [Fri, 21 Feb 2014 00:24:24 +0000 (00:24 +0000)]
Partial implementation of Windows MouseCursor.

Very buggy, but starting to show results.

10 years agoMouseCursor example.
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.

10 years agoDestroyIcon function.
Fraser [Fri, 21 Feb 2014 00:10:57 +0000 (00:10 +0000)]
DestroyIcon function.

10 years agoGetCursor function.
Fraser [Fri, 21 Feb 2014 00:01:27 +0000 (00:01 +0000)]
GetCursor function.

10 years agoSetCursor function.
Fraser [Thu, 20 Feb 2014 23:40:40 +0000 (23:40 +0000)]
SetCursor function.

10 years agoGetIconInfo function.
Fraser [Thu, 20 Feb 2014 23:40:22 +0000 (23:40 +0000)]
GetIconInfo function.

10 years agoCreateIconIndirect function.
Fraser [Thu, 20 Feb 2014 22:26:53 +0000 (22:26 +0000)]
CreateIconIndirect function.

10 years agoIconInfo structure.
Fraser [Thu, 20 Feb 2014 22:20:10 +0000 (22:20 +0000)]
IconInfo structure.

10 years ago[All] Initial implementation of INativeWindow.Cursor property
thefiddler [Tue, 18 Feb 2014 15:44:28 +0000 (16:44 +0100)]
[All] Initial implementation of INativeWindow.Cursor property

Affects issue #9

10 years ago[SDL2] Implemented cursor APIs
thefiddler [Tue, 18 Feb 2014 15:43:47 +0000 (16:43 +0100)]
[SDL2] Implemented cursor APIs

Affects issue #9

10 years ago[Core] Added MouseCursor class
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)

10 years agoAdded Quit menu item + shortcut (Cmd+Q).
Olle Håkansson [Sun, 27 Apr 2014 08:52:28 +0000 (10:52 +0200)]
Added Quit menu item + shortcut (Cmd+Q).

10 years agoFixed creating contexts without native windows.
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).

10 years ago[ES][GL] Synced with April Khronos specification
thefiddler [Sun, 27 Apr 2014 07:53:22 +0000 (09:53 +0200)]
[ES][GL] Synced with April Khronos specification

10 years ago[X11] Set WM_CLASS property
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.

10 years agoMerge pull request #103 from thefiddler/memopt
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.

10 years ago[GL] Only print debug info in debug mode
thefiddler [Sat, 26 Apr 2014 17:13:03 +0000 (19:13 +0200)]
[GL] Only print debug info in debug mode

10 years ago[GL] Removed unused code
thefiddler [Sat, 26 Apr 2014 17:12:49 +0000 (19:12 +0200)]
[GL] Removed unused code

10 years ago[OpenTK] Removed reflection binding loading
thefiddler [Sat, 26 Apr 2014 16:28:51 +0000 (18:28 +0200)]
[OpenTK] Removed reflection binding loading

This code is no longer in use.

10 years ago[X11] Implemented new-style bindings for GLX
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.

10 years ago[Win] Fixed warnings
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

10 years ago[GL][ES] Regenerated bindings
thefiddler [Sat, 26 Apr 2014 12:23:52 +0000 (14:23 +0200)]
[GL][ES] Regenerated bindings

10 years ago[GL][ES] Do not break public API
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.

10 years ago[Bind] Do not generate DllImports
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.

10 years ago[Mac] Sped up extension loading
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.

10 years ago[Graphics] GetAddress(string) is no longer needed
thefiddler [Sat, 26 Apr 2014 12:20:17 +0000 (14:20 +0200)]
[Graphics] GetAddress(string) is no longer needed

10 years ago[Graphics] Redirect GetAddress(string)
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.

10 years ago[X11] Optimized XKey translation
thefiddler [Fri, 25 Apr 2014 19:55:00 +0000 (21:55 +0200)]
[X11] Optimized XKey translation

10 years ago[Bind][ES][GL] Output entry points as byte[]
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!)

10 years ago[Win] Wgl no longer inherits GraphicsBindingsBase
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.

10 years ago[ES] ES10 does not require initialization
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.

10 years ago[Input] Use Key.LastKey instead of Enum.GetValues
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.

10 years ago[Win] Replaced KeyMap dictionary with switch
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.

10 years ago[OpenTK] Rebased on develop
thefiddler [Fri, 25 Apr 2014 11:38:53 +0000 (13:38 +0200)]
[OpenTK] Rebased on develop

10 years ago[Bind] Do not generate slots for OpenGL <= v1.1
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.

10 years ago[OpenTK] Fixed DllImport library for OpenGL on Mac OS X
thefiddler [Wed, 2 Apr 2014 11:17:07 +0000 (13:17 +0200)]
[OpenTK] Fixed DllImport library for OpenGL on Mac OS X

10 years ago[Examples] Improved ExternalContext test
thefiddler [Wed, 2 Apr 2014 11:16:45 +0000 (13:16 +0200)]
[Examples] Improved ExternalContext test

Also added documentation

10 years ago[SDL2] Optimized Sdl2KeyCode translation
thefiddler [Wed, 2 Apr 2014 09:03:51 +0000 (11:03 +0200)]
[SDL2] Optimized Sdl2KeyCode translation

Also fixed Key.WinLeft, WinRight and Menu translation.

10 years ago[Mac] Optimized MacOSKeyCode 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.

10 years ago[GL] Added missing GetPName.MaxPatchVertices
thefiddler [Fri, 25 Apr 2014 09:11:42 +0000 (11:11 +0200)]
[GL] Added missing GetPName.MaxPatchVertices

10 years ago[Mac] Removed most legacy Carbon code
thefiddler [Thu, 24 Apr 2014 07:22:46 +0000 (09:22 +0200)]
[Mac] Removed most legacy Carbon code