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.
OpenTK is available for Windows, Linux, Mac OS X, *BSD, SteamOS, Android and iOS. It can be used standalone or integrated into a GUI (Windows.Forms, WPF, GTK+, Qt, VTK, ...)
[Download binaries](http://www.opentk.com) or [NuGet packages](http://www.nuget.org/packages/OpenTK/)
Instructions
============
The simplest way to use OpenTK in your project is to install the [NuGet package](http://www.nuget.org/packages/OpenTK/).
Alternatively, download the [OpenTK binaries](http://www.opentk.com) and:
1. Copy OpenTK.dll and OpenTK.dll.config to your project directory
2. Use "Add reference" to add OpenTK.dll as a project reference
3. Use "Add files" to add OpenTK.dll.config to your project, and enable the "Copy to Output Directory" option.
If you wish to build OpenTK from source, simply double-click OpenTK.sln
News
====
OpenTK 1.1.2 was released on 19 May 2014.
It contains performance and stability improvements and synchronizes the OpenGL and OpenGL ES bindings with the May 2014 Khronos specifications.
=== Changelog: ===
1. New Cocoa backend for Mac OS X, with support for OpenGL 4.x and retina displays. Huge thanks to [Ollhax](https://github.com/Ollhax) for implementing the backend from scratch, including the necessary Cocoa bindings!
2. Custom hardware cursors are now supported: `INativeWindow.Cursor = new MouseCursor(...)`
3. Up to 2000% improvement in binding loading speed. The exact numbers depend on the operating system and hardware configuration. On a Nvidia 650M GPU and a 2.3GHz processor:
- Linux: 6.5ms instead of 45ms
- MacOS: 9.5ms instead of 165ms
- Win64: 5.9ms instead of 108ms
4. Up to 1000% improvement in memory consumption. The object graph has been reduced from 9000 to 900 objects, consuming between 185-220KB of memory depending on the platform and hardware configuration.
5. Support for high-resolution X/Y scrolling on all platforms:
-`OpenTK.Input.MouseState.Scroll.X/Y`
6. Improved mouse input APIs:
- new INativeWindow.MouseMove, MouseUp, MouseDown and MouseWheel events
- new OpenTK.Mouse.GetCursorPos() API to retrieve the state of the system cursor
- all mouse event arguments now carry the current MouseState
7. Improved keyboard input APIs:
- support for non-US layouts on Linux/X11
- all keyboard event arguments now carry the current KeyboardState
- all keyboard event arguments now report the correct KeyModifiers state
8. New OpenGL extensions:
- AMD_gcn_shader
- AMD_gpu_shader_int64
- AMD_transform_feedback4
- EXT_shader_image_load_formatted
- NV_shader_thread_group
- NV_shader_thread_shuffle
9. New OpenGL ES extensions:
- ARM_shader_framebuffer_fetch
- ARM_shader_framebuffer_fetch_depth_stencil
- EXT_shader_pixel_local_storage
- KHR_blend_equation_advanced
- OES_sample_shading
- OES_sample_variables
- OES_shader_image_atomic
- OES_shader_multisample_interpolation
- OES_texture_stencil8
- OES_texture_storage_multisample_2d_array
10. Improved OpenGL ES documentation tooltips.
11. Improved stability when using EGL on Linux and Windows/ANGLE.
12. Improved stability when using SDL2 on 32bit platforms.
13. Improved the shutdown sequence on X11.
14. Fixed a marshaling issue affecting 2d and 3d arrays on Windows/.Net.
OpenTK 1.1.2 is backwards compatible with 1.1.1. Users of previous versions are encouraged to upgrade.
Known issues
============
1. The SDL2 backend has a number of limitations compared to the native platform backends. In particular, SDL2 does not support:
-`OpenTK.GLControl`. OpenTK will automatically use a native platform backend instead.
-`DisplayDevice.ChangeResolution()` without a fullscreen `INativeWindow`.
- changing `INativeWindow.WindowBorder` once a window is created.
- high-resolution mouse input. Additionally, it is limited to a single keyboard and mouse device.
Your favorite IDE will display inline documentation for all OpenTK APIs. Additional information can be found in the [OpenTK Manual](http://www.opentk.com/doc) and in the [opentk/Documentation/](https://github.com/opentk/opentk/tree/develop/Documentation) folder.
OpenTK 1.1.0 is not backwards compatible with 1.0. Most projects will be able to upgrade without any modifications. Projects using the following signatures will have to implement the suggested changes:
Namespace OpenTK.Graphics.OpenGL
Change signature:
- GL.MultiDrawArrays (`out` -> `ref`)
- GL.Amd.DeletePerfMonitors (`out` -> `ref`)
Change signature (may cause crash):
- GL.Apple.ObjectPurgeable (returns `AppleObjectPurgeable` instead of `IntPtr`)