Marmalade 7がリリースされました

最近Marmalade 7がリリースされました。

Announcing Marmalade 7

/Applications の下に Marmalade.app と言うアプリがインストールされ、実行するとMarmalade Hubという開発を開始するためのGUIが立ち上がります。



f:id:ytakeuch:20131024015524p:plain

チュートリアルも刷新されて豊富になっています。

f:id:ytakeuch:20131024015605p:plain



Marmalade SDKでARMでコンパイラ出来ない時の対処方法

Marmalade SDKでARM版のコンパイルが出来ない?

Marmalade SDKをインストール後、Xcodex86コンパイルはできるがARMのコンパイルが出来ない場合があります。

このようなメッセージが出ます。

Unsupported compiler 'com.apple.compilers.marmalade' selected for architecture 'i386'

原因と対処方法

原因はインストールされたプラグインが読み込まれていないためです。

対処方法はXcodeを立ち上げ直す、です。

参考URL



Marmalade SDKでHelloWorld

Marmalade SDKとは?

Marmalade SDKマルチプラットフォーム対応のゲームエンジンです。

Marmalade(SDK)

3分間でHelloWorld

ダウンロードやライセンスの取得の時間はかかりますが、それが完了した前提でHelloWolrdをiOS Deviceで実行する方法を説明します。

ドキュメント「Creating an Application」をベースに進めています。

プロジェクトディレクトリの作成

お好みの場所にプロジェクトディレクトリ(HelloWorld)を作成します。
% mkdir HelloWorld

付随するディレクトリを作成します。
% mkdir HelloWorld/data
% mkdir HelloWorld/source

MKBファイルの作成

HelloWorld/HelloWorld.mkb

files
{
    (source)
    HelloWorld.cpp
}

subprojects
{
    iwgx
}

ICFファイルの作成

HelloWorld/data/app.icf

[S3E]
SplashscreenBkR=255
SplashscreenBkG=255
SplashscreenBkB=255

MemSize = 1000000

#### ソースファイルの作成
HelloWorld/source/HelloWorld.cpp

// Include header files for S3E (core system) and IwGx (rendering) modules                                                                                     
#include "s3e.h"
#include "IwGx.h"

// Standard C-style entry point. This can take args if required.                                                                                               
int main()
{
    // Initialise the IwGx drawing module                                                                                                                      
    IwGxInit();

    // Set the background colour to (opaque) blue                                                                                                              
    IwGxSetColClear(0, 0, 0xff, 0xff);

    // Loop forever, until the user or the OS performs some action to quit the app                                                                             
    while(!s3eDeviceCheckQuitRequest()
          && !(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
          && !(s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN)
        )
        {
            // Clear the surface                                                                                                                               
            IwGxClear();

            // Use the built-in font to display a string at coordinate (120, 150)                                                                              
            IwGxPrintString(120, 150, "Hello, World!");

            // Standard EGL-style flush of drawing to the surface                                                                                              
            IwGxFlush();

            // Standard EGL-style flipping of double-buffers                                                                                                   
            IwGxSwapBuffers();

            // Sleep for 0ms to allow the OS to process events etc.                                                                                            
            s3eDeviceYield(0);
        }

    // Shut down the IwGx drawing module                                                                                                                       
    IwGxTerminate();

    // Return                                                                                                                                                  
    return 0;
}

ビルド

HelloWorldディレクトリでmkbコマンドを実行します。
% mkb

xcodeが立ち上がり、HelloWorldプロジェクトのビルド準備ができています。

ターゲットの確認

SchemaでDebug GCC ARMを選択していることを確認します。
f:id:ytakeuch:20131019182844p:plain

Build & Run

Build & Runを押すとHelloWorldがMarmalade Simulatorで実行されます。
f:id:ytakeuch:20131019183118p:plain

iOS Deviceで実行

/Developer/Marmalade/6.4/Applications/ にあるDeploy Toolを実行します。
f:id:ytakeuch:20131019183338p:plain

HelloWorld/build_helloworld_xcode/deploy_config.py を選択します。
f:id:ytakeuch:20131019183513p:plain

Select Build:でARM GCC Debugを選択してNextボタンを押します。
f:id:ytakeuch:20131019184343p:plain

そのままNextボタンを押します。
f:id:ytakeuch:20131019184431p:plain

Select Platform:でiOS(iPhone, iPad, iPod)を選択してNextボタンを押します。
f:id:ytakeuch:20131019184558p:plain

そのままNextボタンを押します。
f:id:ytakeuch:20131019184651p:plain

そのままNextボタンを押します。
f:id:ytakeuch:20131019184721p:plain

Deploy Allボタンを押します。
f:id:ytakeuch:20131019184754p:plain

完了のメッセージが出ます。この時点でiTunesにHelloWorldアプリが入っているので、iOS Deviceと同期を取ります。
f:id:ytakeuch:20131019184915p:plain

iOS Deviceでの画面は次のようになっています。
f:id:ytakeuch:20131019185005p:plain

HelloWorldアイコンを押すと...
f:id:ytakeuch:20131019185123p:plain
debug画面が出て...

f:id:ytakeuch:20131019185021p:plain
Splash Screenが出て...
f:id:ytakeuch:20131019185137p:plain
HelloWorldアプリが実行されます。

最後に

Marmalade SDKの日本語ドキュメントが見当たらなかったので、駆け足ですがブログを書いてみました。

もっと深掘りしていきたいです。12月にMarmalade SDKアドベントカレンダーをやってみようかなと考えています。

25日分書ける自信がイマイチありませんが^_^;)