fSmokingD.pas 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. unit fSmokingD;
  2. interface
  3. uses
  4. Winapi.OpenGL,
  5. System.SysUtils,
  6. System.Classes,
  7. Vcl.Graphics,
  8. Vcl.Controls,
  9. Vcl.Forms,
  10. Vcl.Dialogs,
  11. Vcl.ExtCtrls,
  12. GLS.Cadencer,
  13. GLS.ParticleFX,
  14. GLS.PerlinPFX,
  15. GLS.Scene,
  16. GLS.Objects,
  17. GLS.SceneViewer,
  18. GLS.Coordinates,
  19. GLS.SimpleNavigation,
  20. GLS.BaseClasses;
  21. type
  22. TFormSmoking = class(TForm)
  23. GLSceneViewer: TGLSceneViewer;
  24. GLScene: TGLScene;
  25. GLCamera: TGLCamera;
  26. DCFire1: TGLDummyCube;
  27. ParticleFXRenderer: TGLParticleFXRenderer;
  28. SmokePFX: TGLPerlinPFXManager;
  29. FlamePFX: TGLCustomSpritePFXManager;
  30. GLCadencer: TGLCadencer;
  31. DCTarget: TGLDummyCube;
  32. Timer: TTimer;
  33. Panel1: TPanel;
  34. procedure GLCadencerProgress(Sender: TObject; const deltaTime,
  35. newTime: Double);
  36. procedure TimerTimer(Sender: TObject);
  37. private
  38. public
  39. end;
  40. var
  41. FormSmoking: TFormSmoking;
  42. implementation
  43. {$R *.dfm}
  44. procedure TFormSmoking.GLCadencerProgress(Sender: TObject; const deltaTime,
  45. newTime: Double);
  46. begin
  47. SmokePFX.Rotation:=newTime;
  48. GLSceneViewer.Invalidate;
  49. end;
  50. procedure TFormSmoking.TimerTimer(Sender: TObject);
  51. begin
  52. Panel1.Caption := GLSceneViewer.FramesPerSecondText
  53. +Format(' - %d Particles - %.3f ms Sort',
  54. [SmokePFX.ParticleCount+FlamePFX.ParticleCount,
  55. ParticleFXRenderer.LastSortTime]);
  56. GLSceneViewer.ResetPerformanceMonitor;
  57. end;
  58. end.