OSDN Git Service

more changes to robovm config
authorbadlogic <badlogicgames@gmail.com>
Tue, 17 Sep 2013 18:05:35 +0000 (20:05 +0200)
committerbadlogic <badlogicgames@gmail.com>
Tue, 17 Sep 2013 18:05:35 +0000 (20:05 +0200)
backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java
backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java
backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
backends/gdx-backend-robovm/todos.txt

index 6708327..4dbfa71 100644 (file)
@@ -117,7 +117,7 @@ public class IOSApplication implements Application {
                
                // setup libgdx
                this.input = new IOSInput(this);
-               this.graphics = new IOSGraphics(getBounds(null), this, input, gl20);
+               this.graphics = new IOSGraphics(getBounds(null), this, config, input, gl20);
                this.files = new IOSFiles();
                this.audio = new IOSAudio();
                this.net = new IOSNet(this);
index 9425ce2..6770348 100644 (file)
@@ -26,6 +26,9 @@ public class IOSApplicationConfiguration {
        /** the multisample format, None is default **/
        public GLKViewDrawableMultisample multisample = GLKViewDrawableMultisample.None;
        
+       /** number of frames per second, 60 is default **/
+       public int preferredFramesPerSecond = 60;
+       
        /**
         * Scale factor to use on large screens  with retina display, i.e. iPad 3+ (has no effect on non-retina screens).
         * <ul>
index 2f9f8e8..339a368 100644 (file)
@@ -115,11 +115,13 @@ public class IOSGraphics extends NSObject implements Graphics, GLKViewDelegate,
        volatile boolean paused;
        boolean wasPaused;
 
+       IOSApplicationConfiguration config;
        EAGLContext context;
        GLKView view;
        IOSUIViewController viewController;
 
        public IOSGraphics(CGSize bounds, IOSApplication app, IOSApplicationConfiguration config, IOSInput input, GL20 gl20) {
+               this.config = config;
                // setup view and OpenGL
                width = (int) bounds.width();
                height = (int) bounds.height();
@@ -168,7 +170,7 @@ public class IOSGraphics extends NSObject implements Graphics, GLKViewDelegate,
                viewController = new IOSUIViewController(app, this);
                viewController.setView(view);
                viewController.setDelegate(this);
-               viewController.setPreferredFramesPerSecond(60);
+               viewController.setPreferredFramesPerSecond(config.preferredFramesPerSecond);
 
                this.app = app;
                this.input = input;
@@ -407,7 +409,7 @@ public class IOSGraphics extends NSObject implements Graphics, GLKViewDelegate,
 
        @Override
        public DisplayMode getDesktopDisplayMode() {
-               return new IOSDisplayMode(getWidth(), getHeight(), 60, bufferFormat.r + bufferFormat.g + bufferFormat.b + bufferFormat.a);
+               return new IOSDisplayMode(getWidth(), getHeight(), config.preferredFramesPerSecond, bufferFormat.r + bufferFormat.g + bufferFormat.b + bufferFormat.a);
        }
 
        private class IOSDisplayMode extends DisplayMode {
index 05c50ad..093f368 100644 (file)
@@ -7,7 +7,7 @@ General
        - getClipboard() not implemented properly, should at least support strings
        - 
 - IOSApplicationConfiguration
-       - add compass, FBO bit depth, stencil bit depth
+       - add compass
        - add useGL2, requires implementation of GL10/GL11 for ios, and fixes in IOSGraphics
 - IOSAudo
        - newAudioDevice(), new AudioRecorder() not implemented
@@ -18,7 +18,6 @@ General
        - need to store current device orientation for Input#getOrienation and consorts
        - GLKView, is this supported from IOS 5+ onwards? i guess we can make that our minimum iOS version
        - Add support for GL10/GL11     
-       - setPreferredFramesPerSecond is hardcoded to 60, should make that configurable i guess 
        - check if apps supporting both portrait and landscape work (resize, etc.) 
        - implement non-continuous rendering
 - IOSInput