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!
Does it by any chance has anything to do with ANativeWindow_acquire
in *android/native_window.h`?
Thanks!
ANativeWindow represents the producer end of an image queue.
The android_main function is the entry point to an android runtime environment, with the expected message loops set up, etc.
The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.
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'.
Here's an example of using EGL from command line:
http://jiggawatt.org/badc0de/android/index.html
However such process without 'legal' Android UI Activity is going to be killed by the system at any time for being considered as a background process. Also you wouldn't be able you use touchscreen or keyboard input, or any other stuff that require Context, like figuring out where the SD card is mounted, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With