먼저 GLView.java 코드 올릴게요
package com.ndk_opengl;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.opengl.GLSurfaceView.Renderer;
import android.view.MotionEvent;
public class GLView extends GLSurfaceView implements Renderer {
private static native void nativeCreated();
private static native void nativeChanged(int w, int h);
private static native void nativeUpdateGame();
private static native void nativeOnTouchEvent(int x, int y, int touchFlag);
public GLView(Context context) {
super(context);
this.setRenderer(this);
this.requestFocus();
this.setRenderMode(RENDERMODE_WHEN_DIRTY);
this.setFocusableInTouchMode(true);
}
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
nativeCreated();
}
@Override
public void onSurfaceChanged(GL10 gl, int w, int h) {
nativeChanged(w, h);
}
@Override
public void onDrawFrame(GL10 gl) {
nativeUpdateGame();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
nativeOnTouchEvent((int)event.getX(), (int)event.getY(), event.getAction());
return true;
}
여기서 jni를 이용하여 c파일을 만들고싶은데
Error:cannot access android.opengl.GLSurfaceView
class file for android.opengl.GLSurfaceView not found라고 뜨네요
프로젝트폴더\bin\classes>javah ../../jni/jni.c com.ndk_opengl.GLView 이렇게 해도 뜨고 인터넷에 나와있는
프로젝트폴더\bin>javah -classpath ./classes/ com.ndk_opengl.GLView 이래도 뜨고 .. 어떡하면 GLSrufaceView 를 할수있죠 ? Activity 할때도 마찬가지에용.. 알려주세요 개발자님들.