Hello! I have a problem
GL.java:
@Runtime(CRuntime.class)
public final class GL {
static {
NatJ.register();
}
public static native void glTexImage2D(
int target,
int level,
int internalFormat,
int width, int height,
int border,
int format,
int type,
byte data[]);
}
GL.cpp:
JNIEXPORT void JNICALL Java_delightex_opengl_GL_glTexImage2D(JNIEnv *env, jclass, jint target, jint level, jint internalFormat, jint width, jint height, jint border, jint format, jint type, jbyteArray data) {
if (data == NULL) {
glTexImage2D(target, level, internalFormat, width, height, border, format, type, data);
return;
}
void *dataPtr = env->GetPrimitiveArrayCritical(data, 0);
glTexImage2D(target, level, internalFormat, width, height, border, format, type, data);
env->ReleasePrimitiveArrayCritical(data, dataPtr, JNI_COMMIT);
}
And when I call glTexImage2D in my code then it lead to crash application with EXC_BAD_ACCESS. Actually in some cases it works well, in some failed. I see reason(EXC_BAD_ACCESS) when I start my project in xcode.
When I use gradle task or Intellij plugin app just silently crashes without logs.
So, How can I understand what’s wrong with my code?