OSDN Git Service

fixed issue 1544, glGetActiveUniform/Attribute didn't work correctly in LWJGL backend
authorbadlogic <badlogicgames@gmail.com>
Fri, 5 Jul 2013 16:23:52 +0000 (18:23 +0200)
committerbadlogic <badlogicgames@gmail.com>
Fri, 5 Jul 2013 16:23:52 +0000 (18:23 +0200)
backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGL20.java
tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java

index 10935f2..0ac772d 100644 (file)
@@ -297,7 +297,8 @@ final class LwjglGL20 implements com.badlogic.gdx.graphics.GL20 {
                // FIXME this is less than ideal of course...\r
                IntBuffer typeTmp = BufferUtils.createIntBuffer(2);\r
                String name = GL20.glGetActiveAttrib(program, index, 256, typeTmp);\r
-               if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(0));\r
+               size.put(typeTmp.get(0));\r
+               if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(1));\r
                return name;\r
        }\r
 \r
@@ -305,6 +306,7 @@ final class LwjglGL20 implements com.badlogic.gdx.graphics.GL20 {
                // FIXME this is less than ideal of course...\r
                IntBuffer typeTmp = BufferUtils.createIntBuffer(2);\r
                String name = GL20.glGetActiveUniform(program, index, 256, typeTmp);\r
+               size.put(typeTmp.get(0));\r
                if (type instanceof IntBuffer) ((IntBuffer)type).put(typeTmp.get(0));\r
                return name;\r
        }\r
index fdb068d..5f086d5 100644 (file)
@@ -21,6 +21,7 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
 import com.badlogic.gdx.graphics.OrthographicCamera;\r
 import com.badlogic.gdx.math.Vector2;\r
 import com.badlogic.gdx.scenes.scene2d.Stage;\r
+import com.badlogic.gdx.tests.MeshShaderTest;\r
 import com.badlogic.gdx.tests.TimerTest;\r
 import com.badlogic.gdx.tests.g3d.Basic3DSceneTest;\r
 import com.badlogic.gdx.tests.g3d.Basic3DTest;\r
@@ -37,7 +38,7 @@ public class LwjglDebugStarter {
 //             new SharedLibraryLoader("../../extensions/gdx-controllers/gdx-controllers-desktop/libs/gdx-controllers-desktop-natives.jar").load("gdx-controllers-desktop");\r
 //             new SharedLibraryLoader("../../gdx/libs/gdx-natives.jar").load("gdx");\r
 \r
-               GdxTest test = new TimerTest();\r
+               GdxTest test = new MeshShaderTest();\r
                LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\r
                config.useGL20 = test.needsGL20();\r
                config.width = 480;\r