浏览代码

Additional changes for linux support

seanpaultaylor 13 年之前
父节点
当前提交
2f26a0a7a3

+ 35 - 34
.gitignore

@@ -1,9 +1,9 @@
 *.suo
 *.sdf
-*.opensdf
-.DS_Store*
-ehthumbs.db
-Icon?
+*.opensdf
+.DS_Store*
+ehthumbs.db
+Icon?
 Thumbs.db
 /.metadata
 /169.254.0.1
@@ -16,7 +16,8 @@ Thumbs.db
 /Device-Debug
 /Device-Coverage
 /Device-Profile
-/Device-Release
+/Device-Release
+/build
 
 /gameplay/Debug
 /gameplay/DebugMem
@@ -27,26 +28,26 @@ Thumbs.db
 /gameplay/Device-Debug
 /gameplay/Device-Coverage
 /gameplay/Device-Profile
-/gameplay/Device-Release
+/gameplay/Device-Release
 /gameplay.xcworkspace/xcuserdata
-/gameplay/gameplay.xcodeproj/xcuserdata
+/gameplay/gameplay.xcodeproj/xcuserdata
 /gameplay/android/NUL
 /gameplay/android/proguard.cfg
 /gameplay/android/local.properties
 /gameplay/android/project.properties
-/gameplay/android/obj
-
-/gameplay-api/xml
+/gameplay/android/obj
+
+/gameplay-api/xml
 
 /gameplay-encoder/Debug
 /gameplay-encoder/Release
-/gameplay-encoder/gameplay-encoder.xcodeproj/xcuserdata
+/gameplay-encoder/gameplay-encoder.xcodeproj/xcuserdata
 
 /gameplay-luagen/Release
 /gameplay-luagen/Debug
 /gameplay-luagen/doxygen_entrydb_680.tmp
 /gameplay-luagen/doxygen_objdb_680.tmp
-/gameplay-luagen/xml
+/gameplay-luagen/xml
 
 /gameplay-samples/sample00-mesh/Debug
 /gameplay-samples/sample00-mesh/DebugMem
@@ -58,9 +59,9 @@ Thumbs.db
 /gameplay-samples/sample00-mesh/Device-Coverage
 /gameplay-samples/sample00-mesh/Device-Profile
 /gameplay-samples/sample00-mesh/Device-Release
-/gameplay-samples/sample00-mesh/res/shaders
+/gameplay-samples/sample00-mesh/res/shaders
 /gameplay-samples/sample00-mesh/res/logo_powered_white.png
-/gameplay-samples/sample00-mesh/sample00-mesh.xcodeproj/xcuserdata
+/gameplay-samples/sample00-mesh/sample00-mesh.xcodeproj/xcuserdata
 /gameplay-samples/sample00-mesh/android/src
 /gameplay-samples/sample00-mesh/android/assets
 /gameplay-samples/sample00-mesh/android/bin
@@ -70,7 +71,7 @@ Thumbs.db
 /gameplay-samples/sample00-mesh/android/NUL
 /gameplay-samples/sample00-mesh/android/local.properties
 /gameplay-samples/sample00-mesh/android/proguard.cfg
-/gameplay-samples/sample00-mesh/android/project.properties
+/gameplay-samples/sample00-mesh/android/project.properties
 
 /gameplay-samples/sample01-longboard/Debug
 /gameplay-samples/sample01-longboard/DebugMem
@@ -82,9 +83,9 @@ Thumbs.db
 /gameplay-samples/sample01-longboard/Device-Coverage
 /gameplay-samples/sample01-longboard/Device-Profile
 /gameplay-samples/sample01-longboard/Device-Release
-/gameplay-samples/sample01-longboard/res/shaders
+/gameplay-samples/sample01-longboard/res/shaders
 /gameplay-samples/sample01-longboard/res/logo_powered_white.png
-/gameplay-samples/sample01-longboard/sample01-longboard.xcodeproj/xcuserdata
+/gameplay-samples/sample01-longboard/sample01-longboard.xcodeproj/xcuserdata
 /gameplay-samples/sample01-longboard/NUL
 /gameplay-samples/sample01-longboard/android/NUL
 /gameplay-samples/sample01-longboard/android/src
@@ -92,10 +93,10 @@ Thumbs.db
 /gameplay-samples/sample01-longboard/android/bin
 /gameplay-samples/sample01-longboard/android/gen
 /gameplay-samples/sample01-longboard/android/libs
-/gameplay-samples/sample01-longboard/android/obj
+/gameplay-samples/sample01-longboard/android/obj
 /gameplay-samples/sample01-longboard/android/proguard.cfg
 /gameplay-samples/sample01-longboard/android/project.properties
-/gameplay-samples/sample01-longboard/android/local.properties
+/gameplay-samples/sample01-longboard/android/local.properties
 
 /gameplay-samples/sample02-spaceship/Debug
 /gameplay-samples/sample02-spaceship/DebugMem
@@ -107,9 +108,9 @@ Thumbs.db
 /gameplay-samples/sample02-spaceship/Device-Coverage
 /gameplay-samples/sample02-spaceship/Device-Profile
 /gameplay-samples/sample02-spaceship/Device-Release
-/gameplay-samples/sample02-spaceship/res/shaders
+/gameplay-samples/sample02-spaceship/res/shaders
 /gameplay-samples/sample02-spaceship/res/logo_powered_white.png
-/gameplay-samples/sample02-spaceship/sample02-spaceship.xcodeproj/xcuserdata
+/gameplay-samples/sample02-spaceship/sample02-spaceship.xcodeproj/xcuserdata
 /gameplay-samples/sample02-spaceship/android/NUL
 /gameplay-samples/sample02-spaceship/android/project.properties
 /gameplay-samples/sample02-spaceship/android/assets
@@ -119,7 +120,7 @@ Thumbs.db
 /gameplay-samples/sample02-spaceship/android/obj
 /gameplay-samples/sample02-spaceship/android/src
 /gameplay-samples/sample02-spaceship/android/proguard.cfg
-/gameplay-samples/sample02-spaceship/android/local.properties
+/gameplay-samples/sample02-spaceship/android/local.properties
 
 /gameplay-samples/sample03-character/Debug
 /gameplay-samples/sample03-character/DebugMem
@@ -131,9 +132,9 @@ Thumbs.db
 /gameplay-samples/sample03-character/Device-Coverage
 /gameplay-samples/sample03-character/Device-Profile
 /gameplay-samples/sample03-character/Device-Release
-/gameplay-samples/sample03-character/res/shaders
+/gameplay-samples/sample03-character/res/shaders
 /gameplay-samples/sample03-character/res/logo_powered_white.png
-/gameplay-samples/sample03-character/sample03-character.xcodeproj/xcuserdata
+/gameplay-samples/sample03-character/sample03-character.xcodeproj/xcuserdata
 /gameplay-samples/sample03-character/android/project.properties
 /gameplay-samples/sample03-character/android/proguard.cfg
 /gameplay-samples/sample03-character/android/local.properties
@@ -143,8 +144,8 @@ Thumbs.db
 /gameplay-samples/sample03-character/android/gen
 /gameplay-samples/sample03-character/android/libs
 /gameplay-samples/sample03-character/android/obj
-/gameplay-samples/sample03-character/android/NUL
-/gameplay-samples/sample03-character/res/gamepad.xcf
+/gameplay-samples/sample03-character/android/NUL
+/gameplay-samples/sample03-character/res/gamepad.xcf
 
 /gameplay-samples/sample04-particles/Debug
 /gameplay-samples/sample04-particles/DebugMem
@@ -156,9 +157,9 @@ Thumbs.db
 /gameplay-samples/sample04-particles/Device-Coverage
 /gameplay-samples/sample04-particles/Device-Profile
 /gameplay-samples/sample04-particles/Device-Release
-/gameplay-samples/sample04-particles/res/shaders
+/gameplay-samples/sample04-particles/res/shaders
 /gameplay-samples/sample04-particles/res/logo_powered_white.png
-/gameplay-samples/sample04-particles/sample04-particles.xcodeproj/xcuserdata
+/gameplay-samples/sample04-particles/sample04-particles.xcodeproj/xcuserdata
 /gameplay-samples/sample04-particles/Device-Debug
 /gameplay-samples/sample04-particles/Debug
 /gameplay-samples/sample04-particles/DebugMem
@@ -170,8 +171,8 @@ Thumbs.db
 /gameplay-samples/sample04-particles/android/obj
 /gameplay-samples/sample04-particles/android/proguard.cfg
 /gameplay-samples/sample04-particles/android/local.properties
-/gameplay-samples/sample04-particles/android/project.properties
-
+/gameplay-samples/sample04-particles/android/project.properties
+
 /gameplay-samples/sample05-lua/Debug
 /gameplay-samples/sample05-lua/DebugMem
 /gameplay-samples/sample05-lua/Release
@@ -182,9 +183,9 @@ Thumbs.db
 /gameplay-samples/sample05-lua/Device-Coverage
 /gameplay-samples/sample05-lua/Device-Profile
 /gameplay-samples/sample05-lua/Device-Release
-/gameplay-samples/sample05-lua/res/shaders
+/gameplay-samples/sample05-lua/res/shaders
 /gameplay-samples/sample05-lua/res/logo_powered_white.png
-/gameplay-samples/sample05-lua/sample05-lua.xcodeproj/xcuserdata
+/gameplay-samples/sample05-lua/sample05-lua.xcodeproj/xcuserdata
 /gameplay-samples/sample05-lua/android/src
 /gameplay-samples/sample05-lua/android/assets
 /gameplay-samples/sample05-lua/android/bin
@@ -194,7 +195,7 @@ Thumbs.db
 /gameplay-samples/sample05-lua/android/NUL
 /gameplay-samples/sample05-lua/android/local.properties
 /gameplay-samples/sample05-lua/android/proguard.cfg
-/gameplay-samples/sample05-lua/android/project.properties
-
+/gameplay-samples/sample05-lua/android/project.properties
+
 /gameplay-internal
 /gameplay\android/proguard-project.txt

+ 8 - 6
CMakeLists.txt

@@ -4,14 +4,16 @@ project(GamePlay)
 
 set(GAMEPLAY_VERSION 1.5.0)
 
+# debug
+message( "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
+if( ${CMAKE_BUILD_TYPE} STREQUAL "DEBUG" )
+    add_definitions(-D_DEBUG)
+endif()
+
 # gameplay library
 add_subdirectory(gameplay)
 
 # gameplay samples
-add_subdirectory(gameplay-samples/sample00-mesh)
-#add_subdirectory(gameplay-samples/sample01-longboard)
-#add_subdirectory(gameplay-samples/sample02-spaceship)
-#add_subdirectory(gameplay-samples/sample03-character)
-#add_subdirectory(gameplay-samples/sample04-particles)
-#add_subdirectory(gameplay-samples/sample05-lua)
+add_subdirectory(gameplay-samples)
+
 

+ 6 - 5
gameplay/src/AudioBuffer.cpp

@@ -100,8 +100,9 @@ AudioBuffer* AudioBuffer::create(const char* path)
         GP_ERROR("Unsupported audio file: %s", path);
         goto cleanup;
     }
-    
-    fclose(file);
+
+    if (file)    
+        fclose(file);
 
     buffer = new AudioBuffer(path, alBuffer);
 
@@ -310,9 +311,9 @@ bool AudioBuffer::loadOgg(FILE* file, ALuint buffer)
     OggVorbis_File ogg_file;
     vorbis_info* info;
     ALenum format;
-    int result;
+    long result;
     int section;
-    unsigned int size = 0;
+    long size = 0;
 
     rewind(file);
 
@@ -331,7 +332,7 @@ bool AudioBuffer::loadOgg(FILE* file, ALuint buffer)
         format = AL_FORMAT_STEREO16;
 
     // size = #samples * #channels * 2 (for 16 bit).
-    unsigned int data_size = ov_pcm_total(&ogg_file, -1) * info->channels * 2;
+    ogg_int64_t data_size = ov_pcm_total(&ogg_file, -1) * info->channels * 2;
     char* data = new char[data_size];
 
     while (size < data_size)

+ 1 - 2
gameplay/src/Effect.cpp

@@ -102,13 +102,12 @@ Effect* Effect::createFromSource(const char* vshSource, const char* fshSource, c
     return createFromSource(NULL, vshSource, NULL, fshSource, defines);
 }
 
-
 static void replaceDefines(const char* defines, std::string& out)
 {
     if (defines && strlen(defines) != 0)
     {
         out = defines;
-        unsigned int pos;
+        size_t pos;
         out.insert(0, "#define ");
         while ((pos = out.find(';')) != std::string::npos)
         {

+ 1 - 1
gameplay/src/PlatformAndroid.cpp

@@ -1040,7 +1040,7 @@ float Platform::getGamepadJoystickAxisX(unsigned int gamepadHandle, unsigned int
     return 0.0f;
 }
 
-float Platform::getGamepadJoystickAxisX(unsigned int gamepadHandle, unsigned int joystickIndex)
+float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
 {
     return 0.0f;
 }

+ 136 - 114
gameplay/src/PlatformLinux.cpp

@@ -12,6 +12,7 @@
 #include <X11/keysym.h>
 #include <sys/time.h>
 #include <GL/glxew.h>
+#include <poll.h>
 
 #define TOUCH_COUNT_MAX     4
 
@@ -353,7 +354,7 @@ static Keyboard::Key getKey(KeySym sym)
     }
 }
 
-extern void printError(const char* format, ...)
+extern void print(const char* format, ...)
 {
     GP_ASSERT(format);
     va_list argptr;
@@ -381,7 +382,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
 
     int configAttribs[] = 
     { 
-        GLX_RENDER_TYPE,    GLX_RGBA_BIT,GLX_RGBA, 
+        GLX_RENDER_TYPE,    GLX_RGBA_BIT,
         GLX_DRAWABLE_TYPE,  GLX_WINDOW_BIT,
         GLX_X_RENDERABLE,   True,
         GLX_DEPTH_SIZE,     24, 
@@ -425,7 +426,12 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     GLXFBConfig* configs;
     int configCount = 0;
     configs = glXChooseFBConfig(__display, DefaultScreen(__display), configAttribs, &configCount);
-    
+    if( configCount == 0 || configs == 0 )	
+    {	
+        perror( "glXChooseFBConfig" );
+        return NULL;	
+    }
+
     // Create the windows
     XVisualInfo* visualInfo;
     visualInfo = glXGetVisualFromFBConfig(__display, configs[0]);
@@ -497,15 +503,26 @@ double timespec2millis(struct timespec *a)
     return (1000.0 * a->tv_sec) + (0.000001 * a->tv_nsec);
 }
 
+void updateWindowSize()	
+{	
+    GP_ASSERT(__display);	
+    GP_ASSERT(__window);
+    XWindowAttributes windowAttrs;	
+    XGetWindowAttributes(__display, __window, &windowAttrs);  	
+    __windowSize[0] = windowAttrs.width;	
+    __windowSize[1] = windowAttrs.height;	
+}
+
 int Platform::enterMessagePump()
 {
     GP_ASSERT(_game);
+
+    updateWindowSize();
  
     static const float ACCELEROMETER_X_FACTOR = 90.0f / __windowSize[0];
     static const float ACCELEROMETER_Y_FACTOR = 90.0f / __windowSize[1];
     static int lx = 0;
     static int ly = 0;
-    static bool suspended = false;
     static bool shiftDown = false;
     static bool capsOn = false;
     static XEvent evt;
@@ -517,137 +534,143 @@ int Platform::enterMessagePump()
 
     // Run the game.
     _game->run();
+
+    // Setup select for message handling (to allow non-blocking)	
+    int x11_fd = ConnectionNumber(__display);
+	
+    pollfd xpolls[1];
+    xpolls[0].fd = x11_fd;
+    xpolls[0].events = POLLIN|POLLPRI;
   
     // Message loop.
     while (true)
     {
-       XNextEvent(__display, &evt);
-    
-        switch (evt.type) 
-        {
-        case DestroyNotify :
-            {
-                cleanupX11();
-                exit(0);
-            }
-            break;
+        int ret = poll( xpolls, 1, 16 );
 
-        case Expose: 
+        // handle all pending events in one block 
+        while (ret && XPending(__display))
+        {
+           XNextEvent(__display, &evt);
+        
+            switch (evt.type) 
             {
-                XWindowAttributes windowAttrs;
-                XGetWindowAttributes(__display, __window, &windowAttrs);  
-                __windowSize[0] = windowAttrs.width;
-                __windowSize[1] = windowAttrs.height;
-                if (!suspended)
+            case DestroyNotify :
                 {
-                    _game->frame();
-                    glXSwapBuffers(__display, __window);
+                    cleanupX11();
+                    exit(0);
                 }
-            }
-            break;
-
-        case KeyPress:
-            {
-                KeySym sym = XLookupKeysym(&evt.xkey, 0);
-                Keyboard::Key key = getKey(sym);
-                gameplay::Platform::keyEventInternal(gameplay::Keyboard::KEY_PRESS, key);
-            }
-            break;
+                break;
 
-        case KeyRelease:
-            {
-                KeySym sym = XLookupKeysym(&evt.xkey, 0);
-                Keyboard::Key key = getKey(sym);
-                gameplay::Platform::keyEventInternal(gameplay::Keyboard::KEY_PRESS, key);
-            }
-            break;
-
-        case ButtonPress:
-            {
-                gameplay::Mouse::MouseEvent mouseEvt;
-                switch(evt.xbutton.button)
+            case Expose: 
                 {
-                    case 1:
-                        mouseEvt = gameplay::Mouse::MOUSE_PRESS_LEFT_BUTTON;
-                        break;
-                    case 2:
-                        mouseEvt = gameplay::Mouse::MOUSE_PRESS_MIDDLE_BUTTON;
-                        break;
-                    case 3:
-                        mouseEvt = gameplay::Mouse::MOUSE_PRESS_RIGHT_BUTTON;
-                        break;
-                    case 4:
-                    case 5:
-                        gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL, 
-                                                               evt.xbutton.x, evt.xbutton.y, 
-                                                               evt.xbutton.button == Button4 ? 1 : -1);
-                        break;
-                    default:
-                        break;
+                    updateWindowSize();
                 }
-                if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0))
+                break;
+
+            case KeyPress:
                 {
-                    gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_PRESS, evt.xbutton.x, evt.xbutton.y, 0);
+                    KeySym sym = XLookupKeysym(&evt.xkey, 0);
+                    Keyboard::Key key = getKey(sym);
+                    gameplay::Platform::keyEventInternal(gameplay::Keyboard::KEY_PRESS, key);
                 }
-            }
-            break;
+                break;
 
-        case ButtonRelease:
-            {
-                gameplay::Mouse::MouseEvent mouseEvt;
-                switch(evt.xbutton.button)
+            case KeyRelease:
                 {
-                    case 1:
-                        mouseEvt = gameplay::Mouse::MOUSE_RELEASE_LEFT_BUTTON;
-                        break;
-                    case 2:
-                        mouseEvt = gameplay::Mouse::MOUSE_RELEASE_MIDDLE_BUTTON;
-                        break;
-                    case 3:
-                        mouseEvt = gameplay::Mouse::MOUSE_RELEASE_RIGHT_BUTTON;
-                        break;
-                    default:
-                        break;
+                    KeySym sym = XLookupKeysym(&evt.xkey, 0);
+                    Keyboard::Key key = getKey(sym);
+                    gameplay::Platform::keyEventInternal(gameplay::Keyboard::KEY_PRESS, key);
                 }
-                if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0))
+                break;
+
+            case ButtonPress:
                 {
-                    gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_RELEASE, evt.xbutton.x, evt.xbutton.y, 0);
+                    gameplay::Mouse::MouseEvent mouseEvt;
+                    switch(evt.xbutton.button)
+                    {
+                        case 1:
+                            mouseEvt = gameplay::Mouse::MOUSE_PRESS_LEFT_BUTTON;
+                            break;
+                        case 2:
+                            mouseEvt = gameplay::Mouse::MOUSE_PRESS_MIDDLE_BUTTON;
+                            break;
+                        case 3:
+                            mouseEvt = gameplay::Mouse::MOUSE_PRESS_RIGHT_BUTTON;
+                            break;
+                        case 4:
+                        case 5:
+                            gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_WHEEL, 
+                                                                   evt.xbutton.x, evt.xbutton.y, 
+                                                                   evt.xbutton.button == Button4 ? 1 : -1);
+                            break;
+                        default:
+                            break;
+                    }
+                    if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0))
+                    {
+                        gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_PRESS, evt.xbutton.x, evt.xbutton.y, 0);
+                    }
                 }
-            }
-            break;
-    
-        case MotionNotify:
-            {
-                if (!gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_MOVE, evt.xmotion.x, evt.xmotion.y, 0))
+                break;
+
+            case ButtonRelease:
                 {
-                    if (evt.xbutton.button == 1)
+                    gameplay::Mouse::MouseEvent mouseEvt;
+                    switch(evt.xbutton.button)
                     {
-                        gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_MOVE, evt.xmotion.x, evt.xmotion.y, 0);
-                        return 0;
+                        case 1:
+                            mouseEvt = gameplay::Mouse::MOUSE_RELEASE_LEFT_BUTTON;
+                            break;
+                        case 2:
+                            mouseEvt = gameplay::Mouse::MOUSE_RELEASE_MIDDLE_BUTTON;
+                            break;
+                        case 3:
+                            mouseEvt = gameplay::Mouse::MOUSE_RELEASE_RIGHT_BUTTON;
+                            break;
+                        default:
+                            break;
                     }
-                    else if (evt.xbutton.button == 3)
+                    if (!gameplay::Platform::mouseEventInternal(mouseEvt, evt.xbutton.x, evt.xbutton.y, 0))
                     {
-                        // Update the pitch and roll by adding the scaled deltas.
-                        __roll += (float)(evt.xbutton.x - lx) * ACCELEROMETER_X_FACTOR;
-                        __pitch += -(float)(evt.xbutton.y - ly) * ACCELEROMETER_Y_FACTOR;
-
-                        // Clamp the values to the valid range.
-                        __roll = max(min(__roll, 90.0f), -90.0f);
-                        __pitch = max(min(__pitch, 90.0f), -90.0f);
-
-                        // Update the last X/Y values.
-                        lx = evt.xbutton.x;
-                        ly = evt.xbutton.y;
+                        gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_RELEASE, evt.xbutton.x, evt.xbutton.y, 0);
                     }
                 }
-            }
-            break;
+                break;
         
-        default:
-            break;
+            case MotionNotify:
+                {
+                    if (!gameplay::Platform::mouseEventInternal(gameplay::Mouse::MOUSE_MOVE, evt.xmotion.x, evt.xmotion.y, 0))
+                    {
+                        if (evt.xmotion.state & Button1Mask)
+                        {
+                            gameplay::Platform::touchEventInternal(gameplay::Touch::TOUCH_MOVE, evt.xmotion.x, evt.xmotion.y, 0);
+                            return 0;
+                        }
+                        else if (evt.xmotion.state & Button3Mask)
+                        {
+                            // Update the pitch and roll by adding the scaled deltas.
+                            __roll += (float)(evt.xbutton.x - lx) * ACCELEROMETER_X_FACTOR;
+                            __pitch += -(float)(evt.xbutton.y - ly) * ACCELEROMETER_Y_FACTOR;
+
+                            // Clamp the values to the valid range.
+                            __roll = max(min(__roll, 90.0f), -90.0f);
+                            __pitch = max(min(__pitch, 90.0f), -90.0f);
+
+                            // Update the last X/Y values.
+                            lx = evt.xbutton.x;
+                            ly = evt.xbutton.y;
+                        }
+                    }
+                }
+                break;
+            
+            default:
+                break;
+            }
         }
 
-        sleep(1);
+        _game->frame();
+        glXSwapBuffers(__display, __window);
     }
 
     cleanupX11();
@@ -804,12 +827,12 @@ void Platform::sleep(long ms)
     usleep(ms * 1000);
 }
 
-unsigned int Platform::getGamepadCount()
+unsigned int Platform::getGamepadsConnected()
 {
     return 0;
 }
 
-bool Platform::isGamepadAttached(unsigned int gamepadHandle)
+bool Platform::isGamepadConnected(unsigned int gamepadHandle)
 {
     return false;
 }
@@ -839,19 +862,18 @@ bool Platform::isGamepadJoystickActive(unsigned int gamepadHandle, unsigned int
     return false;
 }
 
-float Platform::getGamepadJoystickXAxis(unsigned int gamepadHandle, unsigned int joystickIndex)
+float Platform::getGamepadJoystickAxisX(unsigned int gamepadHandle, unsigned int joystickIndex)
 {
     return 0.0f;
 }
 
-float Platform::getGamepadJoystickYAxis(unsigned int gamepadHandle, unsigned int joystickIndex)
+float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
 {
     return 0.0f;
 }
 
-void Platform::getGamepadJoystickValue(unsigned int gamepadHandle, unsigned int joystickIndex, Vector2* value)
+void Platform::getGamepadJoystickAxisValues(unsigned int gamepadHandle, unsigned int joystickIndex, Vector2* outValue)
 {
-
 }
 
 unsigned int Platform::getGamepadTriggerCount(unsigned int gamepadHandle)

+ 1 - 1
gameplay/src/PlatformMacOSX.mm

@@ -914,7 +914,7 @@ bool Platform::isGamepadJoystickActive(unsigned int gamepadHandle, unsigned int
     return false;
 }
 
-float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
+float Platform::getGamepadJoystickAxisX(unsigned int gamepadHandle, unsigned int joystickIndex)
 {
     return 0.0f;
 }

+ 71 - 71
gameplay/src/PlatformiOS.mm

@@ -953,18 +953,18 @@ void Platform::displayKeyboard(bool display)
 void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
 {
     if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
+    {
+        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
+        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
     }
 }
     
 void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
 {
     if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
+    {
+        Game::getInstance()->keyEvent(evt, key);
+        Game::getInstance()->getScriptController()->keyEvent(evt, key);
     }
 }
 
@@ -973,14 +973,14 @@ bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheel
     if (Form::mouseEventInternal(evt, x, y, wheelDelta))
     {
         return true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else
-    {
-        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
+    }
+    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
+    {
+        return true;
+    }
+    else
+    {
+        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
     }
 }    
 
@@ -989,63 +989,63 @@ void Platform::sleep(long ms)
     usleep(ms * 1000);
 }
 
-unsigned int Platform::getGamepadsConnected()
-{
-    return 0;
-}
-
-bool Platform::isGamepadConnected(unsigned int gamepadHandle)
-{
-    return false;
-}
-
-const char* Platform::getGamepadId(unsigned int gamepadHandle)
-{
-    return NULL;
-}
-
-unsigned int Platform::getGamepadButtonCount(unsigned int gamepadHandle)
-{
-    return 0;
-}
-
-bool Platform::getGamepadButtonState(unsigned int gamepadHandle, unsigned int buttonIndex)
-{
-    return false;
-}
-
-unsigned int Platform::getGamepadJoystickCount(unsigned int gamepadHandle)
-{
-    return 0;
-}
-
-bool Platform::isGamepadJoystickActive(unsigned int gamepadHandle, unsigned int joystickIndex)
-{
-    return false;
-}
-
-float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
-{
-    return 0.0f;
-}
-
-float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
-{
-    return 0.0f;
-}
-
-void Platform::getGamepadJoystickAxisValues(unsigned int gamepadHandle, unsigned int joystickIndex, Vector2* outValue)
-{
-}
-
-unsigned int Platform::getGamepadTriggerCount(unsigned int gamepadHandle)
-{
-    return 0;
-}
-
-float Platform::getGamepadTriggerValue(unsigned int gamepadHandle, unsigned int triggerIndex)
-{
-    return 0.0f;
+unsigned int Platform::getGamepadsConnected()
+{
+    return 0;
+}
+
+bool Platform::isGamepadConnected(unsigned int gamepadHandle)
+{
+    return false;
+}
+
+const char* Platform::getGamepadId(unsigned int gamepadHandle)
+{
+    return NULL;
+}
+
+unsigned int Platform::getGamepadButtonCount(unsigned int gamepadHandle)
+{
+    return 0;
+}
+
+bool Platform::getGamepadButtonState(unsigned int gamepadHandle, unsigned int buttonIndex)
+{
+    return false;
+}
+
+unsigned int Platform::getGamepadJoystickCount(unsigned int gamepadHandle)
+{
+    return 0;
+}
+
+bool Platform::isGamepadJoystickActive(unsigned int gamepadHandle, unsigned int joystickIndex)
+{
+    return false;
+}
+
+float Platform::getGamepadJoystickAxisX(unsigned int gamepadHandle, unsigned int joystickIndex)
+{
+    return 0.0f;
+}
+
+float Platform::getGamepadJoystickAxisY(unsigned int gamepadHandle, unsigned int joystickIndex)
+{
+    return 0.0f;
+}
+
+void Platform::getGamepadJoystickAxisValues(unsigned int gamepadHandle, unsigned int joystickIndex, Vector2* outValue)
+{
+}
+
+unsigned int Platform::getGamepadTriggerCount(unsigned int gamepadHandle)
+{
+    return 0;
+}
+
+float Platform::getGamepadTriggerValue(unsigned int gamepadHandle, unsigned int triggerIndex)
+{
+    return 0.0f;
 }
     
 }

+ 1 - 1
gameplay/src/Properties.cpp

@@ -976,7 +976,7 @@ void calculateNamespacePath(const std::string& urlString, std::string& fileStrin
 {
     // If the url references a specific namespace within the file,
     // calculate the full namespace path to the final namespace.
-    unsigned int loc = urlString.rfind("#");
+    size_t loc = urlString.rfind("#");
     if (loc != urlString.npos)
     {
         fileString = urlString.substr(0, loc);