osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.66k stars 1.02k forks source link

[feature request] [osmand-core] enable GLES on Linux (and fix compilation issues) #19871

Open Mis012 opened 5 months ago

Mis012 commented 5 months ago

Describe the idea (required)

Mesa, which typically provides OpenGL on Linux, always provides both GL and GLES. Therefore it would make sense to allow using GLES on Linux, unlike with e.g Windows where GLES is not natively supported.

Tell us about the expected behaviour (required)

"OSMAND_OPENGLES2PLUS_RENDERER_SUPPORTED" is defined on Linux, and the corresponding code is compiled into the library

Tell us about alternatives you've considered (required)

I tried to do this myself and simply added OR CMAKE_TARGET_OS STREQUAL "linux" to the appropriate if (CMAKE_TARGET_OS STREQUAL "ios" OR CMAKE_TARGET_OS STREQUAL "android"), but sadly it seems that the code doesn't currently compile on Linux and I wasn't able to fix that myself. (it seems that defines from <GLES2/gl2.h> are expected, but adding #include <GLES2/gl2.h> breaks stuff)

Context (optional)

No response