T
Termux6mo ago
lea

OpenGLES?

Is it possible to access the Android OpenGLES library from Termux? I'd like to build Android apps from within Termux, but this is the only thing stopping me.
27 Replies
RandomGuy
RandomGuy5mo ago
If you look at $PREFIX/include, there's "important" directory, which EGL/, GLES/, GLES2/ and GLES3/ (i guess it's from package mesa or opengl?), which afaik, is C/C++ OpenGL ES Header located in those Dirs, but based on your Question (which i guess you want build .apk file), you have to use Android NDK + Android SDK to do that, with At least some C/C++ Skill, and obviously Kotlin/Java skill to make the App.
FZXO
FZXO5mo ago
Yes termux-gui
FZXO
FZXO5mo ago
GitHub
GitHub - termux/termux-gui: A plugin for Termux to use native Andro...
A plugin for Termux to use native Android GUI components from CLI applications. - termux/termux-gui
lea
leaOP5mo ago
I can make the APKs, I just need OpenGL(ES). I looked, but it doesn't seem like installing the toolchain gives me those headers or libraries. Interesting, I'll check it out
owokitty
owokitty4mo ago
if you are trying to build an actual APK and then copy it to /storage/emulated/0/ and install it using something like
lea
leaOP4mo ago
Yea I can build the apk I literally just need OpenGLES That is the last thing required
owokitty
owokitty4mo ago
gradle assembleDebug
cp app/build/output/debug/app-debug.apk /storage/emulated/0/
gradle assembleDebug
cp app/build/output/debug/app-debug.apk /storage/emulated/0/
then i know how to do what you want but the hard parts are just:
lea
leaOP4mo ago
I'm using just C and make, no gradle I need the core libGLES2 library and GLES headers
owokitty
owokitty4mo ago
- it's different for every different app. since your app is in C with make it's different. and one of my apps is the same way, C with make, but every app is a little bit different so even my app is different from your app, probably - the .so file you need is preinstalled and available. it is at /system/lib64/libGLESv2.so and its SONAME (internal data) is "libGLESv2.so" - the headers you want are in the package that comes from pkg install libglvnd-dev and they are in $PREFIX/include/GLES2/ folder after you install it - however, one tip i have for you is DO NOT install the libglvnd package. ONLY libglvnd-dev package. otherwise something really annoying will happen that's tedious to work around. - if you already have the libglvnd package installed, try to uninstall it. if it says that removing it will remove something else you need, then tell me and I'll tell you what you have to do, which is a tedious workaround. does this help you? if you want to, if you send me your code , i might be able to make a script that compiles your app for you
lea
leaOP4mo ago
I already have the Makefile for my app I believe clang is for android 24, so as long as I target that, I should be good. This should be all I need
owokitty
owokitty4mo ago
yes also you don't need to add --target to clang just run clang and it will automatically compile for your device
lea
leaOP4mo ago
I know
owokitty
owokitty4mo ago
but if you ever need to send your APK to someone else, you have to set up something complicated (multi native architecture apk) otherwise there will be an error for only some people (people who have 32 bit and people who have android-x86)
lea
leaOP4mo ago
I'm aware
owokitty
owokitty4mo ago
and i know how to do that too but theres a lot of ways to do it and the last person i told how, unfortunately i made a whole solution specifically for their app but they gave up and decided to not support anything except 64 bit arm
lea
leaOP4mo ago
All I should need is ARM64 since I have no need to put in on anything else, but my stuff will have the option to do so if needed I can build a new clang toolchain with Cosmopolitan libc and then put it on my Termux install, which will simplify things a ton by allowing me to have a portable NDK setup Which would also allow multi arch compilation from my ARM64 device I'll actually do that later, but for now, this should be all I need
owokitty
owokitty4mo ago
i feel like i heard a rumor or something that if you use cosmopolitan libc it's not allowed on google play or something like that but that might not be important for you especially if you dont use google play. also i dont know the specifics
lea
leaOP4mo ago
I don't plan on using Cosmopolitan for the actual app Just the toolchain
owokitty
owokitty4mo ago
oh ok
lea
leaOP4mo ago
(Might mess around with Cosmopolitan apps though) That aside Ty sm
owokitty
owokitty4mo ago
i see someone else kind of already said what i said but you said it still didn't work, what error did you see?
lea
leaOP4mo ago
I don't exactly remember. I believe it was conflicts with the library file. Now that I know I can get thr headers separate from the library though, it should be easier now
owokitty
owokitty4mo ago
and if you have any other problem you can ask me because i think i might be among very few people who has compiled a lot of APKs inside termux using termux Clang. most people here do not do it.
lea
leaOP4mo ago
I'll keep that in mind. Ty sm! This will make otg app dev so much easier now
owokitty
owokitty4mo ago
oh and i can see youre in a mario 64 server too, if your app has anything to do with mario 64 then you can probably copy code from me because ive made a lot of code for mario 64 android
lea
leaOP4mo ago
It's not, but I'll mess with it eventually Probably by porting it to Quest (3) standalone That's off topic though
owokitty
owokitty4mo ago
yeah that is cool someone tried to do something like that but as far as i know there is nobody who has publicly shown any android + mario 64 + VR headset + stereoscopic 3d all at the same time, only people who have made 2 or so combinations of those features but not all 4 at the same time. so if you do it dont worry if anyone else already made that i think nobody has. i cant since i dont have VR

Did you find this page helpful?