First Steps

Handling Gorilla3D is quite the same as using Firemonkey 3D. The main difference is the usage of TGorillaViewport as the main component for display. You can no longer use a TViewport3D or TForm3D as basis for showing 3D content.

The reason for that is, that Gorilla3D extends functionality a lot and needs special treatment, which the default viewport do not provide (f.e. Render-Passes, Lighting-Information, Shadow-Computation, …).

But, let's start and have quick look at the basic features of Gorilla3D and how they are going to be used.

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”.