Gdx.app.log("ShaderTest", shader.getLog());
Gdx.app.exit();
}
-
- mesh = new Mesh(true, 4, 6, VertexAttribute.Position(), VertexAttribute.ColorUnpacked(), VertexAttribute.TexCoords(0));
+
+ mesh = new Mesh(Mesh.VertexDataType.VertexArray, true, 4, 6, VertexAttribute.Position(), VertexAttribute.ColorUnpacked(), VertexAttribute.TexCoords(0));
mesh.setVertices(new float[] {-0.5f, -0.5f, 0, 1, 1, 1, 1, 0, 1,
0.5f, -0.5f, 0, 1, 1, 1, 1, 1, 1,
0.5f, 0.5f, 0, 1, 1, 1, 1, 1, 0,
#include <iosgles20.h>\r
#include <OpenGLES/ES2/gl.h>\r
#include <OpenGLES/ES2/glext.h>\r
+#include <stdio.h>\r
\r
static jclass bufferClass;\r
static jclass byteBufferClass;\r
return 0;\r
}\r
\r
+inline jint getBufferPosition(JNIEnv *env, jobject buffer)\r
+{\r
+ jint ret = env->CallIntMethodA(buffer, positionID, 0);\r
+ return ret;\r
+}\r
+\r
static void *\r
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {\r
if (!buffer) {\r
}\r
void* buf = _env->GetDirectBufferAddress(buffer);\r
if (buf) {\r
- jint position = _env->CallIntMethod(bufferClass, positionID, buffer);\r
+ jint position = getBufferPosition(_env, buffer);\r
jint elementSizeShift = getElementSizeShift(_env, buffer);\r
buf = ((char*) buf) + (position << elementSizeShift);\r
} else {\r