J jtare Active Member Licensed User Longtime User Oct 24, 2017 #1 Im trying to get the max texture size that the device can handle and found this simple java code, but I don't know how to run it in B4A, does someone know how to translate it? JAVA code: Code: Copy IntBuffer buf = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, buf); int maxSize = buf.get(0); I copied this code from https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Textures Thanks
Im trying to get the max texture size that the device can handle and found this simple java code, but I don't know how to run it in B4A, does someone know how to translate it? JAVA code: Code: Copy IntBuffer buf = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, buf); int maxSize = buf.get(0); I copied this code from https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Textures Thanks
J jtare Active Member Licensed User Longtime User Oct 25, 2017 #2 SOLVED. Add this java code with the #if java Code: Copy #if java import java.lang.Integer; import com.badlogic.gdx.utils.BufferUtils; import java.nio.IntBuffer; import com.badlogic.gdx.Gdx; IntBuffer buf = BufferUtils.newIntBuffer(16); public IntBuffer getBuf(){ return buf; } public int getMaxSize(IntBuffer buff){ int maxSize = buff.get(0); return maxSize; } #End If On B4A ask for the max texture size using this code Code: Copy GL.glGetIntegerv(GL.GL10_MAX_TEXTURE_SIZE,nativeMe.RunMethod("getBuf",Null)) maxTexSize = nativeMe.RunMethod("getMaxSize",Array (nativeMe.RunMethod("getBuf",Null))) Log("MaxtexSIze = "&maxTexSize) Upvote 0
SOLVED. Add this java code with the #if java Code: Copy #if java import java.lang.Integer; import com.badlogic.gdx.utils.BufferUtils; import java.nio.IntBuffer; import com.badlogic.gdx.Gdx; IntBuffer buf = BufferUtils.newIntBuffer(16); public IntBuffer getBuf(){ return buf; } public int getMaxSize(IntBuffer buff){ int maxSize = buff.get(0); return maxSize; } #End If On B4A ask for the max texture size using this code Code: Copy GL.glGetIntegerv(GL.GL10_MAX_TEXTURE_SIZE,nativeMe.RunMethod("getBuf",Null)) maxTexSize = nativeMe.RunMethod("getMaxSize",Array (nativeMe.RunMethod("getBuf",Null))) Log("MaxtexSIze = "&maxTexSize)