By Bill Hollings, on August 12th, 2010
Updated (2011/01/16) – Please note that this article covers SIO2 v1.4, which was the original free/low-cost version of SIO2. This article does not cover SIO2 v2.x.
SIO2 is an interesting and useful library for building 3D OpenGL ES applications under Apple’s iOS. While not strictly object-oriented like Apple’s Cocoa, much of the OpenGL functionality is abstracted into a collection of useful structures and related higher-level functions.
For historic and performance reasons, SIO2 is written in C++, not Objective-C. Bridging between pure C++ and Objective-C is not always as straightforward as it should be, and there are a few things to take into consideration when combining C++ libraries with Objective-C.
To aid with that issue, SIO2 comes with a customized Xcode template project, which provides a stable base for beginning the development of an iOS application that combines the SIO2 library with Objective-C and Cocoa. However, it’s not always practical or even recommended to begin all Xcode projects from the SIO2 template, and if you already have an existing Xcode project, it can be a challenge importing the SIO2 library into it. This article outlines the steps needed to import SIO2 into your existing Xcode Objective-C project. Continue reading Adding SIO2 to an Existing Xcode iOS Project
By Bill Hollings, on August 10th, 2010
This cocos2d framework package is a wonderful framework for working with OpenGL ES within iOS. Since it focuses on high performance OpenGL ES code, for the most part cocos2d bypasses Apple’s Cocoa UIViewController hierarchy. This makes sense, since within iOS, OpenGL ES usually plays out on a single UIView, and typically in a single display orientation, so there’s usually not much to control.
However, there are occasions where the functionality provided by UIViewController can be quite useful. In particular, the following functionality is best handled by adding a UIViewController into the mix:
- Auto-rotation – in some games, or other OpenGL ES applications, it makes sense to change the orientation of the application display to match changes in the orientation of the physical device. This means that when the user flips the device from landscape to portrait mode, or back again, the application display will adjust itself accordingly. The auto-rotation works on cocos2d nodes directly and does not rotate the underlying iOS Cocoa
UIView. If you are interested in combining cocos2d nodes with UIViews and having them auto-rotate together, please review cocos2d support for that here.
- Device camera overlay – an increasingly popular use for iOS devices is to overlay a game or app view on top of the image visible through the device’s camera. This is known as augmented reality, and provides the user with a combined view of the real world overlaid with images generated by the application. For this use, a
UIViewController is mandatory, since it controls the merging of the real-world and generated image streams.
Here at The Brenwill Workshop, some of our iOS applications actually use both of these features, and we’ve developed a small framework that can easily add the capabilities above to any cocos2d application. This article describes the design and use of this framework.
Continue reading cocos2d and UIViewControllers
By Bill Hollings, on August 8th, 2010
This cocos2d framework package includes several useful cocos2d user interface controls and frameworks, including:
- Joystick – a flexible joystick for user control in two dimensions with a single finger
- CCNodeAdornments – a framework for assigning adornments to
CCNodes to temporarily change the appearance of the CCNode, such as scaling, fading, adding visual embellishments, etc. This is most useful when used with menu items to temporarily change the appearance of the menu item during user selection.
|
|