Stefanos A [Thu, 5 Dec 2013 13:53:37 +0000 (14:53 +0100)]
Merge remote-tracking branch 'origin/master' into no-reflect
Stefanos A. [Thu, 5 Dec 2013 11:05:26 +0000 (12:05 +0100)]
Move installer to destination directory
This reduces the garbage left behind by the installer generation script.
Stefanos A. [Thu, 5 Dec 2013 11:04:58 +0000 (12:04 +0100)]
Streamlined nsis installer
OpenAL is now included in the Dependencies/ folder and NShader is no
longer linked to by the installer.
Stefanos A. [Thu, 5 Dec 2013 11:04:15 +0000 (12:04 +0100)]
Ignore generated installers
Stefanos A. [Thu, 5 Dec 2013 10:42:01 +0000 (11:42 +0100)]
Corrected zip build script
Excluded items are now really excluded.
Stefanos A [Thu, 5 Dec 2013 10:20:58 +0000 (11:20 +0100)]
Reduce temporary string allocations
Instead of modifying the name of an OpenGL symbol on the managed side,
before copying it to the unmanaged side, we perform the modification
directly on the unmanaged side. This reduces the total amount of
allocations in OpenTK by ~30% (673496 bytes in 10750 objects compared
to 930272 bytes in 15243 objects before this modification.)
Stefanos A [Thu, 5 Dec 2013 08:14:13 +0000 (09:14 +0100)]
Added debug arguments in release builds
Stefanos A [Thu, 5 Dec 2013 08:13:50 +0000 (09:13 +0100)]
Generate debug symbols in release builds
Stefanos A. [Thu, 5 Dec 2013 08:03:12 +0000 (09:03 +0100)]
Updated project files
Generate debug symbols on release builds. Remove unused resx file that
referenced WinForms.
Stefanos A [Wed, 4 Dec 2013 21:32:56 +0000 (22:32 +0100)]
Implemented manual marshaling of string parameters
Stefanos A [Wed, 4 Dec 2013 21:26:30 +0000 (22:26 +0100)]
Correct convenience wrapper implementation
Stefanos A [Wed, 4 Dec 2013 20:22:33 +0000 (21:22 +0100)]
Convert string[] callsites to IntPtr
This fixes the signature mismatch between the new marshaling code and
the callsites.
Stefanos A [Wed, 4 Dec 2013 19:33:19 +0000 (20:33 +0100)]
Implemented marshaling for string arrays
This allows functions such as GL.ShaderSource to run on Mono without
crashing.
Stefanos A [Tue, 3 Dec 2013 08:10:45 +0000 (09:10 +0100)]
Regenerated bindings
Stefanos A [Tue, 3 Dec 2013 08:10:36 +0000 (09:10 +0100)]
Clean up wrapper generation
We can now apply multiple WrapperTypes values to a single parameter.
Stefanos A [Tue, 3 Dec 2013 08:09:19 +0000 (09:09 +0100)]
Update WrapperTypes values for [Flags]
Stefanos A [Tue, 3 Dec 2013 07:59:48 +0000 (08:59 +0100)]
Removed duplicate ldarg
Stefanos A. [Mon, 2 Dec 2013 22:39:36 +0000 (23:39 +0100)]
Workaround for #5
WS_CLIPCHILDREN and WS_CLIPSIBLINGS appear to cause flickering on
specific video cards. OpenGL appears to work correctly without these, so
we'll disable them to return to OpenTK 1.0 behavior.
Stefanos A. [Mon, 2 Dec 2013 22:37:22 +0000 (23:37 +0100)]
Fixed centering for non DPI-aware applications
Stefanos A. [Mon, 2 Dec 2013 22:37:00 +0000 (23:37 +0100)]
DPI-scaling should affect resolution
The correct resolution will now be reported depending on whether the
application is DPI-aware.
Stefanos A. [Mon, 2 Dec 2013 21:34:39 +0000 (22:34 +0100)]
High-resolution mode is enabled by default
Stefanos A. [Mon, 2 Dec 2013 21:18:16 +0000 (22:18 +0100)]
Made DPI-awareness configurable (issue #6)
It is now possible to indicate that an application is not DPI-aware. In
that case, OpenTK will let the operating system handle DPI scaling. This
results in worse visuals (pixel doubling) but allows non DPI-aware
applications to continue working.
Stefanos A [Mon, 2 Dec 2013 15:30:14 +0000 (16:30 +0100)]
Removed unused code
Stefanos A [Mon, 2 Dec 2013 11:00:11 +0000 (12:00 +0100)]
Added MonoDevelop project policy
Stefanos A [Mon, 2 Dec 2013 10:59:40 +0000 (11:59 +0100)]
Initial implementation of manual StringBuilder marshaling (WIP)
The implementation is based on Marshal.AllocHGlobal and
Marshal.FreeHGlobal. This is not working correctly yet.
Stefanos A [Mon, 2 Dec 2013 10:58:41 +0000 (11:58 +0100)]
Added manual marshaling for StringBuilder
Mono fails to marshal StringBuilder arguments in unmanaged callsites
invoked through calli. We need to implement the marshaling code
ourselves.
Stefanos A [Sun, 1 Dec 2013 20:25:03 +0000 (21:25 +0100)]
Use StdCall calling convention by default
It appears that calli callsites cannot be decorated with the
“platformapi” calling convention like DllImport signatures can. This is
problematic since Windows uses stdcall by default and most other
platforms use cdecl.
There are three approaches to this issue, without going back to
delegate calls: (a) generate an unmanaged thunk that cleans up the
stack after a GL call; (b) use libFFI; (c) use cdecl *or* stdcall
everywhere and hope that the runtime can cope.
.Net 2.0 can detect and fix stdcall functions invoked through a cdecl
callsite. .Net 4.0 adds a configuration option to enable or disable
this fixup (faster p/invoke if disabled) and raise a MDA exception when
this condition is detected. (This affects x86 only.)
Mono appears to be able to cope with cdecl functions invoked through a
stdcall callsite.
More testing is required.
Stefanos A [Sun, 1 Dec 2013 20:17:15 +0000 (21:17 +0100)]
Mark slots with [DllImport]; remove "core" and "delegates" generation
We should be able to use static pinvokes on platforms that do not
provide or require extensions and calli instructions on platforms with
extension APIs. This dinstiction will be implemented as a parameter in
the rewriter.
Stefanos A [Sun, 1 Dec 2013 17:28:25 +0000 (18:28 +0100)]
Regenerated bindings
Stefanos A [Sun, 1 Dec 2013 17:28:11 +0000 (18:28 +0100)]
Enabled symbol generation; minor code cleanup
Stefanos A [Sun, 1 Dec 2013 17:26:01 +0000 (18:26 +0100)]
Use untyped int for enums in unmanaged callsites
By using untyped integers instead of typed integers in the unmanaged
callsites, we allow monolinker to keep the exact set of enums that are
used by the user. Without this, we’d have to keep every single enum in
place to avoid missing type exceptions.
This does not affect the public signatures or the generated code in any
way.
Stefanos A [Sat, 30 Nov 2013 01:32:10 +0000 (02:32 +0100)]
Load system types from referenced mscorlib
Stefanos A. [Sat, 30 Nov 2013 01:16:34 +0000 (02:16 +0100)]
Use C calling convention even on Windows
Stefanos A. [Sat, 30 Nov 2013 01:00:07 +0000 (02:00 +0100)]
Corrected the handling of arrays
This includes arrays of primitives and arrays of generics. Our code is
similar to the code generated by the Mono C# compiler for the "fixed"
construct. The .Net compiler produces slightly different code (two local
variables instead of one) - more research is required.
Stefanos A. [Fri, 29 Nov 2013 18:24:38 +0000 (19:24 +0100)]
Refactored il emitters into methods
Stefanos A. [Fri, 29 Nov 2013 18:11:52 +0000 (19:11 +0100)]
Use unmanaged StdCall calling convention
Default results in a managed calling convention which does not generate
unmanaged thunking code for parameter marshaling.
System.Runtime.InteropServices.CallingConvention.Winapi appears to
correspond to StdCall for calli callsites (this might be different for
pinvoke, which supports an unmanaged "platformapi" calling convention.)
Needs more testing to prove this is doing the right thing on non-Windows
platforms.
Stefanos A. [Thu, 28 Nov 2013 22:23:03 +0000 (23:23 +0100)]
Removed deleted file from project
Stefanos A. [Thu, 28 Nov 2013 22:22:35 +0000 (23:22 +0100)]
Removed unused WGL methods
WGL was autogenerated a few years ago but never touched after that.
Since we use a tiny fraction of all available methods, it makes sense to
remove the unused ones. This reduces dll size and improves startup
times.
Stefanos A. [Thu, 28 Nov 2013 22:21:19 +0000 (23:21 +0100)]
Added GetProcAddress(IntPtr) overloads
This might allow us to improve startup performance, by avoiding string
marshaling during extension loading.
Stefanos A. [Thu, 28 Nov 2013 08:04:08 +0000 (09:04 +0100)]
Fixed wglGetProcAddress entry point
A typo would cause extension loading to fail. This is now fixed.
Stefanos A. [Wed, 27 Nov 2013 18:37:59 +0000 (19:37 +0100)]
Removed unused WGL bindings
Our WGL bindings contained dozens of methods that OpenTK did not use.
Removing these reduces the dll size and improves startup times.
Stefanos A. [Wed, 27 Nov 2013 18:36:42 +0000 (19:36 +0100)]
Fixed entry point validity check
Stefanos A. [Wed, 27 Nov 2013 08:16:23 +0000 (09:16 +0100)]
Enable InitLocals to make peverify happy
Stefanos A. [Wed, 27 Nov 2013 08:09:33 +0000 (09:09 +0100)]
Fixed convenience return type implementation
Stefanos A. [Wed, 27 Nov 2013 07:45:28 +0000 (08:45 +0100)]
Corrected RewrittenAttribute definition
Stefanos A. [Wed, 27 Nov 2013 07:28:39 +0000 (08:28 +0100)]
Build 3.5 profile with Visual Studio
Stefanos A. [Wed, 27 Nov 2013 07:28:22 +0000 (08:28 +0100)]
Rewrite nested types
Fixes zero-RVA exception for OpenGL extensions (e.g. GL.Ext etc)
Stefanos A. [Wed, 27 Nov 2013 07:27:52 +0000 (08:27 +0100)]
Use [AutoGenerated] only for generated methods
The rewriter will patch the body of methods marked with [AutoGenerated].
Methods that are implemented manually (e.g. various math helper
overloads) should avoid this attribute.
Stefanos A [Wed, 27 Nov 2013 00:40:12 +0000 (01:40 +0100)]
Implemented string return types
Stefanos A [Tue, 26 Nov 2013 23:05:26 +0000 (00:05 +0100)]
Added MonoDevelop artifacts
Stefanos A [Tue, 26 Nov 2013 23:03:21 +0000 (00:03 +0100)]
Regenerated bindings
Stefanos A [Tue, 26 Nov 2013 23:03:03 +0000 (00:03 +0100)]
Implemented convenience wrapper types
Stefanos A [Tue, 26 Nov 2013 23:02:26 +0000 (00:02 +0100)]
Emit native signatures
The patcher uses those signatures to implement wrapper functionality
for the various wrapper types that exist in OpenTK.
Stefanos A [Tue, 26 Nov 2013 18:07:01 +0000 (19:07 +0100)]
Update to latest version from git
Stefanos A [Tue, 26 Nov 2013 18:06:39 +0000 (19:06 +0100)]
Protect against multiple runs; optimize il
Stefanos A [Tue, 26 Nov 2013 00:31:29 +0000 (01:31 +0100)]
Do not emit method bodies.
Stefanos A [Tue, 26 Nov 2013 00:31:10 +0000 (01:31 +0100)]
Rewrite support for [Slot] attribute
Stefanos A. [Mon, 25 Nov 2013 19:00:22 +0000 (20:00 +0100)]
Initial work on Pin<> statements (WIP)
Stefanos A. [Mon, 25 Nov 2013 09:06:10 +0000 (10:06 +0100)]
Fixed build on Visual Studio
Stefanos A [Mon, 25 Nov 2013 07:54:15 +0000 (08:54 +0100)]
Applied MonoDevelop project style
Stefanos A [Mon, 25 Nov 2013 07:53:44 +0000 (08:53 +0100)]
Corrected keyfile path
Stefanos A [Mon, 25 Nov 2013 07:53:27 +0000 (08:53 +0100)]
Corrected patch for CallReturn<TRet, ...> signatures
.Net will happily execute a calli with a generic return type, whereas
Mono will refuse to. Mono is probably doing the right thing here. Fixed
by resolving the generic return into a concrete type.
Stefanos A. [Sun, 24 Nov 2013 23:58:39 +0000 (00:58 +0100)]
Added rewrite postbuild event
Stefanos A. [Sun, 24 Nov 2013 23:58:09 +0000 (00:58 +0100)]
Fixed calling convention for non-Windows platforms
Stefanos A. [Sun, 24 Nov 2013 23:26:20 +0000 (00:26 +0100)]
Fixed core loading on Windows
On Windows, entry points for OpenGL 1.0 and 1.1 are not exposed by
wglGetProcAddress. We fall back to LoadLibrary+GetProcAddress when
wglProcAddress fails.
Stefanos A. [Sun, 24 Nov 2013 23:20:55 +0000 (00:20 +0100)]
Added OpenTK.Rewrite project
Stefanos A. [Sun, 24 Nov 2013 23:20:22 +0000 (00:20 +0100)]
Added InteropHelper file
Stefanos A. [Sun, 24 Nov 2013 23:19:54 +0000 (00:19 +0100)]
Implemented dll rewriter using Mono.Cecil
Stefanos A. [Sun, 24 Nov 2013 23:19:18 +0000 (00:19 +0100)]
Regenerated bindings
Stefanos A. [Sun, 24 Nov 2013 23:18:43 +0000 (00:18 +0100)]
Moved address parameter to last place
This way, it is the last item on the evaluation stack before calling the
unmanaged function pointer. This simplifies the calli rewrite procedure.
Stefanos A. [Sun, 24 Nov 2013 12:59:15 +0000 (13:59 +0100)]
Removed GLObsolete.cs helper
This file must be recreated using the new loading mechanism.
Stefanos A. [Sun, 24 Nov 2013 12:58:54 +0000 (13:58 +0100)]
Regenerated bindings with new loading mechanism
Stefanos A. [Sun, 24 Nov 2013 12:58:30 +0000 (13:58 +0100)]
Hooked up new loading mechanism
Stefanos A. [Sun, 24 Nov 2013 12:58:12 +0000 (13:58 +0100)]
Hooked up new loading mechanism
Stefanos A. [Sun, 24 Nov 2013 12:57:43 +0000 (13:57 +0100)]
Implemented new loading mechanism
Stefanos A. [Sun, 24 Nov 2013 12:57:23 +0000 (13:57 +0100)]
Clarified GetAddress documentation
Stefanos A. [Sun, 24 Nov 2013 12:57:08 +0000 (13:57 +0100)]
Allow overriding of loading methods
Stefanos A. [Sun, 24 Nov 2013 12:56:35 +0000 (13:56 +0100)]
Removed delegates and DllImports
Stefanos A. [Sun, 24 Nov 2013 12:55:13 +0000 (13:55 +0100)]
Add slots into entry point table
Stefanos A. [Sun, 24 Nov 2013 12:54:52 +0000 (13:54 +0100)]
Generate entry point tables
Stefanos A [Sat, 23 Nov 2013 16:23:26 +0000 (17:23 +0100)]
Moved delegate loaders to the Delegates class
Stefanos A [Fri, 22 Nov 2013 19:07:01 +0000 (20:07 +0100)]
Regenerated bindings with lazy loading
Stefanos A [Fri, 22 Nov 2013 19:06:49 +0000 (20:06 +0100)]
Added support for lazy binding loading
Stefanos A [Fri, 22 Nov 2013 19:06:28 +0000 (20:06 +0100)]
Moved GetExtensionDelegate to the correct position
Stefanos A [Fri, 22 Nov 2013 19:06:04 +0000 (20:06 +0100)]
Added static GetExtensionDelegate implementation
Stefanos A. [Fri, 22 Nov 2013 17:25:30 +0000 (18:25 +0100)]
Add test for new text input events
Elias Holzer [Fri, 22 Nov 2013 17:05:11 +0000 (18:05 +0100)]
Implemented KeyPress event for Sdl2NativeWindow.
Elias Holzer [Fri, 22 Nov 2013 17:04:53 +0000 (18:04 +0100)]
Implemented KeyDown and KeyUp events for Sdl2NativeWindow.
Elias Holzer [Fri, 22 Nov 2013 17:03:17 +0000 (18:03 +0100)]
Enabled KeyDown and KeyUp events in NativeWindow.
Stefanos A [Fri, 22 Nov 2013 16:32:17 +0000 (17:32 +0100)]
Implemented direct binding loading
OpenTK normally uses reflection to load bindings, instead of generating
huge constructors. Although reflection is faster on first load (thanks
to reduced JIT overhead), it fails to work correctly with monolinker.
This branch explores the performance of a direct binding.
Stefanos A. [Fri, 22 Nov 2013 13:10:21 +0000 (14:10 +0100)]
Fix "CursorVisible bugs"
When we enter the modal resize loop on Windows with ClipCursor set, we
cause a feedback loop where every resize causes the cursor to move and
every move causes a new resize. To fix this, we need to ungrab the
cursor when we are enter the modal loop.
Stefanos A. [Thu, 21 Nov 2013 23:32:42 +0000 (00:32 +0100)]
Updated release notes
Stefanos A. [Thu, 21 Nov 2013 18:44:12 +0000 (19:44 +0100)]
Updated todo list
Stefanos A. [Thu, 21 Nov 2013 08:34:34 +0000 (09:34 +0100)]
Updated build instructions.
Stefanos A. [Thu, 21 Nov 2013 08:34:06 +0000 (09:34 +0100)]
Fix exceptions on reused OpenGL context handles
Implementations may reuse OpenGL context handles that have been
destroyed. If a context is finalized but not Disposed, then OpenTK may
keep a reference to the old context handle, causing a crash when the
same handle is returned for a new context. To fix that, new context
handles will now replace old handles in case of a clash.
Stefanos A. [Thu, 21 Nov 2013 08:31:32 +0000 (09:31 +0100)]
Destroy SDL window when finalized
SDL_DestroyWindow must be called on the main thread. If the window is
finalized, the finalizer will push a CLOSE event to the event loop
(thread-safe) and the window will be destroyed on the main thread.
Stefanos A. [Wed, 20 Nov 2013 17:05:45 +0000 (18:05 +0100)]
Fixed #5
We need to release the cursor before closing a GameWindow, otherwise
subsequent GameWindows may fail to receive mouse events.
Stefanos A. [Wed, 20 Nov 2013 12:12:42 +0000 (13:12 +0100)]
Toolkit.Init() now returns a concrete class
This gives us room for expansion in the future, if necessary.
Stefanos A. [Wed, 20 Nov 2013 12:05:49 +0000 (13:05 +0100)]
Removed incorrect comment
Stefanos A. [Wed, 20 Nov 2013 08:10:12 +0000 (09:10 +0100)]
Fixed #4
Sdl2InputDriver.Dispose() would call SDL_DelEventWatch with a different
"user_data" parameter than SDL_AdEventWatch. This caused the EventFilter
to remain registered and subsequently crash when closing and reopening a
window.