OSDN Git Service

[fixed] TextureData issue, didn't set the texture's width and height. me stupid.
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 8 Feb 2011 19:55:08 +0000 (19:55 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 8 Feb 2011 19:55:08 +0000 (19:55 +0000)
gdx/src/com/badlogic/gdx/graphics/Texture.java
tests/gdx-tests-jogl/src/com/badlogic/gdx/tests/jogl/JoglDebugStarter.java

index 5397384..df806a6 100644 (file)
@@ -204,12 +204,14 @@ public class Texture {
                this.isManaged = true;\r
                this.isMipMap = false;\r
                this.textureData = data;\r
+               this.width = textureData.getWidth();\r
+               this.height = textureData.getHeight();\r
                this.file = null;\r
                glHandle = createGLHandle();\r
                Gdx.gl.glBindTexture(GL10.GL_TEXTURE_2D, glHandle);\r
                setFilter(minFilter, magFilter);\r
                setWrap(uWrap, vWrap);\r
-               textureData.load();     \r
+               textureData.load();                     \r
                managedTextures.add(this);\r
        }\r
        \r
index d84eb52..bff8a75 100644 (file)
@@ -18,6 +18,6 @@ import com.badlogic.gdx.backends.jogl.JoglApplication;
 public class JoglDebugStarter {\r
 \r
        public static void main (String[] argv) {\r
-               new JoglApplication(new com.badlogic.gdx.tests.RotationTest(), "Debug Test", 480, 320, false);\r
+               new JoglApplication(new com.badlogic.gdx.tests.TextureDataTest(), "Debug Test", 480, 320, false);\r
        }\r
 }\r