Browse Source

Changed gameplay on Android to be built as shared library.
Changed Android org.gameplay.GameNativeActivity which apps will run.
Added stubs in GameNativeActivity for Gamepad/Joystick connectivity events to native.

seanpaultaylor 11 years ago
parent
commit
b3c2d9f49e
66 changed files with 1329 additions and 1052 deletions
  1. 14 5
      .gitignore
  2. 0 61
      build.xml
  3. 2 2
      gameplay/android/AndroidManifest.xml
  4. 45 1
      gameplay/android/build.xml
  5. 80 4
      gameplay/android/jni/Android.mk
  6. 1 1
      gameplay/android/jni/Application.mk
  7. 2 2
      gameplay/android/project.properties
  8. 45 26
      gameplay/src/PlatformAndroid.cpp
  9. 118 0
      gameplay/src/org/gameplay3d/GameNativeActivity.java
  10. 38 52
      newproject.bat
  11. 43 55
      newproject.sh
  12. 3 0
      samples/browser/android/.cproject
  13. 4 4
      samples/browser/android/AndroidManifest.xml
  14. 49 4
      samples/browser/android/build.xml
  15. 6 5
      samples/browser/android/jni/Android.mk
  16. 1 1
      samples/browser/android/jni/Application.mk
  17. 2 1
      samples/browser/android/project.properties
  18. 0 75
      samples/browser/bar-descriptor.xml
  19. 4 4
      samples/character/android/AndroidManifest.xml
  20. 50 5
      samples/character/android/build.xml
  21. 6 6
      samples/character/android/jni/Android.mk
  22. 1 1
      samples/character/android/jni/Application.mk
  23. 2 1
      samples/character/android/project.properties
  24. 0 117
      samples/character/bar-descriptor.xml
  25. 3 3
      samples/lua/android/AndroidManifest.xml
  26. 50 5
      samples/lua/android/build.xml
  27. 5 5
      samples/lua/android/jni/Android.mk
  28. 1 1
      samples/lua/android/jni/Application.mk
  29. 2 1
      samples/lua/android/project.properties
  30. 0 90
      samples/lua/bar-descriptor.xml
  31. 3 3
      samples/mesh/android/AndroidManifest.xml
  32. 51 6
      samples/mesh/android/build.xml
  33. 5 5
      samples/mesh/android/jni/Android.mk
  34. 1 1
      samples/mesh/android/jni/Application.mk
  35. 2 1
      samples/mesh/android/project.properties
  36. 0 88
      samples/mesh/bar-descriptor.xml
  37. 3 3
      samples/particles/android/AndroidManifest.xml
  38. 50 5
      samples/particles/android/build.xml
  39. 5 5
      samples/particles/android/jni/Android.mk
  40. 1 1
      samples/particles/android/jni/Application.mk
  41. 2 1
      samples/particles/android/project.properties
  42. 0 93
      samples/particles/bar-descriptor.xml
  43. 3 3
      samples/racer/android/AndroidManifest.xml
  44. 48 5
      samples/racer/android/build.xml
  45. 5 5
      samples/racer/android/jni/Android.mk
  46. 1 1
      samples/racer/android/jni/Application.mk
  47. 2 1
      samples/racer/android/project.properties
  48. 0 90
      samples/racer/bar-descriptor.xml
  49. 3 3
      samples/spaceship/android/AndroidManifest.xml
  50. 50 5
      samples/spaceship/android/build.xml
  51. 5 5
      samples/spaceship/android/jni/Android.mk
  52. 1 1
      samples/spaceship/android/jni/Application.mk
  53. 2 1
      samples/spaceship/android/project.properties
  54. 0 89
      samples/spaceship/bar-descriptor.xml
  55. 250 0
      template/.cproject
  56. 25 0
      template/.project
  57. 13 0
      template/android/.classpath
  58. 57 0
      template/android/.cproject
  59. 54 0
      template/android/.project
  60. 5 6
      template/android/AndroidManifest.xml
  61. 0 0
      template/android/build.xml
  62. 97 0
      template/android/jni/Android.mk
  63. 3 2
      template/android/jni/Application.mk
  64. 2 2
      template/android/jni/template.Android.mk
  65. 3 0
      template/android/project.properties
  66. 0 83
      template/template.bar-descriptor.xml

+ 14 - 5
.gitignore

@@ -81,6 +81,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/browser/res/shaders
 /samples/browser/res/ui
 /samples/browser/res/logo_powered_white.png
+/samples/browser/src/org
 /samples/browser/android/src
 /samples/browser/android/assets
 /samples/browser/android/bin
@@ -108,9 +109,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/character/res/shaders
 /samples/character/res/ui
 /samples/character/res/logo_powered_white.png
-/samples/character/android/proguard-project.txt
-/samples/character/android/proguard.cfg
-/samples/character/android/local.properties
+/samples/character/src/org
 /samples/character/android/src
 /samples/character/android/assets
 /samples/character/android/bin
@@ -118,6 +117,9 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/character/android/libs
 /samples/character/android/obj
 /samples/character/android/NUL
+/samples/character/android/local.properties
+/samples/character/android/proguard-project.txt
+/samples/character/android/proguard.cfg
 /samples/character/res/gamepad.xcf
 /samples/character/sample-character.xcodeproj/xcuserdata
 
@@ -134,6 +136,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/lua/res/shaders
 /samples/lua/res/ui
 /samples/lua/res/logo_powered_white.png
+/samples/lua/src/org
 /samples/lua/android/src
 /samples/lua/android/assets
 /samples/lua/android/bin
@@ -144,6 +147,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/lua/android/local.properties
 /samples/lua/android/proguard-project.txt
 /samples/lua/android/proguard.cfg
+/samples/lua/android/src/org/gameplay3d
 /samples/lua/sample-lua.xcodeproj/xcuserdata
 
 /samples/mesh/Debug
@@ -159,6 +163,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/mesh/res/shaders
 /samples/mesh/res/ui
 /samples/mesh/res/logo_powered_white.png
+/samples/mesh/src/org
 /samples/mesh/android/src
 /samples/mesh/android/assets
 /samples/mesh/android/bin
@@ -187,12 +192,14 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/particles/Device-Debug
 /samples/particles/Debug
 /samples/particles/DebugMem
+/samples/particles/src/org
 /samples/particles/android/src
 /samples/particles/android/assets
 /samples/particles/android/bin
 /samples/particles/android/gen
 /samples/particles/android/libs
 /samples/particles/android/obj
+/samples/particles/android/NUL
 /samples/particles/android/local.properties
 /samples/particles/android/proguard-project.txt
 /samples/particles/android/proguard.cfg
@@ -214,6 +221,7 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/racer/res/shaders
 /samples/racer/res/ui
 /samples/racer/res/logo_powered_white.png
+/samples/racer/src/org
 /samples/racer/android/src
 /samples/racer/android/assets
 /samples/racer/android/bin
@@ -239,13 +247,14 @@ gameplay.xcworkspace/xcshareddata/gameplay.xccheckout
 /samples/spaceship/res/shaders
 /samples/spaceship/res/ui
 /samples/spaceship/res/logo_powered_white.png
-/samples/spaceship/android/NUL
+/samples/spaceship/src/org
+/samples/spaceship/android/src
 /samples/spaceship/android/assets
 /samples/spaceship/android/bin
 /samples/spaceship/android/gen
 /samples/spaceship/android/libs
 /samples/spaceship/android/obj
-/samples/spaceship/android/src
+/samples/spaceship/android/NUL
 /samples/spaceship/android/local.properties
 /samples/spaceship/android/proguard.cfg
 /samples/spaceship/android/proguard-project.txt

+ 0 - 61
build.xml

@@ -1,61 +0,0 @@
-<!-- Android build script -->
-<project name="gameplay" default="build" basedir=".">
-
-  <fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
-    <condition>
-      <not>
-        <or>
-          <os family="unix"/>
-          <os family="windows"/>
-        </or>
-      </not>
-    </condition>
-  </fail>
-
-  <macrodef name="build-native">
-    <attribute name="location"/>
-    <sequential>
-
-      <exec osfamily="unix" dir="@{location}/android" executable="android">
-        <arg value="update"/>
-        <arg value="project"/>
-        <arg value="-t"/>
-        <arg value="1"/>
-        <arg value="-p"/>
-        <arg value="."/>
-        <arg value="-s"/>
-      </exec>
-      <exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
-
-      <exec osfamily="windows" dir="@{location}/android" executable="cmd">
-        <arg value="/c"/>
-        <arg value="android.bat"/>
-        <arg value="update"/>
-        <arg value="project"/>
-        <arg value="-t"/>
-        <arg value="1"/>
-        <arg value="-p"/>
-        <arg value="."/>
-        <arg value="-s"/>
-      </exec>
-      <exec osfamily="windows" dir="@{location}/android" executable="cmd">
-        <arg value="/c"/>
-        <arg value="ndk-build"/>
-      </exec> 
-      
-    </sequential>
-  </macrodef>
-
-    
-  <target name="build">
-    <build-native location="gameplay"/>
-    <build-native location="samples/browser"/>
-    <build-native location="samples/character"/>
-    <build-native location="samples/lua"/>
-    <build-native location="samples/mesh"/>
-    <build-native location="samples/particles"/>
-    <build-native location="samples/racer"/>
-    <build-native location="samples/spaceship"/>
-  </target>
-  
-</project>

+ 2 - 2
gameplay/android/AndroidManifest.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
-	package="org.gameplay3d.gameplay" 
+	package="org.gameplay3d" 
 	android:versionCode="1" 
 	android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 
 </manifest>

+ 45 - 1
gameplay/android/build.xml

@@ -7,7 +7,51 @@
     <loadproperties srcFile="project.properties" />
     
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+    <fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+        <condition>
+            <not>
+                <or>
+                    <os family="unix"/>
+                    <os family="windows"/>
+                </or>
+            </not>
+        </condition>
+    </fail>
+    <macrodef name="build-native">
+        <attribute name="location"/>
+        <sequential>
+            <exec osfamily="unix" dir="@{location}/android" executable="android">
+                <arg value="update"/>
+                <arg value="project"/>
+                <arg value="-t"/>
+                <arg value="1"/>
+                <arg value="-p"/>
+                <arg value="."/>
+                <arg value="-s"/>
+            </exec>
+            <exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+            <exec osfamily="windows" dir="@{location}/android" executable="cmd">
+                <arg value="/c"/>
+                <arg value="android.bat"/>
+                <arg value="update"/>
+                <arg value="project"/>
+                <arg value="-t"/>
+                <arg value="1"/>
+                <arg value="-p"/>
+                <arg value="."/>
+                <arg value="-s"/>
+            </exec>
+            <exec osfamily="windows" dir="@{location}/android" executable="cmd">
+                <arg value="/c"/>
+                <arg value="ndk-build -j4"/>
+            </exec> 
+        </sequential>
+    </macrodef>
+    
+    <target name="-pre-build">
+        <build-native location=".."/>
+    </target>
+    
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />
 

+ 80 - 4
gameplay/android/jni/Android.mk

@@ -1,7 +1,81 @@
 
-LOCAL_PATH := $(call my-dir)/../../src
+GAMEPLAY_PATH := $(call my-dir)/../../src
 
+# external-deps
+PNG_PATH := ../../external-deps/png/lib/android/arm
+ZLIB_PATH := ../../external-deps/zlib/lib/android/arm
+LUA_PATH := ../../external-deps/lua/lib/android/arm
+BULLET_PATH := ../../external-deps/bullet/lib/android/arm
+OGG_PATH := ../../external-deps/ogg/lib/android/arm
+VORBIS_PATH := ../../external-deps/vorbis/lib/android/arm
+OPENAL_PATH := ../../external-deps/openal/lib/android/arm
+
+# libpng
+LOCAL_PATH := $(PNG_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpng 
+LOCAL_SRC_FILES := libpng.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libz
+LOCAL_PATH := $(ZLIB_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libz
+LOCAL_SRC_FILES := libz.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# liblua
+LOCAL_PATH := $(LUA_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := liblua
+LOCAL_SRC_FILES := liblua.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libLinearMath
+LOCAL_PATH := $(BULLET_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libLinearMath
+LOCAL_SRC_FILES := libLinearMath.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libBulletCollision
+LOCAL_PATH := $(BULLET_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libBulletCollision
+LOCAL_SRC_FILES := libBulletCollision.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libBulletDynamics
+LOCAL_PATH := $(BULLET_PATH)
 include $(CLEAR_VARS)
+LOCAL_MODULE    := libBulletDynamics
+LOCAL_SRC_FILES := libBulletDynamics.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libogg
+LOCAL_PATH := $(OGG_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libogg
+LOCAL_SRC_FILES := libogg.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libgameplay
+include $(CLEAR_VARS)
+LOCAL_PATH := $(GAMEPLAY_PATH)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := \
     AbsoluteLayout.cpp \
@@ -289,9 +363,11 @@ LOCAL_SRC_FILES := \
 
 LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
+LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS := -D__ANDROID__ -I"../../external-deps/lua/include" -I"../../external-deps/bullet/include" -I"../../external-deps/png/include" -I"../../external-deps/ogg/include" -I"../../external-deps/vorbis/include" -I"../../external-deps/openal/include"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue
-
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_ADDITIONAL_DEPENDENCIES := gameplay
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+include $(BUILD_SHARED_LIBRARY)
 
 $(call import-module,android/native_app_glue)
+

+ 1 - 1
gameplay/android/jni/Application.mk

@@ -3,5 +3,5 @@ APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_MODULES  := libgameplay
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 2
gameplay/android/project.properties

@@ -1,3 +1,3 @@
-target=android-20
+target=android-16
 android.library=true
-
+source.dir=../src

+ 45 - 26
gameplay/src/PlatformAndroid.cpp

@@ -1031,13 +1031,16 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
                 gameplay::Platform::keyEventInternal(Keyboard::KEY_PRESS, getKey(keycode, metastate));
                 if (int character = getUnicode(keycode, metastate))
                     gameplay::Platform::keyEventInternal(Keyboard::KEY_CHAR, character);
+                if (keycode == AKEYCODE_BACK)
+                	return 1;
                 break;
                     
             case AKEY_EVENT_ACTION_UP:
                 gameplay::Platform::keyEventInternal(Keyboard::KEY_RELEASE, getKey(keycode, metastate));
+                if (keycode == AKEYCODE_BACK)
+                	return 1;
                 break;
         }
-
         return 1;
     }
     return 0;
@@ -1049,7 +1052,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
     switch (cmd) 
     {
         case APP_CMD_INIT_WINDOW:
-            // The window is being shown, get it ready.
             if (app->window != NULL)
             {
                 initEGL();
@@ -1065,6 +1067,29 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
             destroyEGLMain();
             __initialized = false;
             break;
+        case APP_CMD_PAUSE:
+            Game::getInstance()->pause();
+            __suspended = true;
+            break;
+        case APP_CMD_RESUME:
+            if (__initialized)
+            {
+                Game::getInstance()->resume();
+            }
+            __suspended = false;
+            break;
+        case APP_CMD_LOST_FOCUS:
+            // When our app loses focus, we stop monitoring the sensors.
+            // This is to avoid consuming battery while not being used.
+            if (__accelerometerSensor != NULL)
+            {
+                ASensorEventQueue_disableSensor(__sensorEventQueue, __accelerometerSensor);
+            }
+            if (__gyroscopeSensor != NULL)
+            {
+                ASensorEventQueue_disableSensor(__sensorEventQueue, __gyroscopeSensor);
+            }
+            break;
         case APP_CMD_GAINED_FOCUS:
             // When our app gains focus, we start monitoring the sensors.
             if (__accelerometerSensor != NULL) 
@@ -1079,7 +1104,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
                 // We'd like to get 60 events per second (in microseconds).
                 ASensorEventQueue_setEventRate(__sensorEventQueue, __gyroscopeSensor, (1000L/60)*1000);
             }
-
             if (Game::getInstance()->getState() == Game::UNINITIALIZED)
             {
                 Game::getInstance()->run();
@@ -1089,29 +1113,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
                 Game::getInstance()->resume();
             }
             break;
-        case APP_CMD_RESUME:
-            if (__initialized)
-            {
-                Game::getInstance()->resume();
-            }
-            __suspended = false;
-            break;
-        case APP_CMD_PAUSE:
-            Game::getInstance()->pause();
-            __suspended = true;
-            break;
-        case APP_CMD_LOST_FOCUS:
-            // When our app loses focus, we stop monitoring the sensors.
-            // This is to avoid consuming battery while not being used.
-            if (__accelerometerSensor != NULL) 
-            {
-                ASensorEventQueue_disableSensor(__sensorEventQueue, __accelerometerSensor);
-            }
-            if (__gyroscopeSensor != NULL) 
-            {
-                ASensorEventQueue_disableSensor(__sensorEventQueue, __gyroscopeSensor);
-            }
-            break;
     }
 }
 
@@ -1638,4 +1639,22 @@ std::string Platform::displayFileDialog(size_t mode, const char* title, const ch
 
 }
 
+extern "C"
+{
+
+JNIEXPORT void JNICALL Java_org_gameplay3d_GameNativeActivity_gamepadEventConnectedImpl(JNIEnv* env, jclass clazz, jint deviceId, jint buttonCount, jint joystickCount, jint triggerCount, jint vendorId, jint productId, jstring vendorIdStr, jstring productIdStr)
+{
+	// TODO
+	//gameplay::Platform::gamepadEventConnectedInternal(deviceId, buttonCount, joystickCount, triggerCount, vendorId, productId, "", "");
+}
+
+JNIEXPORT void JNICALL Java_org_gameplay3d_GameNativeActivity_gamepadEventDisconnectedImpl(JNIEnv* env, jclass clazz, jint deviceId)
+{
+	// TODO
+	//gameplay::Platform::gamepadEventDisconnectedInternal(deviceId);
+}
+
+}
+
 #endif
+

+ 118 - 0
gameplay/src/org/gameplay3d/GameNativeActivity.java

@@ -0,0 +1,118 @@
+package org.gameplay3d;
+
+import android.app.NativeActivity;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.hardware.input.InputManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.util.Log;
+import android.util.SparseArray;
+import android.view.InputDevice;
+import android.view.KeyEvent;
+import android.view.View;
+
+/**
+ * Game extension for Android platform.
+ * 
+ * Handles any platform features that cannot be handled natively in PlatformAndroid.cpp 
+ * 
+ * Developers may choose to directly modify/extend this for any addition platform features 
+ * that are not offered directly the gameplay3d framework such as platform events, access to 
+ * android user-interface, life-cycle events for saving game state and custom plug-ins/extensions.
+ */
+public class GameNativeActivity extends NativeActivity
+	implements InputManager.InputDeviceListener {
+	
+	static {
+		System.loadLibrary("gameplay");
+	}
+	
+	private static final String TAG = "GameNativeActivity";
+	
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		
+		_gamepadDevices = new SparseArray<InputDevice>();
+		_inputManager = (InputManager)getSystemService(Context.INPUT_SERVICE);
+
+		View decorView = getWindow().getDecorView();
+		int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
+		if (Build.VERSION.SDK_INT >= 18) 
+			uiOptions ^= 0x00000800; //View.SYSTEM_UI_FLAG_IMMERSIVE;
+		decorView.setSystemUiVisibility(uiOptions);
+	}
+	
+	@Override
+	public void onSaveInstanceState(Bundle outState) {
+	    super.onSaveInstanceState(outState);
+	}
+	
+	@Override
+    public void onConfigurationChanged(Configuration newConfig) {
+    	super.onConfigurationChanged(newConfig);
+    } 
+	
+    @Override
+    protected void onResume() {
+    	super.onResume();
+        _inputManager.registerInputDeviceListener(this, null);
+        int[] ids = _inputManager.getInputDeviceIds();
+        for (int i = 0; i < ids.length; i++) {
+        	getGamepadDevice(ids[i]);
+        }
+    }
+    
+    @Override
+    protected void onPause() {
+        _inputManager.unregisterInputDeviceListener(this);
+    	super.onPause();
+    }
+    
+    @Override
+    public void onInputDeviceAdded(int deviceId) {
+    	Log.v(TAG, "Input Device added: " + deviceId);
+        getGamepadDevice(deviceId);
+    }
+
+    @Override
+    public void onInputDeviceRemoved(int deviceId) {
+    	Log.v(TAG, "Input Device removed: " + deviceId);
+        InputDevice device = _gamepadDevices.get(deviceId);
+        if (device != null) {
+        	_gamepadDevices.remove(deviceId);
+        	//gamepadEventDisconnectedImpl(deviceId);
+        }
+    }
+    
+    @Override
+    public void onInputDeviceChanged(int deviceId) {
+    	Log.v(TAG, "Input Device changed: " + deviceId);
+    }
+    
+    private InputDevice getGamepadDevice(int deviceId) {
+    	InputDevice device = _gamepadDevices.get(deviceId);
+        if (device == null) {
+            device = _inputManager.getInputDevice(deviceId);
+            if (device == null)
+            	return null;
+            if ((device.getSources() & InputDevice.SOURCE_GAMEPAD) != 0) {
+            	_gamepadDevices.put(deviceId, device);
+            	gamepadEventConnectedImpl(deviceId, 26, 2, 2, 0, 0, "", "");
+            }
+            if ((device.getSources() & InputDevice.SOURCE_JOYSTICK) != 0) {
+            	_gamepadDevices.put(deviceId, device);
+            	gamepadEventConnectedImpl(deviceId, 10, 0, 0, 0, 0, "", "");
+            }
+        }
+        return device;
+    }
+	
+    // JNI calls to PlatformAndroid.cpp
+    private static native void gamepadEventConnectedImpl(int deviceId, int buttonCount, int joystickCount, int triggerCount, int vendorId, int productId, String vendorString, String productString);
+    private static native void gamepadEventDisconnectedImpl(int deviceId);
+    
+	private InputManager _inputManager;
+	private SparseArray<InputDevice> _gamepadDevices;
+}

+ 38 - 52
newproject.bat

@@ -2,7 +2,7 @@
 
 REM ********************************************************************
 REM
-REM generate-project.bat
+REM newproject.bat
 REM
 REM This windows batch script generates a set of gameplay project files.
 REM The new project will be based of the template project and 
@@ -20,6 +20,7 @@ echo.
 echo    This name will be given to the project 
 echo    executable and a folder with this name
 echo    will be created to store all project files.
+echo    Ex. foobar
 echo.
 set /p projName=Project name: 
 if "%projName%" == "" (
@@ -37,6 +38,7 @@ echo.
 echo    On some platforms, this title is used to
 echo    identify the game during installation and
 echo    on shortcuts/icons.
+echo    Ex. Foo Bar
 echo.
 set /p title=Title: 
 if "%title%" == "" (
@@ -49,20 +51,12 @@ if "%title%" == "" (
 echo.
 
 echo.
-echo 3. Enter a short game description.
-echo.
-set /p desc=Description: 
-if "%desc%" == "" (
-    set desc=%title%
-)
-echo.
-
-echo.
-echo 4. Enter a unique identifier for your project.
+echo 3. Enter a unique identifier for your project.
 echo.
 echo    This should be a human readable package name,
 echo    containing at least two words separated by a
-echo    period (eg. com.surname.gamename).
+echo    period.
+echo    Ex. com.example.foobar
 echo.
 set /p uuid=Unique ID: 
 if "%uuid%" == "" (
@@ -75,28 +69,12 @@ if "%uuid%" == "" (
 echo.
 
 echo.
-echo 5. Enter author name.
-echo.
-echo    On BlackBerry targets, this is used for
-echo    signing and must match the developer name
-echo    of your development certificate.
-echo.
-set /p author=Author: 
-if "%author%" == "" (
-    echo.
-    echo ERROR: No author specified.
-    echo.
-    pause
-    goto done
-)
-echo.
-
-echo.
-echo 6. Enter your game's main class name.
+echo 4. Enter your game's main class name.
 echo.
 echo    Your initial game header and source file
 echo    will be given this name and a class with 
 echo    this name will be created in these files.
+echo    Ex. FooBarGame
 echo.
 set /p className=Class name: 
 if "%className%" == "" (
@@ -109,12 +87,13 @@ if "%className%" == "" (
 echo.
 
 echo.
-echo 7. Enter the project path.
+echo 5. Enter the project path.
 echo.
 echo    This can be a relative path, absolute path,
 echo    or empty for the current folder. Note that
 echo    a project folder named %projName% will also
 echo    be created inside this folder.
+echo    Ex. samples
 echo.
 set /p location=Path: 
 if "%location%" == "" (
@@ -180,47 +159,31 @@ call:replace "%projPath%\%projName%.xcodeproj\project.pbxproj" TEMPLATE_PROJECT
 
 copy template\TEMPLATE_PROJECT-macosx.plist "%projPath%\%projName%-macosx.plist"
 call:replace "%projPath%\%projName%-macosx.plist" TEMPLATE_UUID "%uuid%"
-call:replace "%projPath%\%projName%-macosx.plist" TEMPLATE_AUTHOR "%author%"
 
 copy template\TEMPLATE_PROJECT-ios.plist "%projPath%\%projName%-ios.plist"
 copy template\[email protected] "%projPath%\[email protected]"
 call:replace "%projPath%\%projName%-ios.plist" TEMPLATE_TITLE "%title%"
 call:replace "%projPath%\%projName%-ios.plist" TEMPLATE_UUID "%uuid%"
-call:replace "%projPath%\%projName%-ios.plist" TEMPLATE_AUTHOR "%author%"
-
-REM Copy BlackBerry NDK project files
-copy template\template.cproject "%projPath%\.cproject"
-call:replace "%projPath%\.cproject" TEMPLATE_PROJECT "%projName%"
-call:replace "%projPath%\.cproject" TEMPLATE_UUID "%uuid%"
-call:replace "%projPath%\.cproject" GAMEPLAY_PATH "%gpPath%"
-
-copy template\template.project "%projPath%\.project"
-call:replace "%projPath%\.project" TEMPLATE_PROJECT "%projName%"
 
-copy template\template.bar-descriptor.xml "%projPath%\bar-descriptor.xml"
-call:replace "%projPath%\bar-descriptor.xml" TEMPLATE_PROJECT "%projName%"
-call:replace "%projPath%\bar-descriptor.xml" TEMPLATE_TITLE "%title%"
-call:replace "%projPath%\bar-descriptor.xml" TEMPLATE_UUID "%uuid%"
-call:replace "%projPath%\bar-descriptor.xml" TEMPLATE_AUTHOR "%author%"
-call:replace "%projPath%\bar-descriptor.xml" TEMPLATE_DESCRIPTION "%desc%"
-call:replace "%projPath%\bar-descriptor.xml" GAMEPLAY_PATH "%gpPath%"
 
 REM Copy Android NDK project files
 mkdir "%projPath%\android"
 
-copy template\android\template.AndroidManifest.xml "%projPath%\android\AndroidManifest.xml"
+copy template\android\AndroidManifest.xml "%projPath%\android\AndroidManifest.xml"
 call:replace "%projPath%\android\AndroidManifest.xml" TEMPLATE_PROJECT "%projName%"
 call:replace "%projPath%\android\AndroidManifest.xml" TEMPLATE_UUID "%uuid%"
 
-copy template\android\template.build.xml "%projPath%\android\build.xml"
+copy template\android\build.xml "%projPath%\android\build.xml"
 call:replace "%projPath%\android\build.xml" TEMPLATE_PROJECT "%projName%"
 call:replace "%projPath%\android\build.xml" GAMEPLAY_PATH "%gpPath%"
 
+copy template\project.properties "%projPath%\project.properties"
+
 mkdir "%projPath%\android\jni"
 
 copy template\android\jni\Application.mk "%projPath%\android\jni\Application.mk"
 
-copy template\android\jni\template.Android.mk "%projPath%\android\jni\Android.mk"
+copy template\android\jni\Android.mk "%projPath%\android\jni\Android.mk"
 call:replace "%projPath%\android\jni\Android.mk" TemplateGame "%className%"
 call:replace "%projPath%\android\jni\Android.mk" TEMPLATE_PROJECT "%projName%"
 call:replace "%projPath%\android\jni\Android.mk" GAMEPLAY_PATH "%gpPath%"
@@ -234,6 +197,29 @@ mkdir "%projPath%\android\res\values"
 copy template\android\res\values\template.strings.xml "%projPath%\android\res\values\strings.xml"
 call:replace "%projPath%\android\res\values\strings.xml" TEMPLATE_TITLE "%title%"
 
+REM Copy Android Eclipse files
+copy template\android\.cproject "%projPath%\android\.cproject"
+call:replace "%projPath%\android\.cproject" TEMPLATE_PROJECT "%projName%"
+call:replace "%projPath%\android\.cproject" TEMPLATE_UUID "%uuid%"
+call:replace "%projPath%\android\.cproject" GAMEPLAY_PATH "%gpPath%"
+
+copy template\android\.project "%projPath%\android\.project"
+call:replace "%projPath%\android\.project" TEMPLATE_PROJECT "%projName%"
+
+copy template\android\.classpath "%projPath%\android\.classpath"
+call:replace "%projPath%\android\.classpath" TEMPLATE_PROJECT "%projName%"
+
+REM Copy Linux Eclipse files
+copy template\.cproject "%projPath%\.cproject"
+call:replace "%projPath%\.cproject" TEMPLATE_PROJECT "%projName%"
+call:replace "%projPath%\.cproject" TEMPLATE_UUID "%uuid%"
+call:replace "%projPath%\.cproject" GAMEPLAY_PATH "%gpPath%"
+
+copy template\.project "%projPath%\.project"
+call:replace "%projPath%\.project" TEMPLATE_PROJECT "%projName%"
+
+
+REM Copy CMake files
 mkdir "%projPath%\build"
 copy "template\template-CMakeLists.txt" "%projPath%\CMakeLists.txt"
 call:replace "%projPath%\CMakeLists.txt" TEMPLATE_PROJECT %projName%

+ 43 - 55
newproject.sh

@@ -27,13 +27,13 @@ else
 	alias aliassedinplace='sed -i""'
 fi
 
-
 echo
 echo "1. Enter a name for the new project."
 echo
 echo "   This name will be given to the project"
 echo "   executable and a folder with this name"
 echo "   will be created to store all project files."
+echo "   Ex. foobar"
 echo
 read -p "Project Name: " projName 
 if [[ "$projName" == "" ]]; then
@@ -42,13 +42,15 @@ if [[ "$projName" == "" ]]; then
 	echo
 	exit -1;
 fi
-echo 
+echo
+
 echo
 echo "2. Enter a game title."
 echo
 echo "   On some platforms, this title is used to"
 echo "   identify the game during installation and"
 echo "   on shortcuts/icons."
+echo "   Ex. Foo Bar"
 echo
 read -p "Title: " title 
 if [[ "$title" == "" ]]; then
@@ -60,20 +62,12 @@ fi
 echo 
 
 echo
-echo "3. Enter a short game description."
-echo
-read -p "Description: " desc
-if [[ "$desc" == "" ]]; then
-	desc=$title
-fi
-echo 
-
-echo
-echo "4. Enter a unique identifier for your project."
+echo "3. Enter a unique identifier for your project."
 echo
 echo "   This should be a human readable package name,"
 echo "   containing at least two words separated by a"
-echo "   period (eg. com.surname.gamename)."
+echo "   period."
+echo "   Ex. com.example.foobar"
 echo
 read -p "Unique ID: " uuid
 if [[ "$uuid" == "" ]]; then
@@ -82,30 +76,15 @@ if [[ "$uuid" == "" ]]; then
 	echo
 	exit -1;
 fi
-echo 
-
 echo
-echo "5. Enter author name."
-echo
-echo "   On BlackBerry targets, this is used for"
-echo "   signing and must match the developer name"
-echo "   of your development certificate."
-echo
-read -p "Author: " author
-if [[ "$author" == "" ]]; then
-	echo
-	echo "ERROR: No author specified."
-	echo
-	exit -1;
-fi
-echo 
 
 echo
-echo "6. Enter your game's main class name."
+echo "4. Enter your game's main class name."
 echo
 echo "   Your initial game header and source file"
 echo "   will be given this name and a class with"
 echo "   this name will be created in these files."
+echo "   Ex. FooBarGame"
 echo
 read -p "Class name: " className
 if [[ "$className" == "" ]]; then
@@ -117,12 +96,13 @@ fi
 echo 
 
 echo
-echo "7. Enter the project path."
+echo "5. Enter the project path."
 echo
 echo "   This can be a relative path, absolute path,"
 echo "   or empty for the current folder. Note that"
 echo "   a project folder named $projName will also"
 echo "   be created inside this folder."
+echo "   Ex. samples"
 echo
 read -p "Path: " location
 if [[ "$location" == "" ]]; then
@@ -197,32 +177,11 @@ aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/$projName.xcodeproj/proje
 
 cp "template/TEMPLATE_PROJECT-macosx.plist" "$projPath/$projName-macosx.plist"
 aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/$projName-macosx.plist"
-aliassedinplace "s*TEMPLATE_AUTHOR*$author*g" "$projPath/$projName-macosx.plist"
 
 cp "template/TEMPLATE_PROJECT-ios.plist" "$projPath/$projName-ios.plist"
 cp "template/[email protected]" "$projPath/[email protected]"
 aliassedinplace "s*TEMPLATE_TITLE*$title*g" "$projPath/$projName-ios.plist"
 aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/$projName-ios.plist"
-aliassedinplace "s*TEMPLATE_AUTHOR*$author*g" "$projPath/$projName-ios.plist"
-
-#############################################
-# Copy BlackBerry NDK project files
-#############################################
-cp "template/template.cproject" "$projPath/.cproject"
-aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/.cproject"
-aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/.cproject"
-aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/.cproject"
-
-cp "template/template.project" "$projPath/.project"
-aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/.project"
-
-cp "template/template.bar-descriptor.xml" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*TEMPLATE_TITLE*$title*g" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*TEMPLATE_AUTHOR*$author*g" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*TEMPLATE_DESCRIPTION*$desc*g" "$projPath/bar-descriptor.xml"
-aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/bar-descriptor.xml"
 
 #############################################
 # Copy Android NDK project files
@@ -232,16 +191,18 @@ mkdir -p "$projPath/android/jni"
 mkdir -p "$projPath/android/res/values"
 mkdir -p "$projPath/android/res/drawable"
 
-cp "template/android/template.AndroidManifest.xml" "$projPath/android/AndroidManifest.xml"
+cp "template/android/AndroidManifest.xml" "$projPath/android/AndroidManifest.xml"
 aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/AndroidManifest.xml"
 aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/android/AndroidManifest.xml"
 
-cp "template/android/template.build.xml" "$projPath/android/build.xml"
+cp "template/android/build.xml" "$projPath/android/build.xml"
 aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/build.xml"
 aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/android/build.xml"
 
+cp "template/android/project.properties" "$projPath/android/project.properties"
+
 cp "template/android/jni/Application.mk" "$projPath/android/jni/Application.mk"
-cp "template/android/jni/template.Android.mk" "$projPath/android/jni/Android.mk"
+cp "template/android/jni/Android.mk" "$projPath/android/jni/Android.mk"
 aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/jni/Android.mk"
 aliassedinplace "s*TemplateGame*$className*g" "$projPath/android/jni/Android.mk"
 aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/android/jni/Android.mk"
@@ -250,6 +211,32 @@ cp "template/icon.png" "$projPath/android/res/drawable/icon.png"
 cp "template/android/res/values/template.strings.xml" "$projPath/android/res/values/strings.xml"
 aliassedinplace "s*TEMPLATE_TITLE*$title*g" "$projPath/android/res/values/strings.xml"
 
+#############################################
+# Copy Android Eclipse files
+#############################################
+cp "template/android/.cproject" "$projPath/android/.cproject"
+aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/.cproject"
+aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/android/.cproject"
+aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/android/.cproject"
+
+cp "template/android/.project" "$projPath/android/.project"
+aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/.project"
+
+cp "template/android/.classpath" "$projPath/android/.classpath"
+aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/android/.classpath"
+
+#############################################
+# Copy Linux Eclipse files
+#############################################
+
+cp "template/.cproject" "$projPath/.cproject"
+aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/.cproject"
+aliassedinplace "s*TEMPLATE_UUID*$uuid*g" "$projPath/.cproject"
+aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/.cproject"
+
+cp "template/.project" "$projPath/.project"
+aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/.project"
+
 #############################################
 # Copy CMake files
 #############################################
@@ -259,6 +246,7 @@ aliassedinplace "s*TEMPLATE_PROJECT*$projName*g" "$projPath/CMakeLists.txt"
 aliassedinplace "s*TemplateGame*$className*g" "$projPath/CMakeLists.txt"
 aliassedinplace "s*GAMEPLAY_PATH*$gpPath*g" "$projPath/CMakeLists.txt"
 
+
 #############################################
 # Copy source files
 #############################################

+ 3 - 0
samples/browser/android/.cproject

@@ -55,4 +55,7 @@
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+		<buildTargets/>
+	</storageModule>
 </cproject>

+ 4 - 4
samples/browser/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
-	<uses-feature android:glEsVersion="0x00020000"/>
+    <uses-sdk android:minSdkVersion="16" />
+    <uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-browser" />

+ 49 - 4
samples/browser/android/build.xml

@@ -7,9 +7,57 @@
     <loadproperties srcFile="project.properties" />
     
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
 
     <target name="-pre-build">
-        <mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+	
+    <target name="-post-compile">
         <copy file="../game.config" tofile="assets/game.config"/>
         <copy todir="assets/res/common">
             <fileset dir="../res/common"/>
@@ -25,9 +73,6 @@
             <fileset dir="../../../gameplay/res/ui"/>
         </copy>
     </target>
-	
-    <target name="-post-compile">
-    </target>
 
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />

+ 6 - 5
samples/browser/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -112,7 +112,8 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
+
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/browser/android/jni/Application.mk

@@ -2,4 +2,4 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16

+ 2 - 1
samples/browser/android/project.properties

@@ -1,2 +1,3 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src

+ 0 - 75
samples/browser/bar-descriptor.xml

@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_browser</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Samples</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Samples</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-
-    <asset path="icon.png">icon.png</asset>
-	<asset path="game.config">game.config</asset>
-	<asset path="res/common">res/common</asset>
-	<asset path="res/png">res/png</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-    
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-browser" entry="true" type="Qnx/Elf">sample-browser</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-browser" entry="true" type="Qnx/Elf">sample-browser</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-browser" entry="true" type="Qnx/Elf">sample-browser</asset>
-    </configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching, which should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>

+ 4 - 4
samples/character/android/AndroidManifest.xml

@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="org.gameplay3d.sample_character"
+        package="org.gameplay3d.sample_mesh"
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15"/>
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-character" />

+ 50 - 5
samples/character/android/build.xml

@@ -7,9 +7,57 @@
     <loadproperties srcFile="project.properties" />
 
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-		<mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+	
+    <target name="-post-compile">
         <copy file="../game.png.config" tofile="assets/game.config"/>
         <copy file="../res/design/backboard.png" tofile="assets/res/png/backboard.png"/>
         <copy file="../res/design/basketball.png" tofile="assets/res/png/basketball.png"/>
@@ -55,9 +103,6 @@
             <fileset dir="../../../gameplay/res/ui"/>
         </copy>
     </target>
-	
-    <target name="-post-compile">
-    </target>
 
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />

+ 6 - 6
samples/character/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -85,12 +85,12 @@ include $(CLEAR_VARS)
 
 LOCAL_MODULE    := sample-character
 LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp CharacterGame.cpp
-
 LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
+
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/character/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/character/android/project.properties

@@ -1,2 +1,3 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src

+ 0 - 117
samples/character/bar-descriptor.xml

@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_character</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Character</name>
-    
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Character</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-    
-    <asset path="icon.png">icon.png</asset>
-    <asset path="res/common">res/common</asset>
-    <asset path="res/design/backboard.png">res/png/backboard.png</asset>
-    <asset path="res/design/basketball.png">res/png/basketball.png</asset>
-    <asset path="res/design/basketballnet.png">res/png/basketballnet.png</asset>
-    <asset path="res/design/book.png">res/png/book.png</asset>
-    <asset path="res/design/bookshelf.png">res/png/bookshelf.png</asset>
-    <asset path="res/design/boy.png">res/png/boy.png</asset>
-    <asset path="res/design/decals.png">res/png/decals.png</asset>
-    <asset path="res/design/door.png">res/png/door.png</asset>
-    <asset path="res/design/doorframe.png">res/png/doorframe.png</asset>
-    <asset path="res/design/easel.png">res/png/easel.png</asset>
-    <asset path="res/design/floor.png">res/png/floor.png</asset>
-    <asset path="res/design/floortiles.png">res/png/floortiles.png</asset>
-    <asset path="res/design/gamepad.png">res/png/gamepad.png</asset>
-    <asset path="res/design/playtable.png">res/png/playtable.png</asset>
-    <asset path="res/design/shadow.png">res/png/shadow.png</asset>
-    <asset path="res/design/storageorganizer.png">res/png/storageorganizer.png</asset>
-    <asset path="res/design/tableleg1.png">res/png/tableleg1.png</asset>
-    <asset path="res/design/tableleg2.png">res/png/tableleg2.png</asset>
-    <asset path="res/design/tableleg3.png">res/png/tableleg3.png</asset>
-    <asset path="res/design/tableleg4.png">res/png/tableleg4.png</asset>
-    <asset path="res/design/tabletop.png">res/png/tabletop.png</asset>
-    <asset path="res/design/tiles.png">res/png/tiles.png</asset>
-    <asset path="res/design/tilesn.png">res/png/tilesn.png</asset>
-    <asset path="res/design/toybox.png">res/png/toybox.png</asset>
-    <asset path="res/design/walleast.png">res/png/walleast.png</asset>
-    <asset path="res/design/wallnorth.png">res/png/wallnorth.png</asset>
-    <asset path="res/design/walloverhang.png">res/png/walloverhang.png</asset>
-    <asset path="res/design/wallsouth.png">res/png/wallsouth.png</asset>
-    <asset path="res/design/wallwest.png">res/png/wallwest.png</asset>
-    <asset path="res/design/windowledge.png">res/png/windowledge.png</asset>
-    <asset path="res/design/wood.png">res/png/wood.png</asset>
-    <asset path="res/design/woodn.png">res/png/woodn.png</asset>
-    <asset path="game.png.config">game.config</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-    
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
-    </configuration>
-    <configuration name="Simulator">
-       <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-character" entry="true" type="Qnx/Elf">sample-character</asset>
-    </configuration>
-  
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-    
-    <!-- The splash screen that will appear when your application is launching. Should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-    
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-    
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>

+ 3 - 3
samples/lua/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                 android:label="@string/app_name"
-                android:configChanges="screenSize|orientation|keyboardHidden"
+                android:configChanges="orientation|keyboardHidden"
 				android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-lua" />

+ 50 - 5
samples/lua/android/build.xml

@@ -7,9 +7,57 @@
     <loadproperties srcFile="project.properties" />
 
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-		<mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+
+    <target name="-post-compile">
         <copy file="../game.config" tofile="assets/game.config"/>
         <copy file="../res/ai.lua" tofile="assets/res/ai.lua"/>
         <copy file="../res/game.lua" tofile="assets/res/game.lua"/>
@@ -26,9 +74,6 @@
         </copy>
     </target>
 
-    <target name="-post-compile">
-    </target>
-
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />
 

+ 5 - 5
samples/lua/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -90,7 +90,7 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/lua/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/lua/android/project.properties

@@ -1,3 +1,4 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src
 

+ 0 - 90
samples/lua/bar-descriptor.xml

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_lua</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Lua</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Lua</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-
-    <asset path="icon.png">icon.png</asset>
-    <asset path="game.config">game.config</asset>
-    <asset path="res/ai.lua">res/ai.lua</asset>
-    <asset path="res/game.lua">res/game.lua</asset>
-    <asset path="res/lua.gpb">res/lua.gpb</asset>
-    <asset path="res/lua.material">res/lua.material</asset>
-    <asset path="res/lua.scene">res/lua.scene</asset>
-    <asset path="res/lua-logo.png">res/lua-logo.png</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-lua" entry="true" type="Qnx/Elf">sample-lua</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-lua" entry="true" type="Qnx/Elf">sample-lua</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-lua" entry="true" type="Qnx/Elf">sample-lua</asset>
-    </configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching. Should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>

+ 3 - 3
samples/mesh/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-mesh" />

+ 51 - 6
samples/mesh/android/build.xml

@@ -7,10 +7,58 @@
     <loadproperties srcFile="project.properties" />
 
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-		<mkdir dir="src"/>
-        <copy file="../game.config" tofile="assets/game.config"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+	
+    <target name="-post-compile">
+     	<copy file="../game.config" tofile="assets/game.config"/>
         <copy file="../res/mesh.scene" tofile="assets/res/mesh.scene"/>
         <copy file="../res/mesh.gpb" tofile="assets/res/mesh.gpb"/>
         <copy file="../res/mesh.material" tofile="assets/res/mesh.material"/>
@@ -23,9 +71,6 @@
             <fileset dir="../../../gameplay/res/ui"/>
         </copy>
     </target>
-	
-    <target name="-post-compile">
-    </target>
 
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />

+ 5 - 5
samples/mesh/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -90,7 +90,7 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/mesh/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/mesh/android/project.properties

@@ -1,2 +1,3 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src

+ 0 - 88
samples/mesh/bar-descriptor.xml

@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_mesh</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Mesh</name>
-    
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Mesh</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-    
-    <category>core.games</category>
-    
-    <asset path="icon.png">icon.png</asset>
-    <asset path="res/duck.png">res/duck.png</asset>
-    <asset path="res/mesh.scene">res/mesh.scene</asset>
-    <asset path="res/mesh.gpb">res/mesh.gpb</asset>
-    <asset path="res/mesh.material">res/mesh.material</asset>
-    <asset path="game.config">game.config</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-    
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-mesh" entry="true" type="Qnx/Elf">sample-mesh</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-mesh" entry="true" type="Qnx/Elf">sample-mesh</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-mesh" entry="true" type="Qnx/Elf">sample-mesh</asset>
-    </configuration>
-    
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-    
-    <!-- The splash screen that will appear when your application is launching, which should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-    
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-    
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-    
-</qnx>

+ 3 - 3
samples/particles/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-particles" />

+ 50 - 5
samples/particles/android/build.xml

@@ -7,9 +7,57 @@
     <loadproperties srcFile="project.properties" />
     
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-        <mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+	
+    <target name="-post-compile">
         <copy file="../res/editor.form" tofile="assets/res/editor.form"/>
         <copy file="../res/editor.png" tofile="assets/res/editor.png"/>
         <copy file="../res/editor.theme" tofile="assets/res/editor.theme"/>
@@ -28,9 +76,6 @@
             <fileset dir="../../../gameplay/res/ui"/>
         </copy>
     </target>
-	
-    <target name="-post-compile">
-    </target>
 
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />

+ 5 - 5
samples/particles/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -90,7 +90,7 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/particles/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/particles/android/project.properties

@@ -1,2 +1,3 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src

+ 0 - 93
samples/particles/bar-descriptor.xml

@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_particles</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Particles</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element. Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Particles</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-
-    <asset path="icon.png">icon.png</asset>
-    <asset path="res/editor.form">res/editor.form</asset>
-    <asset path="res/editor.png">res/editor.png</asset>
-    <asset path="res/editor.theme">res/editor.theme</asset>
-    <asset path="res/explosion.particle">res/explosion.particle</asset>
-    <asset path="res/explosion.png">res/explosion.png</asset>
-    <asset path="res/fire.particle">res/fire.particle</asset>
-    <asset path="res/fire.png">res/fire.png</asset>
-    <asset path="res/grid.material">res/grid.material</asset>
-    <asset path="res/smoke.particle">res/smoke.particle</asset>
-    <asset path="res/smoke.png">res/smoke.png</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-particles" entry="true" type="Qnx/Elf">sample-particles</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-particles" entry="true" type="Qnx/Elf">sample-particles</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-particles" entry="true" type="Qnx/Elf">sample-particles</asset>
-    </configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching, which should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>

+ 3 - 3
samples/racer/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16"/>
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name"

+ 48 - 5
samples/racer/android/build.xml

@@ -7,18 +7,61 @@
     <loadproperties srcFile="project.properties" />
     
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-	    <mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
     </target>
 	
     <target name="-post-compile">
-	    <copy file="../game.png.config" tofile="assets/game.config"/>
-		
+  	    <copy file="../game.png.config" tofile="assets/game.config"/>
         <copy todir="assets/res/common">
             <fileset dir="../res/common"/>
         </copy>
-		
         <copy todir="assets/res/png">
             <fileset dir="../res/png"/>
         </copy>

+ 5 - 5
samples/racer/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -90,7 +90,7 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/racer/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/racer/android/project.properties

@@ -1,2 +1,3 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src

+ 0 - 90
samples/racer/bar-descriptor.xml

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_racer</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Racer</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Racer</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-
-    <asset path="icon.png">icon.png</asset>
-    <asset path="res/common">res/common</asset>
-    <asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-    <asset path="../../gameplay/res/shaders">res/shaders</asset>
-    <asset path="../../gameplay/res/ui">res/ui</asset>
-    
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/sample-racer" entry="true" type="Qnx/Elf">sample-racer</asset>
-       <asset path="game.atc.config">game.config</asset>
-       <asset path="res/atc">res/atc</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/sample-racer" entry="true" type="Qnx/Elf">sample-racer</asset>
-       <asset path="game.atc.config">game.config</asset>
-       <asset path="res/atc">res/atc</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/sample-racer" entry="true" type="Qnx/Elf">sample-racer</asset>
-       <asset path="game.png.config">game.config</asset>
-       <asset path="res/png">res/png</asset>
-    </configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching. Should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>

+ 3 - 3
samples/spaceship/android/AndroidManifest.xml

@@ -4,14 +4,14 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
-                  android:configChanges="screenSize|orientation|keyboardHidden"
+                  android:configChanges="orientation|keyboardHidden"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 				  android:screenOrientation="landscape">
             <meta-data android:name="android.app.lib_name" android:value="sample-spaceship"/>

+ 50 - 5
samples/spaceship/android/build.xml

@@ -7,9 +7,57 @@
     <loadproperties srcFile="project.properties" />
     
     <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" unless="sdk.dir" />
-
+	<fail message="OS not supported. Supported platforms: Windows, MacOS X or Linux.">
+	    <condition>
+	      <not>
+	        <or>
+	          <os family="unix"/>
+	          <os family="windows"/>
+	        </or>
+	      </not>
+	    </condition>
+	</fail>
+	<macrodef name="build-native">
+		<attribute name="location"/>
+	     <sequential>
+		 	<exec osfamily="unix" dir="@{location}/android" executable="android">
+			    <arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="unix" dir="@{location}/android" executable="ndk-build"/>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="android.bat"/>
+				<arg value="update"/>
+				<arg value="project"/>
+				<arg value="-t"/>
+				<arg value="1"/>
+				<arg value="-p"/>
+				<arg value="."/>
+				<arg value="-s"/>
+			</exec>
+			<exec osfamily="windows" dir="@{location}/android" executable="cmd">
+				<arg value="/c"/>
+				<arg value="ndk-build -j4"/>
+			</exec> 
+	    </sequential>
+	</macrodef>
+    
     <target name="-pre-build">
-        <mkdir dir="src"/>
+		<build-native location="../../../gameplay"/>
+    	<build-native location=".."/>
+        <mkdir dir="../src/org/gameplay3d"/>
+	    <copy todir="../src/org/gameplay3d">
+            <fileset dir="../../../gameplay/src/org/gameplay3d"/>
+	    </copy>
+    </target>
+
+    <target name="-post-compile">
         <copy file="../res/airstrip.gpb" tofile="assets/res/airstrip.gpb"/>
         <copy file="../res/background.ogg" tofile="assets/res/background.ogg"/>
         <copy file="../res/background.png" tofile="assets/res/background.png"/>
@@ -25,9 +73,6 @@
         </copy>
     </target>
 
-    <target name="-post-compile">
-    </target>
-
     <!-- version-tag: 1 -->
     <import file="${sdk.dir}/tools/ant/build.xml" />
 

+ 5 - 5
samples/spaceship/android/jni/Android.mk

@@ -10,11 +10,11 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/vorbis/lib/android/arm
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/libs/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)
@@ -90,7 +90,7 @@ LOCAL_CPPFLAGS += -std=c++11 -Wno-switch-enum -Wno-switch
 LOCAL_ARM_MODE := arm
 LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
 LOCAL_CFLAGS    := -D__ANDROID__ -I"../../../external-deps/lua/include" -I"../../../external-deps/bullet/include" -I"../../../external-deps/png/include" -I"../../../external-deps/ogg/include" -I"../../../external-deps/vorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
-
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_SHARED_LIBRARIES := gameplay
 include $(BUILD_SHARED_LIBRARY)
 $(call import-module,android/native_app_glue)

+ 1 - 1
samples/spaceship/android/jni/Application.mk

@@ -2,5 +2,5 @@ NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
 APP_STL      := gnustl_static
 APP_ABI      := armeabi-v7a
-APP_PLATFORM := android-14
+APP_PLATFORM := android-16
 

+ 2 - 1
samples/spaceship/android/project.properties

@@ -1,3 +1,4 @@
-target=android-20
+target=android-16
 android.library=false
+source.dir=../src
 

+ 0 - 89
samples/spaceship/bar-descriptor.xml

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>org.gameplay3d.sample_spaceship</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>Spaceship</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>Spaceship</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>RIM Canada</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgLDcDLxX077jVWRVnDpywiU</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-  
-	<asset path="icon.png">icon.png</asset>
-	<asset path="res/airstrip.gpb">res/airstrip.gpb</asset>  
-	<asset path="res/spaceship.gpb">res/spaceship.gpb</asset>
-	<asset path="res/spaceship.wav">res/spaceship.wav</asset>
-	<asset path="res//background.ogg">res/background.ogg</asset>
-	<asset path="res/background.png">res/background.png</asset>
-	<asset path="res/propulsion_glow.png">res/propulsion_glow.png</asset>
-	<asset path="game.config">game.config</asset>
-	<asset path="../../gameplay/res/logo_powered_white.png">res/logo_powered_white.png</asset>
-	<asset path="../../gameplay/res/shaders">res/shaders</asset>
-	<asset path="../../gameplay/res/ui">res/ui</asset>
-	  
-	<configuration name="Device-Debug">
-	  <platformArchitecture>armle-v7</platformArchitecture>
-	  <asset path="Device-Debug/sample-spaceship" entry="true" type="Qnx/Elf">sample-spaceship</asset>
-	</configuration>
-	<configuration name="Device-Release">
-	  <platformArchitecture>armle-v7</platformArchitecture>
-	  <asset path="Device-Release/sample-spaceship" entry="true" type="Qnx/Elf">sample-spaceship</asset>
-	</configuration>
-	<configuration name="Simulator">
-	  <platformArchitecture>x86</platformArchitecture>
-	  <asset path="Simulator/sample-spaceship" entry="true" type="Qnx/Elf">sample-spaceship</asset>
-	</configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching. Should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-</qnx>

+ 250 - 0
template/.cproject

@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.349030683">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.349030683" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.349030683" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug" postannouncebuildStep="Copying Assets" postbuildStep="rsync -rau ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/shaders ${workspace_loc:/${ProjName}}/res;rsync -rau ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/ui ${workspace_loc:/${ProjName}}/res;cp -rf ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/logo_powered_white.png ${workspace_loc:/${ProjName}}/res;touch -cm ${workspace_loc:/${ProjName}}/res">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.349030683." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.306691387" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.437887716" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+							<builder buildPath="${workspace_loc:/sample-mesh}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.1855946472" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.1520902797" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.2064560376" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+								<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1117748719" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1114187527" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.preprocessor.def.560897994" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="__linux__"/>
+									<listOptionValue builtIn="false" value="GP_USE_GAMEPAD"/>
+								</option>
+								<option id="gnu.cpp.compiler.option.include.paths.1388077261" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+									<listOptionValue builtIn="false" value=“&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/src&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/lua/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/png/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/zlib/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/ogg/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/vorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/openal/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/glew/include&quot;"/>
+									<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gtk-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/atk-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/cairo"/>
+									<listOptionValue builtIn="false" value="/usr/include/gdk-pixbuf-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/pango-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/gio-unix-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/freetype2"/>
+									<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/glib-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/pixman-1"/>
+									<listOptionValue builtIn="false" value="/usr/include/libpng12"/>
+									<listOptionValue builtIn="false" value="/usr/include/harfbuzz"/>
+								</option>
+								<option id="gnu.cpp.compiler.option.other.other.1011647163" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++11 -lstdc++ -pthread" valueType="string"/>
+								<option id="gnu.cpp.compiler.option.warnings.allwarn.72301138" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" value="false" valueType="boolean"/>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.326913939" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.114474653" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.299251619" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.debug.option.debugging.level.694901276" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1542797576" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.493533572" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1574466352" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+								<option id="gnu.cpp.link.option.libs.1247748738" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+									<listOptionValue builtIn="false" value="gameplay"/>
+									<listOptionValue builtIn="false" value="m"/>
+									<listOptionValue builtIn="false" value="lua"/>
+									<listOptionValue builtIn="false" value="png"/>
+									<listOptionValue builtIn="false" value="z"/>
+									<listOptionValue builtIn="false" value="vorbis"/>
+									<listOptionValue builtIn="false" value="ogg"/>
+									<listOptionValue builtIn="false" value="BulletDynamics"/>
+									<listOptionValue builtIn="false" value="BulletCollision"/>
+									<listOptionValue builtIn="false" value="LinearMath"/>
+									<listOptionValue builtIn="false" value="openal"/>
+									<listOptionValue builtIn="false" value="GLEW"/>
+									<listOptionValue builtIn="false" value="GL"/>
+									<listOptionValue builtIn="false" value="rt"/>
+									<listOptionValue builtIn="false" value="dl"/>
+									<listOptionValue builtIn="false" value="X11"/>
+									<listOptionValue builtIn="false" value="pthread"/>
+									<listOptionValue builtIn="false" value="gtk-x11-2.0"/>
+									<listOptionValue builtIn="false" value="glib-2.0"/>
+									<listOptionValue builtIn="false" value="gobject-2.0"/>
+								</option>
+								<option id="gnu.cpp.link.option.paths.550339008" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/lua/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/zlib/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/png/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/bullet/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/ogg/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/vorbis/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/openal/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/glew/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/${ConfigName}"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1774954616" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1474164080" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.71067264" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.617055181">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.617055181" moduleId="org.eclipse.cdt.core.settings" name="Release">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.617055181" name="Release" parent="cdt.managedbuild.config.gnu.exe.release" postannouncebuildStep="Copying Assets" postbuildStep="rsync -rau ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/shaders ${workspace_loc:/${ProjName}}/res;rsync -rau ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/ui ${workspace_loc:/${ProjName}}/res;cp -rf ${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/res/logo_powered_white.png ${workspace_loc:/${ProjName}}/res;touch -cm ${workspace_loc:/${ProjName}}/res">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.release.617055181." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1992676500" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.406307293" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+							<builder buildPath="${workspace_loc:/sample-mesh}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.641119066" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.1598326511" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1063712229" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+								<option id="gnu.cpp.compiler.exe.release.option.optimization.level.1345682018" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.release.option.debugging.level.414442905" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.preprocessor.def.1982059016" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+									<listOptionValue builtIn="false" value="__linux__"/>
+									<listOptionValue builtIn="false" value="GP_USE_GAMEPAD"/>
+								</option>
+								<option id="gnu.cpp.compiler.option.include.paths.218187428" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/gameplay/src}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/bullet/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/lua/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/png/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/zlib/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/ogg/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/vorbis/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/openal/include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/glew/include&quot;"/>
+									<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/gtk-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/atk-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/cairo"/>
+									<listOptionValue builtIn="false" value="/usr/include/gdk-pixbuf-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/pango-1.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/gio-unix-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/include/freetype2"/>
+									<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
+									<listOptionValue builtIn="false" value="/usr/lib/x86_64-linux-gnu/glib-2.0/include"/>
+									<listOptionValue builtIn="false" value="/usr/include/pixman-1"/>
+									<listOptionValue builtIn="false" value="/usr/include/libpng12"/>
+									<listOptionValue builtIn="false" value="/usr/include/harfbuzz"/>
+								</option>
+								<option id="gnu.cpp.compiler.option.other.other.1035361425" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++11 -lstdc++ -pthread" valueType="string"/>
+								<option id="gnu.cpp.compiler.option.warnings.allwarn.1165467748" name="All warnings (-Wall)" superClass="gnu.cpp.compiler.option.warnings.allwarn" value="false" valueType="boolean"/>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.132233219" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1777813462" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+								<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.196757280" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.release.option.debugging.level.1962534256" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1245555239" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1354772973" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.999807535" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
+								<option id="gnu.cpp.link.option.libs.893848113" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+									<listOptionValue builtIn="false" value="gameplay"/>
+									<listOptionValue builtIn="false" value="m"/>
+									<listOptionValue builtIn="false" value="lua"/>
+									<listOptionValue builtIn="false" value="png"/>
+									<listOptionValue builtIn="false" value="z"/>
+									<listOptionValue builtIn="false" value="vorbis"/>
+									<listOptionValue builtIn="false" value="ogg"/>
+									<listOptionValue builtIn="false" value="BulletDynamics"/>
+									<listOptionValue builtIn="false" value="BulletCollision"/>
+									<listOptionValue builtIn="false" value="LinearMath"/>
+									<listOptionValue builtIn="false" value="openal"/>
+									<listOptionValue builtIn="false" value="GLEW"/>
+									<listOptionValue builtIn="false" value="GL"/>
+									<listOptionValue builtIn="false" value="rt"/>
+									<listOptionValue builtIn="false" value="dl"/>
+									<listOptionValue builtIn="false" value="X11"/>
+									<listOptionValue builtIn="false" value="pthread"/>
+									<listOptionValue builtIn="false" value="gtk-x11-2.0"/>
+									<listOptionValue builtIn="false" value="glib-2.0"/>
+									<listOptionValue builtIn="false" value="gobject-2.0"/>
+								</option>
+								<option id="gnu.cpp.link.option.paths.725660289" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/lua/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/zlib/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/png/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/bullet/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/ogg/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/vorbis/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/openal/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/external-deps/glew/lib/linux/x64"/>
+									<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}}/GAMEPLAY_PATH/gameplay/${ConfigName}"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.487294404" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.1500493024" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.577625570" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="sample-mesh.cdt.managedbuild.target.gnu.exe.710799574" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+	</storageModule>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.617055181;cdt.managedbuild.config.gnu.exe.release.617055181.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1777813462;cdt.managedbuild.tool.gnu.c.compiler.input.1245555239">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.349030683;cdt.managedbuild.config.gnu.exe.debug.349030683.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.114474653;cdt.managedbuild.tool.gnu.c.compiler.input.1542797576">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.617055181;cdt.managedbuild.config.gnu.exe.release.617055181.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1063712229;cdt.managedbuild.tool.gnu.cpp.compiler.input.132233219">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.349030683;cdt.managedbuild.config.gnu.exe.debug.349030683.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.2064560376;cdt.managedbuild.tool.gnu.cpp.compiler.input.326913939">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Release">
+			<resource resourceType="PROJECT" workspacePath="/sample-mesh"/>
+		</configuration>
+		<configuration configurationName="Debug">
+			<resource resourceType="PROJECT" workspacePath="/sample-mesh"/>
+		</configuration>
+	</storageModule>
+</cproject>

+ 25 - 0
template/.project

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>TEMPLATE_PROJECT</name>
+	<comment></comment>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>

+ 13 - 0
template/android/.classpath

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="src" path="src">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="TEMPLATE_PROJECT/src"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

+ 57 - 0
template/android/.cproject

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="com.android.toolchain.gcc.1723047999">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1723047999" moduleId="org.eclipse.cdt.core.settings" name="Default">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1723047999" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
+					<folderInfo id="com.android.toolchain.gcc.1723047999.1769297596" name="/" resourcePath="">
+						<toolChain id="com.android.toolchain.gcc.698600898" name="com.android.toolchain.gcc" superClass="com.android.toolchain.gcc">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.42683489" isAbstract="false" superClass="com.android.targetPlatform"/>
+							<builder arguments="NDK_DEBUG=1 -j4" command="ndk-build" id="com.android.builder.863968597" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
+								<outputEntries>
+									<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
+									<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
+								</outputEntries>
+							</builder>
+							<tool id="com.android.gcc.compiler.270981819" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
+								<inputType id="com.android.gcc.inputType.942593139" superClass="com.android.gcc.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="TEMPLATE_PROJECT.null.741876809" name="TEMPLATE_PROJECT"/>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1723047999;com.android.toolchain.gcc.1723047999.1769297596;com.android.gcc.compiler.270981819;com.android.gcc.inputType.942593139">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Default">
+			<resource resourceType="PROJECT" workspacePath="/TEMPLATE_PROJECT"/>
+		</configuration>
+	</storageModule>
+</cproject>

+ 54 - 0
template/android/.project

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>TEMPLATE_PROJECT</name>
+	<comment></comment>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>src</name>
+			<type>2</type>
+			<locationURI>$%7BPARENT-2-PROJECT_LOC%7D/TEMPLATE_PROJECT/src</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

+ 5 - 6
template/android/template.AndroidManifest.xml → template/android/AndroidManifest.xml

@@ -4,18 +4,17 @@
         android:versionCode="1"
         android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="15" />
+    <uses-sdk android:minSdkVersion="16" />
 	<uses-feature android:glEsVersion="0x00020000"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true">
-        <activity android:name="android.app.NativeActivity"
+        <activity android:name="org.gameplay3d.GameNativeActivity"
                   android:label="@string/app_name"
                   android:configChanges="screenSize|orientation|keyboardHidden"
-				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				  android:screenOrientation="landscape">
-            <meta-data android:name="android.app.lib_name"
-                    android:value="TEMPLATE_PROJECT" />
+                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+                  android:screenOrientation="landscape">
+            <meta-data android:name="android.app.lib_name" android:value="TEMPLATE_PROJECT" />
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />

+ 0 - 0
template/android/template.build.xml → template/android/build.xml


+ 97 - 0
template/android/jni/Android.mk

@@ -0,0 +1,97 @@
+SAMPLE_PATH := $(call my-dir)/../../src
+
+# external-deps
+PNG_PATH := ../GAMEPLAY_PATH/external-deps/png/lib/android/arm
+ZLIB_PATH := ../GAMEPLAY_PATH/external-deps/zlib/lib/android/arm
+LUA_PATH := ../GAMEPLAY_PATH/external-deps/lua/lib/android/arm
+BULLET_PATH := ../GAMEPLAY_PATH/external-deps/bullet/lib/android/arm
+OGG_PATH := ../GAMEPLAY_PATH/external-deps/ogg/lib/android/arm
+VORBIS_PATH := ../GAMEPLAY_PATH/external-deps/vorbis/lib/android/arm
+OPENAL_PATH := ../GAMEPLAY_PATH/external-deps/openal/lib/android/arm
+
+# gameplay
+LOCAL_PATH := ../GAMEPLAY_PATH/gameplay/android/obj/local/armeabi-v7a
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libgameplay
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+# libpng
+LOCAL_PATH := $(PNG_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpng 
+LOCAL_SRC_FILES := libpng.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libz
+LOCAL_PATH := $(ZLIB_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libz
+LOCAL_SRC_FILES := libz.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# liblua
+LOCAL_PATH := $(LUA_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := liblua
+LOCAL_SRC_FILES := liblua.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libLinearMath
+LOCAL_PATH := $(BULLET_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libLinearMath
+LOCAL_SRC_FILES := libLinearMath.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libBulletCollision
+LOCAL_PATH := $(BULLET_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libBulletCollision
+LOCAL_SRC_FILES := libBulletCollision.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libBulletDynamics
+LOCAL_PATH := $(BULLET_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libBulletDynamics
+LOCAL_SRC_FILES := libBulletDynamics.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libogg
+LOCAL_PATH := $(OGG_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libogg
+LOCAL_SRC_FILES := libogg.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# TEMPLATE_PROJECT
+LOCAL_PATH := $(SAMPLE_PATH)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := TEMPLATE_PROJECT
+LOCAL_SRC_FILES := ../GAMEPLAY_PATH/gameplay/src/gameplay-main-android.cpp TemplateGame.cpp
+
+LOCAL_CPPFLAGS += -std=c++11
+LOCAL_ARM_MODE := arm
+LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
+LOCAL_CFLAGS    := -D__ANDROID__ -I"../GAMEPLAY_PATH/external-deps/lua/include" -I"../GAMEPLAY_PATH/external-deps/bullet/include" -I"../GAMEPLAY_PATH/external-deps/png/include" -I"../GAMEPLAY_PATH/external-deps/ogg/include" -I"../GAMEPLAY_PATH/external-deps/vorbis/include" -I"../GAMEPLAY_PATH/external-deps/openal/include" -I"../GAMEPLAY_PATH/gameplay/src"
+
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libpng libz liblua libBulletDynamics libBulletCollision libLinearMath libvorbis libogg libOpenAL
+LOCAL_STATIC_LIBRARIES := gameplay
+include $(BUILD_SHARED_LIBRARY)
+
+$(call import-module,android/native_app_glue)

+ 3 - 2
template/android/jni/Application.mk

@@ -1,4 +1,5 @@
 NDK_TOOLCHAIN_VERSION := 4.8
 APP_CPPFLAGS += -std=c++11
-APP_STL     := gnustl_static
-APP_ABI     := armeabi-v7a
+APP_STL      := gnustl_static
+APP_ABI      := armeabi-v7a
+APP_PLATFORM := android-16

+ 2 - 2
template/android/jni/template.Android.mk

@@ -13,8 +13,8 @@ OPENAL_PATH := ../GAMEPLAY_PATH/external-deps/openal/lib/android/arm
 LOCAL_PATH := ../GAMEPLAY_PATH/gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
-LOCAL_SRC_FILES := libgameplay.a
-include $(PREBUILT_STATIC_LIBRARY)
+LOCAL_SRC_FILES := libgameplay.so
+include $(PREBUILT_SHARED_LIBRARY)
 
 # libpng
 LOCAL_PATH := $(PNG_PATH)

+ 3 - 0
template/android/project.properties

@@ -0,0 +1,3 @@
+target=android-16
+android.library=false
+source.dir=../src

+ 0 - 83
template/template.bar-descriptor.xml

@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry OS application descriptor file.
-    Specifies parameters for identifying, installing, and launching native applications on BlackBerry OS.
--->
-
-    <!-- A universally unique application identifier. Must be unique across all BlackBerry OS applications.
-         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
-    <id>TEMPLATE_UUID</id>
-
-    <!-- The name that is displayed in the BlackBerry OS application installer. 
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <name>TEMPLATE_TITLE</name>
-
-    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
-         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
-         An updated version of application must have a versionNumber value higher than the previous version. Required. -->
-    <versionNumber>1.0.0</versionNumber>
-
-    <!-- Fourth digit segment of the package version. First three segments are taken from the 
-         <versionNumber> element.  Must be an integer from 0 to 2^16-1 -->
-    <buildId>1</buildId>
-
-    <!-- Description, displayed in the BlackBerry OS application installer.
-         May have multiple values for each language. See samples or xsd schema file. Optional. -->
-    <description>TEMPLATE_DESCRIPTION</description>
-
-    <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
-    <author>TEMPLATE_AUTHOR</author>
-
-    <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
-    <!-- <authorId>gYAAgPkLP1tZlyYP1wiMaRFFNMw</authorId> -->
-
-    <initialWindow>
-        <aspectRatio>landscape</aspectRatio>
-        <autoOrients>false</autoOrients>
-        <systemChrome>none</systemChrome>
-    </initialWindow>
-
-    <category>core.games</category>
-
-    <asset path="icon.png">icon.png</asset>
-    <asset path="res">res</asset>
-    <asset path="GAMEPLAY_PATH/gameplay/res/shaders">res/shaders</asset>
-    <asset path="GAMEPLAY_PATH/gameplay/res/ui">res/ui</asset>
-
-    <configuration name="Device-Debug">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Debug/TEMPLATE_PROJECT" entry="true" type="Qnx/Elf">TEMPLATE_PROJECT</asset>
-    </configuration>
-    <configuration name="Device-Release">
-       <platformArchitecture>armle-v7</platformArchitecture>
-       <asset path="Device-Release/TEMPLATE_PROJECT" entry="true" type="Qnx/Elf">TEMPLATE_PROJECT</asset>
-    </configuration>
-    <configuration name="Simulator">
-        <platformArchitecture>x86</platformArchitecture>
-       <asset path="Simulator/TEMPLATE_PROJECT" entry="true" type="Qnx/Elf">TEMPLATE_PROJECT</asset>
-    </configuration>
-
-    <!-- The icon for the application, which should be 114x114. -->
-    <icon>
-        <image>icon.png</image>
-    </icon>
-
-    <!-- The splash screen that will appear when your application is launching. Should be 1280x720. -->
-    <!-- <splashscreen></splashscreen> -->
-
-    <!-- The permissions requested by your application. -->
-    <!--  <action>access_shared</action> -->
-    <!--  <action>record_audio</action> -->
-    <!--  <action>read_geolocation</action> -->
-    <!--  <action>use_camera</action> -->
-    <!--  <action>access_internet</action> -->
-    <!--  <action>play_audio</action> -->
-    <!--  <action>post_notification</action> -->
-    <!--  <action>set_audio_volume</action> -->
-    <!--  <action>read_device_identifying_information</action> -->
-
-    <!-- Ensure that shared libraries in the package are found at run-time. -->
-    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
-
-</qnx>