| 1 | //--------------------------------------------------------------------------- |
| 2 | |
| 3 | #include <fmx.h> |
| 4 | #pragma hdrstop |
| 5 | |
| 6 | #include "Unit1.h" |
| 7 | //--------------------------------------------------------------------------- |
| 8 | #pragma package(smart_init) |
| 9 | #pragma link "Fmx.CastleControl" |
| 10 | // just test |
| 11 | //#pragma link "CastleScene" |
| 12 | //#pragma link "X3DNodes" |
| 13 | #pragma resource "*.fmx" |
| 14 | TForm1 *Form1; |
| 15 | |
| 16 | // TUiTest -------------------------------------------------------------- |
| 17 | |
| 18 | /* |
| 19 | Define simple TCastleUserInterface descendant, just to capture |
| 20 | the moment OpenGL(ES) context is created and fill Memo1 will information. |
| 21 | */ |
| 22 | class TUiTest : public TCastleUserInterface |
| 23 | { |
| 24 | public: |
| 25 | __fastcall TUiTest(TComponent* Owner) : TCastleUserInterface(Owner) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | virtual void __fastcall GLContextOpen() |
| 30 | { |
| 31 | Form1->Memo1->Lines->Add(GLInformationString()); |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | //--------------------------------------------------------------------------- |
| 36 | |
| 37 | __fastcall TForm1::TForm1(TComponent* Owner) |
| 38 | : TForm(Owner) |
| 39 | { |
| 40 | CastleControl1->Container->DesignUrl = |
| 41 | "castle-data:/test_3d.castle-user-interface"; |
| 42 | //"castle-data:/test_2d.castle-user-interface"; |
| 43 | //"castle-data:/test_ui.castle-user-interface"; |
| 44 | CastleControl1->Container->Controls()->InsertFront(new TUiTest(this)); |
| 45 | } |
| 46 | |
| 47 | //--------------------------------------------------------------------------- |