Android

Android platforms 32 bit and 64 bit are supported for Gorilla3D, but due to IDE/NDK restrictions different OpenGL versions are used:

  • Delphi 10.1 - 10.2 - shaders are compiled for OpenGL ES 2.0
  • Delphi 10.3+ - since Android changed its publishing conditions to a minimum API level 28, we are allowed to use OpenGL ES 3.0+

Remarks: Due to OpenGL ES 2.0 on Delphi 10.1 - 10.2 it is not possible to use the complete render pass spectrum. Especially render passes with multiple render targets are not possible!

NDK

For Delphi 10.3 and since v0.8.1 and implementation of order-independent transparency rendering the minimum NDK API level 21 is needed!

For Delphi 10.1 - 10.2 an elder NDK version is installed and no API level 21 is available. Therefore packages are still compiled with transparency sorting and OpenGL ES 2.0 usage.

Backwards-Compatibility

Due to major changes in API restrictions, we decided to handle Android compilations of IDE versions older than 10.3.3 as deprecated!

Building an app with Gorilla3D and Delphi 10.3 Rio for Android

Gorilla3D supports Android as platform, but needs since v0.7.5.1476 some additional configuration in Delphi 10.3 Rio. On older Delphi version, still OpenGLES v2 is used.

Since OpenGLES v3.0+ support was added to the framework, the NDK settings need to be changed. Because OpenGLES v3 was first delivered with Android 4.3 (API level 18), we need to change the minimum api version in our delphi setting.

Go to “tools” > “options” > “deployment” > “SDK-Manager” and tab “NDK”. Here you need to replace every android api version occurrence (“android-*”) lower than 18 to at least “android-18”.

When installing Delphi 10.3 Rio, the default configuration is set to “android-14”.

Since Gorilla3D v0.8.1 we have to set NDK minimum API level to “android-21”. On Delphi 10.3.3 its already set to “android-22” by default.

If you did not change the api version, you will receive an error on compiling your code:

[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\20.0\CatalogRepository\AndroidNDK-17b_20.0.32429.4364\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: cannot find -lGLESv3

Your app should tell Android that it needs at least OpenGL ES 3.0. This can be done in “AndroidManifest.Template.xml”:

<!-- Tell the system this app requires OpenGL ES 3.0. -->
<uses-feature android:glEsVersion="0x00030000" android:required="true" />

Change the attribute android:glEsVersion to “0x00030000”.