【发布时间】:2015-08-31 02:10:22
【问题描述】:
我想使用 Native Window,所以我试图调用 ANativeWindow_fromSurface,但它需要一个用于表面的 jobject。我假设最好的方法是在调用 onSurfaceCreated 时传递它,即:
public class RendererWrapper implements Renderer {
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
// (Some sort of code that would create a surface object)
//This is a native function that will use ANativeWindow_fromSurface
cOnSurfaceCreated(surface);
}
但我不知道我应该使用什么特定对象,也不知道如何访问它。
编辑:在本例中,我正在尝试执行类似于 NativeWindow API 的操作:https://vec.io/posts/how-to-render-image-buffer-in-android-ndk-native-code,这样我就可以从原生 c 代码直接写入屏幕。
【问题讨论】:
标签: android android-ndk