OSDN Git Service

[fixed] TextButtonTest #buttons.
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 10 Jan 2012 01:00:56 +0000 (01:00 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 10 Jan 2012 01:00:56 +0000 (01:00 +0000)
tests/gdx-tests/src/com/badlogic/gdx/tests/TextButtonTest.java

index d91cf33..b3889bf 100644 (file)
@@ -21,6 +21,8 @@ import com.badlogic.gdx.graphics.GL10;
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;\r
 import com.badlogic.gdx.math.MathUtils;\r
 import com.badlogic.gdx.scenes.scene2d.Stage;\r
+import com.badlogic.gdx.scenes.scene2d.ui.Button;\r
+import com.badlogic.gdx.scenes.scene2d.ui.Label;\r
 import com.badlogic.gdx.scenes.scene2d.ui.Skin;\r
 import com.badlogic.gdx.scenes.scene2d.ui.TextButton;\r
 import com.badlogic.gdx.tests.utils.GdxTest;\r
@@ -31,9 +33,9 @@ public class TextButtonTest extends GdxTest {
        \r
        @Override\r
        public void create () {\r
-               stage = new Stage(0, 0, false, new SpriteBatch(10000));\r
+               stage = new Stage(0, 0, false, new SpriteBatch());\r
                Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"), Gdx.files.internal("data/uiskin.png"));\r
-               for (int i = 0; i < 10000; i++) {\r
+               for (int i = 0; i < 100; i++) {\r
                        TextButton t = new TextButton("Button"+i, skin);\r
                        t.x = MathUtils.random(0, Gdx.graphics.getWidth());\r
                        t.y = MathUtils.random(0, Gdx.graphics.getHeight());\r
@@ -50,7 +52,8 @@ public class TextButtonTest extends GdxTest {
                stage.draw();\r
                Gdx.app.log("X", "FPS: "+Gdx.graphics.getFramesPerSecond());\r
                Gdx.app.log("X", "GL20: "+Gdx.graphics.isGL20Available());\r
-               Gdx.app.log("X", "Batches: " + stage.getSpriteBatch().maxSpritesInBatch);\r
+               Gdx.app.log("X", "render calls: " + stage.getSpriteBatch().totalRenderCalls);\r
+               stage.getSpriteBatch().totalRenderCalls = 0;\r
        }\r
 \r
        @Override\r