xcode 是否有任何 opengl 示例可以在 MacOS 上运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/924114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there any opengl example so that I can run on MacOS?
提问by lucius
Is there any opengl example so that I can run on MacOS 10.5.5? And if there is a XCode project with the opengl examples?
是否有任何 opengl 示例可以在 MacOS 10.5.5 上运行?如果有一个带有 opengl 示例的 XCode 项目?
Thank you.
谢谢你。
回答by Amber Haq Dixon
回答by Dietrich Epp
The Nehe tutorials will run on OS X. Scroll to the bottom of each tutorial and you'll see a download link for about a dozen platforms / languages / IDEs, one of which is OS X / Objective-C / Cocoa.
Nehe 教程将在 OS X 上运行。滚动到每个教程的底部,您将看到大约十几种平台/语言/IDE 的下载链接,其中之一是 OS X/Objective-C/Cocoa。
回答by Brad Ackerman
There are a bunch in /Developer/Examples/OpenGL.
在 /Developer/Examples/OpenGL 中有一堆。
回答by las3rjock
In addition to the examples that come with XCode that Brad mentioned, there is an OpenGL example in Aaron Hillegass's book Cocoa Programming for Mac OS X. All of the source code from that book is available for download.
除了 Brad 提到的 XCode 附带的示例之外,Aaron Hillegass 的《Cocoa Programming for Mac OS X 》中还有一个 OpenGL 示例。该书中的所有源代码均可下载。
回答by kent
I recommend /Developer/Examples/OpenGL/GLUT
我推荐 /Developer/Examples/OpenGL/GLUT
by learning openGL with GLUT you can very easily copy/paste arbitrary openGL code from the internet and have it compile and run properly. (assuming it's also GLUT based-- but there's a ton of it out there...)
通过使用 GLUT 学习 openGL,您可以非常轻松地从 Internet 复制/粘贴任意 openGL 代码,并使其编译和运行正常。(假设它也是基于 GLUT 的——但是那里有很多......)
Dietrich is right, the nehe tutorials are very valuable, but for me many of them were far too game-oriented if not game-on-windoze-platform specific.
迪特里希是对的,nehe 教程非常有价值,但对我来说,如果不是特定于游戏平台的游戏,对我来说,它们中的许多都过于面向游戏。
and of course, don't overlook: openGL.org code examples and tutorials page
当然,不要忽视: openGL.org 代码示例和教程页面
回答by Mike Ton
Impromptuis a live coding environment that handles openGL, check out this gentle tutorial.
Impromptu是一个处理 openGL 的实时编码环境,请查看这个温和的 教程。
Additionally, Impromptu has hooks into the Mac audio units and camera and is a great prototyping environment.
此外,Impromptu 与 Mac 音频单元和摄像头挂钩,是一个很棒的原型设计环境。
It does use Scheme, a language that may not be as wide spread; but it allows you to build up your program one line at a time.
它确实使用了 Scheme,一种可能没有那么广泛传播的语言;但它允许您一次一行地构建您的程序。
回答by Stewart
There is lots of sample code, demonstrating OpenGL and others, in the Mac OS X Reference Libraryand these include all XCode project files needed.
Mac OS X 参考库中有大量示例代码,演示 OpenGL 和其他代码,其中包括所需的所有 XCode 项目文件。