Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting to core functionality to Android #895

Open
AndrewBloom opened this issue Dec 20, 2023 · 1 comment
Open

Porting to core functionality to Android #895

AndrewBloom opened this issue Dec 20, 2023 · 1 comment

Comments

@AndrewBloom
Copy link

Hi Steven,
I know this has been asked multiple times, but I'm trying to port a minimal core of Pangolin on Android. I'm doing the work myself, but it would be useful if you could enlight me with a couple of details. I'm looking at the openGL side right now, and it seems that it's not really compatible with OpenGL ES2. Ideally I would aim for ES2 cause all reasonably old Android devices should support that. (https://developer.android.com/about/dashboards).
I see you used a lot of internal formats in glformattraits.h that are not supported, and I'm wondering why you deal with that and not just use GL_RGBA for everything. Is that useful for something in particular?
These are the internal formats available on openGL ES2: GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA. (https://docs.gl/es2/glTexImage2D).
Let me know if this porting it's something that you are interested in, you can contact me at ing.fiorito(at)gmail.com

@stevenlovegrove
Copy link
Owner

My apologies for the glacially slow reply - you've probably moved on by now, but a small note that for a time Pangolin did support android and it has some vestigial code related to it.

A windowing backed, currently defunct:
https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_windowing/src/display_android.cpp

Gl logic for including a compatibility layer, originally written for Android.
https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_opengl/include/pangolin/gl/glinclude.h#L33
https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_opengl/include/pangolin/gl/compat/gl2engine.h#L37

Although that compatibility layer isn't used for Android today, it is still active and used for the Emscripten web target https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_opengl/CMakeLists.txt#L39 which builds as part of CI, so that should be good.

Regarding your question about the internal formats - that is to support direct upload from different data sources without a hidden conversion in the OpenGL API which I've historically found to be incredibly slow and a huge source of performance issues. Sometimes scientific apps really want the original pixels for use in their shaders etc too. On Android or what-have-you, it seems acceptable that you would get a runtime error when trying to use an unsupported format, and with documentation on which formats are preferred for wider compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants