Unit1.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit1.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "GLBaseClasses"
  8. #pragma link "GLCadencer"
  9. #pragma link "GLCoordinates"
  10. #pragma link "GLCrossPlatform"
  11. #pragma link "GLObjects"
  12. #pragma link "GLScene"
  13. #pragma link "GLTimeEventsMgr"
  14. #pragma link "GLWin32Viewer"
  15. #pragma resource "*.dfm"
  16. TForm1 *Form1;
  17. //---------------------------------------------------------------------------
  18. __fastcall TForm1::TForm1(TComponent* Owner)
  19. : TForm(Owner)
  20. {
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::Timer1Timer(TObject *Sender)
  24. {
  25. Caption = "Events" + Format(" Time: %.4f",
  26. ARRAYOFCONST ((GLCadencer1->CurrentTime)));
  27. GLSceneViewer1->ResetPerformanceMonitor();
  28. }
  29. //---------------------------------------------------------------------------
  30. void __fastcall TForm1::GLTimeEventsMGR1Events0Event(TTimeEvent *event)
  31. {
  32. Cube1->RollAngle = (float)event->ElapsedTime*180/3;
  33. }
  34. //---------------------------------------------------------------------------
  35. void __fastcall TForm1::GLTimeEventsMGR1Events1Event(TTimeEvent *event)
  36. {
  37. Cube2->RollAngle = (float)event->TickCount/499*180;
  38. }
  39. //---------------------------------------------------------------------------
  40. void __fastcall TForm1::GLTimeEventsMGR1Events2Event(TTimeEvent *event)
  41. {
  42. Cube3->RollAngle = 90;
  43. }
  44. //---------------------------------------------------------------------------
  45. void __fastcall TForm1::GLTimeEventsMGR1Events3Event(TTimeEvent *event)
  46. {
  47. Cube1->RollAngle = (float)event->TickCount/4*90;
  48. }
  49. //---------------------------------------------------------------------------
  50. void __fastcall TForm1::GLTimeEventsMGR1Events4Event(TTimeEvent *event)
  51. {
  52. Cube2->RollAngle = (float)event->TickCount/20*90;
  53. }
  54. //---------------------------------------------------------------------------
  55. void __fastcall TForm1::GLTimeEventsMGR1Events5Event(TTimeEvent *event)
  56. {
  57. Cube3->RollAngle = (float)event->TickCount/200*90;
  58. }
  59. //---------------------------------------------------------------------------