This is an old revision of the document!


First Steps

The framework usage is quite the same as using Delphi Firemonkey 3D. At first we need a viewport to display all 3D content.

It is possible to use default firemonkey components like Buttons, Labels and also 3D components inside the Gorilla3D viewport.

Creating a Gorilla3D Viewport at design-time

You can find the viewport at designtime in the toolbar under:

Gorilla3D > TGorillaViewport.

Simply drag it onto your form or create it at runtime by the following method.

CAUTION: Gorilla3D is not compatible with TForm3D and TViewport3D!

Creating a viewport at runtime

If you need to create the Gorilla3D viewport at runtime, you can do it the following way:

Form1.pas
uses
  FMX.UITypes,
  Gorilla.Viewport;
 
// in our form (TForm1) we added a field named "FGorilla"
procedure TForm1.FormCreate(Sender: TObject);
begin
  FGorilla := TGorillaViewport.Create(Self);
  FGorilla.Parent := Form1;
  FGorilla.Color  := TAlphaColorRec.Black;
end;

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

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