Porting Desktop OpenGL to iOS (/dev/world/2011)
Channel: AUC_ANZ
Date: 2014-12-14

Presenter: David Barnes
The iOS platform supports contemporary, best-practice 3-d graphics programming using the ubiquitous OpenGL API.  The latest iOS hardware – iPad2 – delivers astonishing rendering throughput for both fixed-function (OpenGL ES 1.1) and fully-programmable (OpenGL ES 2.0) pipelines.

While many iOS OpenGL ES apps are written from scratch, it is feasible and often reasonably straightforward to migrate existing desktop OpenGL code to the iOS platform, and proceed to build desktop and iOS products from a single code tree. In this talk, we present and discuss:

- an overview and comparison of the desktop (OpenGL + GLUT) and iOS (OpenGL ES + CocoaTouch) paradigms for delivering 3-d graphics in the model-view-controller world;
- a basic recipe for restructuring desktop OpenGL code to enable co-development for the iOS platform (fixed-function pipeline);
a checklist of *code* changes necessitated by the move from OpenGL to OpenGL ES;
- a checklist of *code* changes needed to migrate GLUT controllers to CocoaTouch controllers (e.g. handling touch events instead of mouse events); and
- a checklist of *paradigm* changes necessitated by the change from the desktop platform to the iOS (touch) platform (e.g. navigating the 3-d scene).

The talk concludes with a brief commentary on transitioning from the fixed-function pipeline (OpenGL ES 1.1) to the fully-programmable pipeline in OpenGL ES 2.0.  The talk draws on the presenter’s experience in migrating a high-level desktop OpenGL library (S2PLOT) to the iOS platform.