我目前正在尝试学习如何在 iOS 中使用 OpenGL 编程。原来我正在阅读的书是为 Xcode 3(学习 iOS 游戏编程)编写的,在 Xcode v3 和 v4.5 之间集成 Open GL 方面有了巨大的飞跃,摆脱了 OpenGL v1 和 v2 的分离,即 OpenGL库并摆脱旧模板。我认为如果我可以查看原始 OpenGL 模板(2D 正方形上下移动的模板)转换为新的标准 OpenGL 模板,而不是查看 3 维正方形,这真的会帮助我起步,所以我可以看到翻译成什么。我不知道他们为什么要更改视图(以炫耀可能性?),但是与旧模板相比,交叉引用很难知道什么应该去哪里以及什么是什么。
1 回答
The template that is included in xcode 4.5 uses openGL es 2. It shows 2 approaches. The first one is by using OpenGL ES 2.0 natively, shaders and everything that people are used to. The other is by using the special apple framework (GLKit). This one is made to ease the leap between OpenGL 1 and 2. (The transition between fixed and programable pipeline). My suggestion is to change completely your sources. Focus completely on OpenGL ES 2.0 by using other internet sources.
This link here explains the basics using the new template:
http://www.raywenderlich.com/5223/beginning-opengl-es-2-0-with-glkit-part-1