Comments (8)
Are you aware of something in particular that requires Gradle?
Building the APK. Maybe it's possible to make an APK without gradle, but I do not know.
I think the question is: can it run as a plain executable and not an APK? I have no idea.
If you're trying to automate a test process via the command line (build, upload to device, and execute), yes, this is possible via gradle and the adb tools.
from glfm.
GLFM for Android doesn't require developers to write any Java code, although AFAIK you'll need to build GLFM Android apps with the gradle toolchain.
Does that answer your question?
from glfm.
I'm not sure 😄
I'll try to clarify.
The usual simple "hello world" console app:
#include <stdio.h>
int main(int arg, char **argv)
{
printf ("HELLO WORLD\n");
return 0;
}
can be compiled via the NDK and run on an Android device in /data/local/tmp
using adb
without the need for gradle or Java. (This is very convenient for OpenGL ES C++ unit testing directly from CMake, for example.) I was curious if the NDK provided enough hooks to create an OpenGL context for rendering entirely from native code. (I don't know enough about Android applications to know if this is possible or not.)
although AFAIK you'll need to build GLFM Android apps with the gradle toolchain
Are you aware of something in particular that requires Gradle?
I can try it out.
Thanks!
from glfm.
Follow up: http://stackoverflow.com/a/39820460
from glfm.
Building the APK. Maybe it's possible to make an APK without gradle, but I do not know.
I'm able to build and launch your Android sample with the help of the CMake android_create_apk script in the Hunter package manager (originally from Pixellight):
https://github.com/headupinclouds/glfm/blob/hunter/example/CMakeLists.txt#L43-L71
If you have any interest in this, I can make this optional, add documentation, and submit a PR.
FWIW, I'm interested in using this to automate OpenGL ES 2.0 shader testing via GTest.
I think the question is: can it run as a plain executable and not an APK? I have no idea.
For the GTest use case, I believe the main gotcha will be differences between APK and standard int main() {}
return codes. I will take a look and can share what I find.
I'll go ahead and close this. Thanks.
from glfm.
Thanks for pointing out Hunter. I tried the branch you created, but could not create a build (errors involving the toolchain). Perhaps I can take a look later, but it's not a priority right now.
from glfm.
Perhaps I can take a look later, but it's not a priority right now.
Sure, here is the toolchain I tested:
$ git branch -a | grep -e "*"
* hunter
$ git status
On branch hunter
Your branch is up-to-date with 'headupinclouds/hunter'.
nothing to commit, working tree clean
$ 2>/dev/null polly.py --toolchain android-ndk-r10e-api-19-armeabi-v7a-neon --fwd GLFM_BUILD_EXAMPLE=ON --verbose --clear | tail -10
Log saved: /Users/dhirvonen/devel/glfm/_logs/polly/android-ndk-r10e-api-19-armeabi-v7a-neon/log.txt
-
Generate: 0:00:05.344082s
Build: 0:00:01.735071s
-
Total: 0:00:07.079477s
-
SUCCESS
Install APK vis adb or use Makefile launch target:
(cd _builds/android-ndk-r10e-api-19-armeabi-v7a-neon/ && make launch-GlfmExample | tail -4)
Stopping: com.example.glfmexample
Starting: Intent { cmp=com.example.glfmexample/.LoadLibraries VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }
[100%] Built target launch-GlfmExample
/usr/local/Cellar/cmake/HEAD-f1b9fe5/bin/cmake -E cmake_progress_start /Users/dhirvonen/devel/glfm/_builds/android-ndk-r10e-api-19-armeabi-v7a-neon/CMakeFiles 0
This launches the app with the rainbow triangle.
glfm
is very convenient. I will probably add this package to hunter in the near future and can run through more android toolchains in CI tests.
FWIW, and in case anyone else stumbles onto this, apparently you can perform off screen rendering in Android with a standard int main(int argc, char **argv){}
application. glfm
was very helpful for sorting through the details. Android simply requires eglCreatePbufferSurface
as mentioned in this post:
https://mkonrad.net/2014/12/08/android-off-screen-rendering-using-egl-pixelbuffers.html
For iOS you can create your main()
in an objective-c++ file (*.mm) and create a context directly (the iOS CMake add_executable
default *.app will work):
EAGLContext egl = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
[EAGLContext setCurrentContext:egl];
// do your rendering
from glfm.
FYI: https://github.com/ruslo/hunter/issues/808
Thanks!
from glfm.
Related Issues (20)
- Readme improvement suggestions HOT 1
- Android: Fix issue with chrome insets when rotating
- iOS: Add mouse hover support (iPadOS 13.4)
- Using glfm on Android with AIDE app HOT 1
- Keyboard Input HOT 2
- iOS: Add support for GCKeyboard on iOS 14 HOT 1
- Web: Add support for sensors (via Emscripten)
- Build the GLFM examples with Android Studio 4 HOT 1
- how about MacOS HOT 5
- iOS: Consider macOS Catalyst support
- Glfm
- Support something like UIImpactFeedbackGenerator (Device Vibrations) HOT 4
- Context/Edit Menu Support HOT 2
- Dotnet 6.0 ( wasm tool ) glfm on Webassembly
- Leave app? HOT 6
- Background flickers first few moments of the app HOT 1
- Add Support For Visual Studio
- GLFMDepthFormat24 is a confusing name for Metal HOT 1
- sorry...
- Targeting API 21 on emulator crashes in glfm__getSystemWindowInsets(). HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glfm.