People,
In my Android Java code, I have an ad like this:
public class SurfacePanelNative extends SurfaceView implements SurfaceHolder.Callback { ... private static native void native_render(); }
In my native code, I have a function declared as:
void native_render(JNIEnv *env, jobject javaSurface) { ANativeWindow* window = ANativeWindow_fromSurface(env, javaSurface); ... }
After looking at a few examples on the network, it seems that the function should be declared as:
void native_render(JNIEnv *env, jclass clazz) { ... }
I am wondering which declaration is correct.
I think the first one is correct. Otherwise, I do not have enough information to get javaSurface.
I would appreciate it if someone could shed light on this.
Thank you in advance for your help.
Yours faithfully,
Peter
Peter source share