Graphics Reference
In-Depth Information
Figure 16-2
VertexArrayObjects Sample in Xcode Running on iOS 7
Simulator
Notice that each sample project builds the framework files (
esUtil.c,
esTransform.c, esShapes.c,
and
esShader.c
). Additionally, each
sample contains Objective-C files from the
Common/iOS
folder that wrap
the interface to the ES framework. The primary file is
ViewController.m
,
which implements an iOS
GLKViewController
and calls back into
registered update, draw, and shutdown callback functions of each sample.
This abstraction mechanism allows each sample in the topic to run
unmodified on iOS.
To create your own iOS 7 application using the code framework from the
book, in Xcode 5 you can navigate from File > New > Project, and choose
an OpenGL Game. Once it creates the new project, remove the generated
AppDelegate.h, AppDelegate.m, Shader.vsh, Shader.fsh,
ViewController.h, ViewController.m,
and
main.m
files. Next, select
“Add files to <project>...” and choose all of the
.c
files in the
Common/
Source
path along with all of the files in
Common/Source/iOS
. Finally,
in the Build Settings for your project, add the
Common/Include
path
to the Search Paths > User Header Search Paths. You can then create a
sample using one of the examples from the topic as a template.
You will probably find it much easier to use the iOS GLKit framework
than to use the framework in our book if you are developing an iOS-
only application. The GLKit provides functionality similar to the topic