Stop using DisplayLocks for every MakeCurrent context call.
[platform/core/csapi/opentk.git] / README.md
1 OpenTK
2 ======
3
4
5 ### MAINTAINERS WANTED
6
7 OpenTK is a large project, with a huge number of components. We're looking to add a more maintainers to the team.
8 Email [@varon](https://github.com/varon) or message him in Gitter if you'd like to help out. 
9
10 [![Join the chat at https://gitter.im/opentk/opentk](https://badges.gitter.im/opentk/opentk.svg)](https://gitter.im/opentk/opentk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11
12 The Open Toolkit library is a fast, low-level C# binding for OpenGL, OpenGL ES and OpenAL. It runs on all major platforms and powers hundreds of apps, games and scientific research.
13
14 Use OpenTK to add cross-platform 3d graphics, audio, compute and haptics to your C# application. Integrate it into your existing user interface or use it standalone without any external dependencies.
15
16 Project website: https://opentk.github.io/
17
18 Official git repository: https://github.com/opentk/opentk
19
20
21 Build Status
22 ========
23
24 | Platform       | Status         |
25 | -------------- | -------------- |
26 | Windows        | [![Build status](https://ci.appveyor.com/api/projects/status/opentk/branch/develop?svg=true)](https://ci.appveyor.com/project/varon/opentk/branch/develop) |
27 | Mono/Linux     | [![Build status](https://travis-ci.org/opentk/opentk.svg?branch=develop)](https://travis-ci.org/opentk/opentk) |
28
29
30 Features
31 ========
32
33 - Create cutting-edge graphics with OpenGL 4.6 and OpenGL ES 3.0
34 - Spice up your GUI with 3d acceleration
35 - Improve your code flow with strong types and inline documentation
36 - Write once run everywhere
37
38 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, ...)
39
40 [Download binaries](http://www.opentk.com) or [NuGet packages](http://www.nuget.org/packages/OpenTK/)
41
42
43 Instructions
44 ============
45
46 The simplest way to use OpenTK in your project is to install the [NuGet package](http://www.nuget.org/packages/OpenTK/).
47 If you want to try out the latest development build from the `develop` branch, we also have a [MyGet feed](https://www.myget.org/F/opentk-develop/api/v3/index.json).
48
49 Note what installing NuGet package will add reference to OpenTK.dll, but OpenTK.dll.config 
50 will not be copied to the project output directory automatically, so you need to add it to your project 
51 and then enable the "Copy to Output Directory" option (as in step 3 below).
52
53 To build OpenTK from source, simply double-click OpenTK.sln and build through your IDE.
54
55 Alternatively, open a command prompt and type:
56 ```
57 git clone https://github.com/opentk/opentk   # Download source code from git
58 cd opentk                                    # Enter the source directory
59 ./build.cmd                                  # Build on .Net (Windows)
60 ./build.sh                                   # Build on Mono (Linux / Mac OS X)
61 ```
62
63
64 News
65 ====
66
67 ### 2017-05-08
68
69 A pre-release package is available.
70
71 https://www.nuget.org/packages/OpenTK/3.0.0-pre
72
73 https://www.nuget.org/packages/OpenTK.GLControl/3.0.0-pre
74
75 ### 2016-09-23
76
77 OpenTK 2.0.0 is now available for download from [Nuget](https://www.nuget.org/packages/OpenTK/2.0.0).
78
79 Aside from being a maintenance release to bring the current package closer in-line with develop, this the project's first release since adopting a new build system.
80
81 Release notes:
82  - Moved to new FAKE/Paket based build system
83  - Removed superfluous release configurations
84  - Numerous other fixes and enhancements
85
86 We would welcome any feedback on the package, so please open a GitHub issue if you require assistance or experience difficulties.
87
88 ### 2016-07-19
89
90 The new OpenTK website is live. You can view it at [opentk.github.io](https://opentk.github.io/)
91
92 We are currently looking for contributors for tutorials and other resources.
93
94 ### 2016-07-13
95
96 A pre-release package is available.
97
98 https://www.nuget.org/packages/OpenTK.Next/1.2.2336.6514-pre
99 https://www.nuget.org/packages/OpenTK.Next.GLControl/1.2.2336.6514-pre
100
101 *The OpenTK.Next package id will no longer be used for future releases.
102
103
104 ### 2014-07-24
105
106 OpenTK 1.1.4c was released on 24 July 2014.
107
108 This is a hotfix release that improves stability on Mac OS X. Moreover, it synchronizes the GamePad configuration database with SDL 2.0.4 and fixes an invalid GUID introduced in 1.1.4b.
109
110 ### 2014-07-21
111
112 OpenTK 1.1.4 was released on 21 July 2014.
113
114 This release resolves a number of identified issues, adds experimental support for Linux/KMS and synchronizes the OpenGL and OpenGL ES bindings with the July 2014 Khronos specifications.
115
116 **Changelog:**
117
118 1. Fixed a memory leak in OpenGL functions accepting a string array.
119 2. Fixed an issue where `MakeCurrent()` might fail on Linux/X11 when using the Nvidia closed-source drivers.
120 3. Fixed an issue where `GameWindow` might remain open on Linux/X11 after calling `Close()` or `Dispose()`.
121 4. Fixed a potential crash on Mac OS X systems without hardware acceleration (e.g. virtual machines).
122 5. Fixed function parameters for the `OES_byte_coordinates` extension.
123 6. Fixed an issue where OpenTK would always perform a full rebuild even when a partial rebuild could work.
124 7. Fixed all compilation warnings on VS2013 and Mono 3.4.0.
125 8. Improved OpenGL and OpenGL ES documentation on 'count' parameters.
126 9. New platform: Linux/KMS. You can now run OpenTK applications on a Linux terminal without an X11 display server.
127 10. New OpenGL ES extensions:
128   - ANDROID_extension_pack_es31a
129
130 OpenTK 1.1.4 is backwards compatible with 1.1.3. Users of previous versions are **strongly** encouraged to upgrade.
131
132
133 Known issues
134 ============
135
136 1. The SDL2 backend has a number of limitations compared to the native platform backends. In particular, SDL2 does not support:
137    - `OpenTK.GLControl`. OpenTK will automatically switch to a native platform backend instead.
138    - `DisplayDevice.ChangeResolution()` without a fullscreen `INativeWindow`.
139    - Switching between `WindowBorder.Fixed` and `WindowBorder.Resizable`.
140    - High-resolution mouse input. Additionally, it is limited to a single keyboard and mouse device.
141 2. OpenTK.Input.GamePad.SetVibration is currently not implemented. This API will be implemented in a future release.
142
143
144 Contributing
145 ============
146
147 1. Install git and a C# IDE (see requirements section below)
148 2. Fork the _develop_ branch of https://github.com/opentk/opentk
149 3. Commit your changes in small, incremental steps with clear descriptions
150 4. When ready, issue a Pull Request (PR) against the _develop_ branch of https://github.com/opentk/opentk
151
152 For details on coding style and best practices, refer to https://github.com/opentk/opentk/wiki/Contributing
153
154 Some areas we could really use your help:
155 - Tutorials for OpenGL 3.x and 4.x. [Inspiration here](https://github.com/g-truc/ogl-samples)
156 - New platforms:
157   - Native Client (NaCL)
158   - Blackberry
159   - Wayland
160   - Mir
161   - WinRT (via ANGLE)
162 - New features:
163   - Multitouch
164   - Force feedback
165   - Improved joystick support (HID backend for Windows, Linux)
166
167 Further ideas for improvement are always welcome!
168
169
170 Requirements
171 ============
172
173 - Windows (XP/Vista/7/8), Linux, Mac OS X, *BSD, SteamOS, Android or iOS
174 - For graphics, OpenGL drivers or a suitable emulator, such as [ANGLE](https://github.com/opentk/opentk/tree/develop/Dependencies/Readme.txt)
175 - For audio, OpenAL drivers or [OpenAL Soft](https://github.com/opentk/opentk/tree/develop/Dependencies/Readme.txt)
176 - To develop desktop applications: Visual Studio, Xamarin Studio, MonoDevelop or SharpDevelop
177 - To develop Android applications: Xamarin Studio or the Xamarin Extensions for Visual Studio
178 - To develop iOS applications: Xamarin Studio and XCode
179
180
181 Documentation
182 =============
183
184 Your favorite IDE will display inline documentation for all OpenTK APIs. Additional information can be found in the [OpenTK Manual](http://web.archive.org/web/20150325224427/http://www.opentk.com/doc).
185
186 Technical documentation about the implementation of OpenTK can be found in the [Technical Wiki](https://github.com/opentk/opentk/wiki).
187
188
189 Need Help?
190 ==========
191
192 Post your questions at the [OpenTK forums](http://www.opentk.com/forum).
193
194 Report bugs at https://github.com/opentk/opentk/issues
195
196
197 License
198 =======
199
200 The Open Toolkit is distributed under the permissive MIT/X11 license and is absolutely free.
201
202 http://www.opentk.com/project/license
203
204
205 API compatibility
206 =================
207
208 OpenTK 1.1.4 is backwards compatible with 1.1.3.
209
210 OpenTK 1.1.3 is backwards compatible with 1.1.2.
211
212 OpenTK 1.1.2 is backwards compatible with 1.1.1.
213
214 OpenTK 1.1.1 is backwards compatible with 1.1.0.
215
216 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:
217
218 Namespace OpenTK.Graphics.OpenGL
219 Change signature:
220 - GL.MultiDrawArrays (`out` -> `ref`)
221 - GL.Amd.DeletePerfMonitors (`out` -> `ref`)
222
223 Change signature (may cause crash): 
224 - GL.Apple.ObjectPurgeable (returns `AppleObjectPurgeable` instead of `IntPtr`)
225 - GL.Ext.SeparableFilter2D
226 - GL.Ibm.EdgeFlagPointerList (`bool[]` -> `bool*[]`)
227 - GL.NV.TransformFeedbackVaryings (`string[]` -> `int[]`)
228
229 Change return type:
230 - GL.WaitSync (returns `WaitSyncFlags` instead of `ArbSync`)
231
232
233 Namespace OpenTK.Graphics.ES11
234 Change return type:
235 - GL.GetError (`ErrorCode` instead of `All`)
236
237 Change `ref` parameters to `out`:
238 - GL.GenBuffers
239 - GL.GenTextures
240 - GL.GetBoolean
241 - GL.GetBufferParameter
242 - GL.GetClipPlane
243 - GL.GetClipPlanex
244 - GL.GetFixed
245 - GL.GetFloat
246 - GL.GetInteger
247 - GL.GetLight
248 - GL.GetLightx
249 - GL.GetMaterial
250 - GL.GetMaterialx
251 - GL.GetTexEnv
252 - GL.GetTexEnvx
253 - GL.GetTexParameter
254 - GL.GetTexParameterx
255 - GL.Oes.GenFramebuffers
256 - GL.Oes.GetClipPlane
257 - GL.Oes.GetClipPlanex
258 - GL.Oes.GetFixed
259 - GL.Oes.GetFramebufferAttachmentParameter
260 - GL.Oes.GetLightx
261 - GL.Oes.GetMaterialx
262 - GL.Oes.GetRenderbufferParameter
263 - GL.Oes.GetTexEnvx
264 - GL.Oes.GetTexGen
265 - GL.Oes.GetTexGenx
266 - GL.Oes.GetTexParameterx
267 - GL.Oes.QueryMatrixx
268 - GL.NV.GenFences
269 - GL.NV.GetFence
270
271 Change namespace:
272 - GL.ClipPlanefIMG -> GL.Img.ClipPlane
273 - GL.DisableDriverControlQCOM -> GL.Qcom.DisableDriverControl
274
275
276 Namespace OpenTK.Graphics.ES20.GL
277 Change signature (may cause crash):
278 - GL.NV.GetFence now takes three parameters instead of two
279
280 Change `ref` parameters to `out`:
281 - GL.GetActiveAttrib
282 - GL.GetActiveUniform
283 - GL.GetAttachedShaders
284 - GL.GetProgramInfoLog
285 - GL.GetShaderInfoLog
286 - GL.GetShaderSource
287 - GL.Amd.GetPerfMonitorCounterData
288 - GL.Amd.GetPerfMonitorCounters
289 - GL.Amd.GetPerfMonitorCounterString
290 - GL.Amd.GetPerfMonitorGroup
291 - GL.Amd.GetPerfMonitorGroupString
292 - GL.Amd.SelectPerfMonitorCounters
293
294 Change namespace:
295 - GL.DisableDriverControlQCOM -> GL.Qcom.DisableDriverControl
296 - GL.GetDriverControlsQCOM -> GL.Qcom.GetDriverControls
297 - GL.GetDriverControlStringQCOM -> GL.Qcom.GetDriverControlString
298
299
300 See also
301 ========
302
303 [Delta Engine](http://deltaengine.net/), a high-level, open-source game engine.
304 [MonoGame](https://github.com/mono/monogame), an open-source, cross-platform implementation of XNA.