6ccab1784f
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. |
||
---|---|---|
Dependencies | ||
Documentation | ||
Installers | ||
Source | ||
.gitattributes | ||
.gitignore | ||
OpenTK.sln | ||
OpenTK.snk | ||
README.md |
OpenTK
The Open Toolkit is an advanced, low-level C# library that wraps OpenGL, OpenGL ES and OpenAL. It is suitable for games, scientific applications and any other project that requires 3d graphics, audio or compute functionality.
This is the official GIT repository of the project:
https://github.com/opentk/opentk
Features
-
Create cutting-edge graphics with OpenGL 4.4 and OpenGL ES 3.0.
-
Integrate 3d into Windows.Forms, WPF or GTK# applications.
-
Write once run everywhere: support for Windows, Mac OS X, Linux, Xamarin.Android and Xamarin.iOS.
-
Use strong types and inline documentation to improve your code flow and catch errors sooner.
Requirements
OpenTK is designed to be used in an IDE with auto-completion and documentation tooltips:
- Visual Studio 2005 or higher
- Xamarin Studio 2.x or higher
- MonoDevelop 2.x or higher
- SharpDevelop 3.x or higher
You can develop on your favorite operating system. Compiled binaries can be deployed without recompilation on:
- Windows
- Linux
- Mac OS X
For:
- Android
- iOS you will need to recompile your code with Xamarin (http://xamarin.com/download)
Documentation
The Documentation/ folder contains extensive documentation on OpenGL, OpenGL ES and OpenAL. Start with these:
- OpenGL 4.4 API Reference.pdf or
- OpenGL ES 3.0 API Reference.pdf
Your favorite IDE will display inline documentation for all OpenTK APIs. Tutorials can be found in the OpenTK Manual
Need Help?
The community hangs out at the OpenTK forums
If you hit a bug, post an issue on https://github.com/opentk/opentk/issues
License
The Open Toolkit is distributed under the permissive MIT/X11 license and is absolutely free.