fMainC.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include <tchar.h>
  4. #pragma hdrstop
  5. #include "fMainC.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. #pragma link "GLS.BaseClasses"
  9. #pragma link "GLS.Behaviours"
  10. #pragma link "GLS.Cadencer"
  11. #pragma link "GLS.Coordinates"
  12. #pragma link "GLS.Objects"
  13. #pragma link "GLS.ParticleFX"
  14. #pragma link "GLS.Scene"
  15. #pragma link "GLS.SceneViewer"
  16. #pragma resource "*.dfm"
  17. TForm1 *Form1;
  18. //---------------------------------------------------------------------------
  19. __fastcall TForm1::TForm1(TComponent* Owner)
  20. : TForm(Owner)
  21. {
  22. }
  23. //---------------------------------------------------------------------------
  24. void __fastcall TForm1::FormCreate(TObject *Sender)
  25. {
  26. RadioGroup1Click(Sender);
  27. }
  28. //---------------------------------------------------------------------------
  29. void __fastcall TForm1::RadioGroup1Click(TObject *Sender)
  30. {
  31. TGLSourcePFXEffect *source;
  32. source = GetOrCreateSourcePFX(DCVolcano);
  33. switch (RadioGroup1->ItemIndex) {
  34. case 0: source->ParticleInterval =0.1; break;
  35. case 1: source->ParticleInterval =0.5; break;
  36. case 2: source->ParticleInterval =0.02; break;
  37. case 3: source->ParticleInterval =0.01; break;
  38. case 4: source->ParticleInterval =0.005; break;
  39. case 5: source->ParticleInterval =0.001; break;
  40. default:
  41. ;
  42. }
  43. }
  44. //---------------------------------------------------------------------------
  45. void __fastcall TForm1::GLCadencer1Progress(TObject *Sender, const double deltaTime,
  46. const double newTime)
  47. {
  48. GLSceneViewer1->Invalidate();
  49. }
  50. //---------------------------------------------------------------------------
  51. void __fastcall TForm1::Timer1Timer(TObject *Sender)
  52. {
  53. Panel1->Caption = Format("%.1f FPS - %3d Particles - Depth Sort: %.2f msec",
  54. ARRAYOFCONST((GLSceneViewer1->FramesPerSecond(), PFXVolcano->Particles->ItemCount()+PFXBlue->Particles->ItemCount(),
  55. PFXRenderer->LastSortTime)));
  56. GLSceneViewer1->ResetPerformanceMonitor();
  57. }
  58. //---------------------------------------------------------------------------