使用OpenGL用C#? [英] Using OpenGl with C#?
问题描述
是否有一个C#自由的OpenGL支持库?如果是这样,哪一个做我使用,在哪里可以找到样本项目?
Is there free OpenGL support libraries for C#? If so, which one do I use and where do I find sample projects ?
编辑#1
请问C#对OpenGL提供类?
Does C# provide classes for OpenGL ?
推荐答案
OpenTK 是一个在陶改进API,因为它使用重载与地道的C#风格,强类型枚举,异常和标准的.NET类型:
OpenTK is an improvement over the Tao API, as it uses idiomatic C# style with overloading, strongly-typed enums, exceptions, and standard .NET types:
GL.Begin(BeginMode.Points);
GL.Color3(Color.Yellow);
GL.Vertex3(Vector3.Up);
而不是陶其仅反映了C API:
as opposed to Tao which merely mirrors the C API:
Gl.glBegin(Gl.GL_POINTS); // double "gl" prefix
Gl.glColor3ub(255, 255, 0); // have to pass RGB values as separate args
Gl.glVertex3f(0, 1, 0); // explicit "f" qualifier
这使得难以移植,但令人难以置信的是很好用。
This makes for harder porting but is incredibly nice to use.
,因为它提供的字体渲染的奖金,纹理加载,输入处理,音频,数学...
As a bonus it provides font rendering, texture loading, input handling, audio, math...
更新2016年1月18日:今天OpenTK维护者从走开该项目,留下它的前途未卜。这些论坛都充满了垃圾邮件。维护者建议转移到MonoGame或SDL2#。
Update 18.1.2016: Today the OpenTK maintainer has stepped away from the project, leaving its future uncertain. The forums are filled with spam. The maintainer recommends moving to MonoGame or SDL2#.
这篇关于使用OpenGL用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!