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
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.Yes termux-gui
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
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
if you are trying to build an actual APK and then copy it to /storage/emulated/0/ and install it using something like
Yea
I can build the apk
I literally just need OpenGLES
That is the last thing required
then i know how to do what you want
but the hard parts are just:
I'm using just C and make, no gradle
I need the core
libGLES2
library and GLES
headers- 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 youI 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
yes also you don't need to add
--target
to clang
just run clang
and it will automatically compile for your deviceI know
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)
I'm aware
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
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 needi 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
I don't plan on using Cosmopolitan for the actual app
Just the toolchain
oh ok
(Might mess around with Cosmopolitan apps though)
That aside
Ty sm
i see someone else kind of already said what i said but you said it still didn't work, what error did you see?
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
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.
I'll keep that in mind. Ty sm!
This will make otg app dev so much easier now
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
It's not, but I'll mess with it eventually
Probably by porting it to Quest (3) standalone
That's off topic though
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