iOS (iPad/iPhone/iPod)

This guide explains the process involved in creating projects when using Tier 2 when using the IOS platform. In order to compile projects on the Mac you will need Xcode 10 or higher running Mac OS X 10.13.6 or later. Xcode is available for free by visiting https://developer.apple.com/xcode/ Alternatively you can obtain it from within the Mac App Store by searching for Xcode.

All of the relevant files for Tier 2 development are bundled within the main package of AppGameKit Studio. To access them navigate to the install location for AppGameKit Studio e.g. Applications/AGKStudio and right click on the icon for AGKStudio and select Show Package Contents. From here enter the Contents folder and then the Resources folder where you will see a Tier 2 folder with libraries, include files and examples projects for iOS development.

Alternatively launch the main app, go to the Tools menu and select the option to Install Additional Files. This option allows you to install the C++ Tier 2 files to a location of your choice.

Libraries and include files

The template projects and any of your own custom projects are dependent on several library and include files. Their install locations are -

Template

A template is included that provides a starting point for your application. This can be found within -

The main project of interest is called template_ios. This project is set up with relative links to the AGK libraries and include files and are ready to compile. Making new projects outside this location or moving the existing projects to another location will result in you needing to update the library and include links within the project settings to ensure the app compiles.

Make a copy of the template_ios and place it within the apps folder, then open the project within Xcode. Attempt to compile the project by going to the Project menu and selecting Build. When your project has built a message will show up saying it has succeeded. From here you can run the app by going to the Product menu and selecting the Run option. You can choose to test on the simulator or an actual device by selecting the target listing in Xcode.

The project will consist of three main files - core.mm, template.cpp and template.h. Core.mm is the starting point for your application as a whole, which in most cases can be ignored and is only relevant for more advanced users. Template.h contains a class declaration for your app and template.cpp contains the definition, with three functions already defined - Begin, Loop and End. Begin is the entry point for your application and is used for initial setup. Loop will be called every cycle and should be the location of your logic etc. Finally End is called when the app closes down and can be used to free up resources etc.