Unit1.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include <tchar.h>
  4. #pragma hdrstop
  5. #include "Unit1.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. #pragma link "GLBaseClasses"
  9. #pragma link "GLCadencer"
  10. #pragma link "GLCoordinates"
  11. #pragma link "GLCrossPlatform"
  12. #pragma link "GLGraph"
  13. #pragma link "GLMaterial"
  14. #pragma link "GLObjects"
  15. #pragma link "GLScene"
  16. #pragma link "GLTilePlane"
  17. #pragma link "GLWin32Viewer"
  18. #pragma resource "*.dfm"
  19. TForm1 *Form1;
  20. //---------------------------------------------------------------------------
  21. __fastcall TForm1::TForm1(TComponent* Owner)
  22. : TForm(Owner)
  23. {
  24. }
  25. //---------------------------------------------------------------------------
  26. void __fastcall TForm1::FormCreate(TObject *Sender)
  27. {
  28. int i, j;
  29. SetGLSceneMediaDir();
  30. // fill the tiled area with random tiles
  31. RandSeed = 0;
  32. /*
  33. for (i=-20;i<=20;i++)
  34. for (j=-20;j<=20;j++)
  35. GLTilePlane->Tiles[i,j] = Random(GLMaterialLibrary->Materials->Count-1)+1;
  36. */
  37. // set all tile materials to anisotropic,
  38. // add them to the material selection combo
  39. for (i=0;i<(GLMaterialLibrary->Materials->Count-1);i++)
  40. {
  41. GLMaterialLibrary->Materials->Items[i]->Material->Texture->FilteringQuality = tfAnisotropic;
  42. CBMaterial->Items->Add(GLMaterialLibrary->Materials->Items[i]->Name);
  43. }
  44. CBMaterial->ItemIndex = 0;
  45. }
  46. //---------------------------------------------------------------------------