我怎样才能创建的Andr​​oid NDK新的NativeWindow?oid、Andr、NativeWindow、NDK

由网友(王者路开大奔你大哥)分享简介:我尝试了测试的libstdc ++演示,并很喜欢,我可以从控制台和所有不运行一个完全成熟的Andr​​oid应用程序启动它。我想创建一个OpenGL上下文,以便我能执行我的OpenGL ES 2.0应用程序在控制台上没有太多的烦心事。任何想法,我怎么能初始化EGL从一个NDK,应用程序,不使用本机的活动或任何东西,也就...

我尝试了测试的libstdc ++演示,并很喜欢,我可以从控制台和所有不运行一个完全成熟的Andr​​oid应用程序启动它。

我想创建一个OpenGL上下文,以便我能执行我的OpenGL ES 2.0应用程序在控制台上没有太多的烦心事。

任何想法,我怎么能初始化EGL从一个NDK,应用程序,不使用本机的活动或任何东西,也就是说,它甚至不是打包在一个.APKK文件,只是有一个主要方法是打包为一个可执行的Linux文件。

非常感谢!

更新

万一它是否有任何与 ANativeWindow_acquire 在*的Andr​​oid / native_window.h`?

谢谢!

解决方案

如果你看一下git的树木为Android里面,你会看到有一些创建本机窗口,在命令行中都推出了一些简单的测试应用程序。

点击这里查看

关于这些问题的一些上述由阿不思的意见,问题与翻盖链条是因为当前的驱动程序只能支持1翻转链系统,而这正在举行的SurfaceFlinger因为这是谁可以写实体本机窗口/帧缓冲。要解决这一点,你可以只需键入停止亚行外壳内停止Android的运行时引擎,然后重新运行你的应用程序。要获得Android的运行时引擎备份,做'开始'。

I tried the test-libstdc++ demo and liked that I can start it from the console and all without running a full-grown android application.

I'd like to create an opengl context so that I'd be able to execute my opengl es 2.0 app from within the console without too many bothering.

Any idea how could I initialize the EGL from within a NDK-app that doesn't use native activity or anything, i.e. it is not even packaged in a .APKK file, just has a main method is packed as an executable linux file.

Thanks a lot!

UPDATE

Does it by any chance has anything to do with ANativeWindow_acquire in *android/native_window.h`?

Thanks!

解决方案

If you look inside the git trees for Android, you will see that there are several simple test apps that create a native window and are launched from the command line.

click here to see the tests

Regarding the questions to some of the comments above by Albus, the issue with the flip chain is because your current driver can only support 1 flip chain in the system, and that's being held by SurfaceFlinger since that's the entity who can write to the native window/framebuffer. To work around this you can just stop the Android Run Time engine by typing 'stop' inside adb shell, then re-run your app. To get the Android Run time engine back up, do 'start'.

阅读全文

相关推荐

最新文章