lok*_*oki 5 java reflection android android-9.0-pie
此类是在Android下定义的:
public abstract class EGLObjectHandle {
private final long mHandle;
protected EGLObjectHandle(long handle) {
mHandle = handle;
}
public long getNativeHandle() {
return mHandle;
}
}
Run Code Online (Sandbox Code Playgroud)
并且
public class EGLContext extends EGLObjectHandle {
private EGLContext(long handle) {
super(handle);
}
}
Run Code Online (Sandbox Code Playgroud)
现在我的问题是我想用我的手柄创建一个EGLContext。这该怎么做?在我使用下面的功能之前,但它在PIE上不再起作用
private android.opengl.EGLContext createSharedEGLContextObj(long handle) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
Class<?> classType =Class.forName("android.opengl.EGLContext");
Class<?>[] types = new Class[] { long.class };
Constructor constructor=classType.getDeclaredConstructor(types);
constructor.setAccessible(true);
Object object=constructor.newInstance(handle);
return (android.opengl.EGLContext) object;
}
Run Code Online (Sandbox Code Playgroud)
我需要一个EGLContext因为我需要将其传递给需要EGLContext参数的过程,例如:createEgl14( android.opengl.EGLContext sharedContext)
| 归档时间: |
|
| 查看次数: |
202 次 |
| 最近记录: |