fFire_GR32D.pas 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. unit fFire_GR32D;
  2. interface
  3. uses
  4. Winapi.Windows,
  5. Winapi.Messages,
  6. System.SysUtils,
  7. System.Classes,
  8. Vcl.Graphics,
  9. Vcl.Controls,
  10. Vcl.Forms,
  11. Vcl.ExtCtrls,
  12. Vcl.StdCtrls,
  13. Vcl.ComCtrls,
  14. Vcl.Imaging.Jpeg,
  15. //GR32
  16. GR32,
  17. GR32_OrdinalMaps,
  18. GR32_Image,
  19. GLS.AsyncTimer,
  20. GLS.Scene,
  21. GLS.Objects,
  22. GLS.Texture,
  23. GLS.HUDObjects,
  24. GLS.SceneViewer,
  25. GLS.Cadencer,
  26. GLS.Coordinates,
  27. GLS.BaseClasses,
  28. GLS.Material,
  29. GLS.FileJPEG,
  30. GLScene.Utils;
  31. type
  32. TFormFire2d_GR32 = class(TForm)
  33. AsyncTimer1: TGLAsyncTimer;
  34. GLScene1: TGLScene;
  35. GLSceneViewer1: TGLSceneViewer;
  36. GLCamera1: TGLCamera;
  37. Timer1: TTimer;
  38. PaintBox32: TPaintBox32;
  39. Cube1: TGLCube;
  40. GLCadencer1: TGLCadencer;
  41. Label5: TLabel;
  42. GLMaterialLibrary1: TGLMaterialLibrary;
  43. Memo1: TMemo;
  44. procedure FormCreate(Sender: TObject);
  45. procedure FormDestroy(Sender: TObject);
  46. procedure AsyncTimer1Timer(Sender: TObject);
  47. procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  48. procedure GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  49. procedure GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  50. procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  51. procedure Timer1Timer(Sender: TObject);
  52. procedure GLCadencer1Progress(Sender: TObject; const deltaTime, newTime: Double);
  53. private
  54. SourceLit: array of boolean;
  55. BlobX, BlobY: Integer;
  56. BlobSize: Integer;
  57. procedure LitSource(i: Integer);
  58. procedure DrawBlob(X, Y: Integer; BlobSize: Integer);
  59. procedure SetUpColorTableYellow;
  60. procedure SetColorInt(i, r, g, b: Integer);
  61. public
  62. HeatMap: TByteMap;
  63. pal: TPalette32;
  64. OldMousePos: TPoint;
  65. MouseDragging: boolean;
  66. SourceLineHeight: Integer;
  67. procedure PaintData;
  68. procedure ProcessHeatMap(HeatMap: TByteMap);
  69. end;
  70. var
  71. FormFire2d_GR32: TFormFire2d_GR32;
  72. const
  73. HeatMapWidth = 256;
  74. HeatMapHeight = 256;
  75. implementation
  76. {$R *.DFM}
  77. {$IFDEF USE_GRAPHICS32}
  78. // Please rebuild GLScene with ($DEFINE USE_GRAPHICS32} in GLScene.inc
  79. {$ENDIF}
  80. procedure TFormFire2d_GR32.AsyncTimer1Timer(Sender: TObject);
  81. begin
  82. // Update and animate the 2D Fire, this part is Graphics32 stuff only
  83. DrawBlob(BlobX, BlobY, BlobSize);
  84. ProcessHeatMap(HeatMap);
  85. PaintData;
  86. // Assign our TBitmap32 to the texture, this is done in two steps
  87. with Cube1.Material.Texture.Image do
  88. begin
  89. // Update the internal TGLBitmap32 with the TBitmap32
  90. GetBitmap32.Assign(PaintBox32.Buffer);
  91. // And notify a change occured (you could perform other operations on the
  92. // TGLBitmap32 before this notification, f.i. adjusting the Alpha channel)
  93. NotifyChange(self);
  94. end;
  95. // Specifying the target (GL_TEXTURE_2D) isn't really usefull for 2D textures,
  96. // since you only have one, but for cube maps, you can use the OpenGL
  97. // texture target constant to specify which 2D component of the cube map
  98. // will be obtained and altered.
  99. // The Alpha channel of TBitmap32 is transfered "as is" to the TGLBitmap32,
  100. // which may or may not be a wanted effect. You can use the SetAlphaXxxx
  101. // function to alter the TGLBitmap32 alpha channel without altering the
  102. // TBitmap32.
  103. end;
  104. //
  105. // All that follows takes care of animating the texture and cube
  106. //
  107. procedure TFormFire2d_GR32.FormCreate(Sender: TObject);
  108. var
  109. i: Integer;
  110. Image32: TImage32;
  111. begin
  112. var Path: TFileName := GetCurrentAssetPath();
  113. SetCurrentDir(Path + '\texture');
  114. GLMaterialLibrary1.TexturePaths := GetCurrentDir();
  115. SetUpColorTableYellow;
  116. HeatMap := TByteMap.Create;
  117. HeatMap.SetSize(HeatMapWidth, HeatMapHeight);
  118. Setlength(SourceLit, 256);
  119. for i := 0 to Length(SourceLit) - 1 do
  120. SourceLit[i] := false;
  121. HeatMap.Clear(0);
  122. BlobSize := 3;
  123. AsyncTimer1.Enabled := true;
  124. SourceLineHeight := HeatMapHeight - 36;
  125. end;
  126. procedure TFormFire2d_GR32.FormDestroy(Sender: TObject);
  127. begin
  128. HeatMap.Free;
  129. end;
  130. procedure TFormFire2d_GR32.PaintData;
  131. begin
  132. HeatMap.WriteTo(PaintBox32.Buffer, pal);
  133. PaintBox32.Buffer.HorzLine(0, SourceLineHeight - 1, PaintBox32.Buffer.Width - 1, clWhite32);
  134. PaintBox32.Buffer.HorzLine(0, SourceLineHeight, PaintBox32.Buffer.Width - 1, clWhite32);
  135. PaintBox32.Buffer.RenderText(5, 256 - 24, 'Texture generated with Graphics32', 0, clWhite32);
  136. PaintBox32.Invalidate;
  137. end;
  138. procedure TFormFire2d_GR32.ProcessHeatMap(HeatMap: TByteMap);
  139. const
  140. hotvalue = 255;
  141. nbHotSpots = 200;
  142. // nbHotSpots is the no. of hot spots added at a time
  143. // it also determines the rate the fire spreads on the white line
  144. var
  145. X, Y: Integer;
  146. begin
  147. for Y := 1 to nbHotSpots - 1 do
  148. begin
  149. X := 10 + random(HeatMap.Width - 20);
  150. if SourceLit[X] then
  151. // add hot spots, checking if the pixel can be lit
  152. begin
  153. HeatMap[X, SourceLineHeight] := hotvalue - 16 + random(16);
  154. if random(3) = 0 then
  155. HeatMap[X, SourceLineHeight + 1] := hotvalue;
  156. case random(3) of
  157. 0: LitSource(X + 1);
  158. 1: LitSource(X - 1);
  159. end;
  160. end;
  161. end;
  162. for Y := HeatMap.Height - 2 downto 2 do // do some kind of averaging
  163. for X := 2 to HeatMap.Width - 2 do
  164. case random(6) of
  165. 0: HeatMap[X, Y] := (HeatMap[X - 1, Y + 1] + HeatMap[X + 1, Y + 1] +
  166. HeatMap[X - 2, Y + 2] + HeatMap[X + 1, Y + 2]) div 4;
  167. 1: HeatMap[X, Y] := (HeatMap[X - 1, Y + 1] + HeatMap[X - 2, Y + 1] +
  168. HeatMap[X + 1, Y - 1]) div 3;
  169. 2: HeatMap[X, Y] := (HeatMap[X - 1, Y + 1] + HeatMap[X - 2, Y + 1] +
  170. HeatMap[X + 1, Y - 1]) div 4;
  171. else
  172. HeatMap[X, Y] := (HeatMap[X, Y] +
  173. HeatMap[X - 1, Y + 1] + HeatMap[X + 1, Y + 1] +
  174. HeatMap[X - 2, Y + 2] + HeatMap[X + 2, Y + 2]) div 5;
  175. end;
  176. end;
  177. procedure TFormFire2d_GR32.DrawBlob(X, Y: Integer; BlobSize: Integer);
  178. var
  179. bx, by, c: Integer;
  180. const
  181. hotvalue = 240;
  182. MaxColorIndex = 255;
  183. begin
  184. for bx := -BlobSize to BlobSize do
  185. for by := -BlobSize to BlobSize do
  186. begin
  187. if ((bx + X > 1) and (bx + X < HeatMap.Width - 1) and // within the heat map
  188. (by + Y > 1) and (by + Y < HeatMap.Height - 1)) then
  189. begin
  190. c := hotvalue - 30 + (BlobSize - bx + 1) * (BlobSize - by + 1);
  191. if (c > MaxColorIndex) then
  192. c := MaxColorIndex;
  193. HeatMap[bx + X, by + Y] := c;
  194. if (by + Y = SourceLineHeight) then
  195. LitSource(bx + X);
  196. end;
  197. end;
  198. end;
  199. procedure TFormFire2d_GR32.LitSource(i: Integer);
  200. begin
  201. SourceLit[i] := true;
  202. end;
  203. procedure TFormFire2d_GR32.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  204. begin
  205. if ssLeft in Shift then
  206. BlobSize := 6
  207. else
  208. BlobSize := 3;
  209. BlobX := X;
  210. BlobY := Y;
  211. end;
  212. procedure TFormFire2d_GR32.GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  213. begin
  214. BlobSize := 6;
  215. end;
  216. procedure TFormFire2d_GR32.GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  217. begin
  218. BlobSize := 3;
  219. end;
  220. procedure TFormFire2d_GR32.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  221. begin
  222. if Key = 27 then
  223. close;
  224. end;
  225. procedure TFormFire2d_GR32.SetColorInt(i, r, g, b: Integer);
  226. begin
  227. pal[i] := Color32(r, g, b);
  228. end;
  229. procedure TFormFire2d_GR32.SetUpColorTableYellow;
  230. var
  231. i: Integer;
  232. begin
  233. // Color values stolen from http://freespace.virgin.net/hugo.elias/
  234. // code generated by PalEdit
  235. SetColorInt(0, 0, 0, 0);
  236. SetColorInt(1, 9, 3, 1);
  237. SetColorInt(2, 19, 5, 1);
  238. SetColorInt(3, 28, 8, 2);
  239. SetColorInt(4, 37, 11, 3);
  240. SetColorInt(5, 47, 13, 3);
  241. SetColorInt(6, 56, 16, 4);
  242. SetColorInt(7, 65, 19, 5);
  243. SetColorInt(8, 75, 21, 5);
  244. SetColorInt(9, 84, 24, 6);
  245. SetColorInt(10, 93, 27, 7);
  246. SetColorInt(11, 103, 29, 7);
  247. SetColorInt(12, 112, 32, 8);
  248. SetColorInt(13, 136, 48, 8);
  249. SetColorInt(14, 152, 56, 8);
  250. SetColorInt(15, 164, 64, 16);
  251. SetColorInt(16, 176, 80, 16);
  252. SetColorInt(17, 184, 84, 24);
  253. SetColorInt(18, 188, 92, 24);
  254. SetColorInt(19, 196, 104, 24);
  255. SetColorInt(20, 200, 108, 32);
  256. SetColorInt(21, 204, 112, 32);
  257. SetColorInt(22, 208, 120, 44);
  258. SetColorInt(23, 208, 124, 44);
  259. SetColorInt(24, 212, 132, 44);
  260. SetColorInt(25, 212, 136, 48);
  261. SetColorInt(26, 216, 140, 48);
  262. SetColorInt(27, 216, 148, 48);
  263. SetColorInt(28, 216, 148, 56);
  264. SetColorInt(29, 220, 152, 56);
  265. SetColorInt(30, 220, 156, 56);
  266. SetColorInt(31, 220, 160, 64);
  267. SetColorInt(32, 220, 164, 64);
  268. SetColorInt(33, 224, 168, 72);
  269. SetColorInt(34, 224, 172, 72);
  270. SetColorInt(35, 224, 176, 80);
  271. SetColorInt(36, 224, 180, 80);
  272. SetColorInt(37, 224, 180, 84);
  273. SetColorInt(38, 224, 184, 84);
  274. SetColorInt(39, 224, 188, 92);
  275. SetColorInt(40, 224, 192, 96);
  276. SetColorInt(41, 224, 196, 104);
  277. SetColorInt(42, 228, 196, 104);
  278. SetColorInt(43, 228, 200, 104);
  279. SetColorInt(44, 228, 200, 108);
  280. SetColorInt(45, 228, 200, 112);
  281. SetColorInt(46, 228, 204, 112);
  282. SetColorInt(47, 228, 204, 120);
  283. SetColorInt(48, 228, 208, 120);
  284. SetColorInt(49, 228, 208, 124);
  285. SetColorInt(50, 228, 212, 128);
  286. SetColorInt(51, 228, 212, 132);
  287. SetColorInt(52, 228, 212, 136);
  288. SetColorInt(53, 228, 216, 136);
  289. SetColorInt(54, 228, 216, 140);
  290. SetColorInt(55, 228, 216, 148);
  291. SetColorInt(56, 228, 220, 148);
  292. SetColorInt(57, 228, 220, 152);
  293. SetColorInt(58, 228, 220, 156);
  294. SetColorInt(59, 228, 220, 160);
  295. SetColorInt(60, 228, 220, 164);
  296. SetColorInt(61, 228, 220, 168);
  297. SetColorInt(62, 228, 224, 168);
  298. SetColorInt(63, 228, 224, 172);
  299. SetColorInt(64, 228, 224, 176);
  300. SetColorInt(65, 228, 224, 180);
  301. SetColorInt(66, 228, 224, 180);
  302. SetColorInt(67, 228, 224, 181);
  303. SetColorInt(68, 228, 224, 181);
  304. SetColorInt(69, 229, 225, 182);
  305. SetColorInt(70, 229, 225, 182);
  306. SetColorInt(71, 229, 225, 182);
  307. SetColorInt(72, 229, 225, 183);
  308. SetColorInt(73, 229, 225, 183);
  309. SetColorInt(74, 229, 225, 184);
  310. SetColorInt(75, 229, 226, 184);
  311. SetColorInt(76, 230, 226, 184);
  312. SetColorInt(77, 230, 226, 185);
  313. SetColorInt(78, 230, 226, 185);
  314. SetColorInt(79, 230, 226, 186);
  315. SetColorInt(80, 230, 226, 186);
  316. SetColorInt(81, 230, 227, 186);
  317. SetColorInt(82, 230, 227, 187);
  318. SetColorInt(83, 231, 227, 187);
  319. SetColorInt(84, 231, 227, 188);
  320. SetColorInt(85, 231, 227, 188);
  321. SetColorInt(86, 231, 227, 188);
  322. SetColorInt(87, 231, 228, 189);
  323. SetColorInt(88, 231, 228, 189);
  324. SetColorInt(89, 231, 228, 189);
  325. SetColorInt(90, 232, 228, 190);
  326. SetColorInt(91, 232, 228, 190);
  327. SetColorInt(92, 232, 228, 191);
  328. SetColorInt(93, 232, 229, 191);
  329. SetColorInt(94, 232, 229, 191);
  330. SetColorInt(95, 232, 229, 192);
  331. SetColorInt(96, 232, 229, 192);
  332. SetColorInt(97, 233, 229, 193);
  333. SetColorInt(98, 233, 229, 193);
  334. SetColorInt(99, 233, 230, 193);
  335. SetColorInt(100, 233, 230, 194);
  336. SetColorInt(101, 233, 230, 194);
  337. SetColorInt(102, 233, 230, 195);
  338. SetColorInt(103, 233, 230, 195);
  339. SetColorInt(104, 234, 230, 195);
  340. SetColorInt(105, 234, 231, 196);
  341. SetColorInt(106, 234, 231, 196);
  342. SetColorInt(107, 234, 231, 197);
  343. SetColorInt(108, 234, 231, 197);
  344. SetColorInt(109, 234, 231, 197);
  345. SetColorInt(110, 234, 231, 198);
  346. SetColorInt(111, 235, 232, 198);
  347. SetColorInt(112, 235, 232, 199);
  348. SetColorInt(113, 235, 232, 199);
  349. SetColorInt(114, 235, 232, 199);
  350. SetColorInt(115, 235, 232, 200);
  351. SetColorInt(116, 235, 232, 200);
  352. SetColorInt(117, 235, 232, 201);
  353. SetColorInt(118, 236, 233, 201);
  354. SetColorInt(119, 236, 233, 201);
  355. SetColorInt(120, 236, 233, 202);
  356. SetColorInt(121, 236, 233, 202);
  357. SetColorInt(122, 236, 233, 202);
  358. SetColorInt(123, 236, 233, 203);
  359. SetColorInt(124, 236, 234, 203);
  360. SetColorInt(125, 237, 234, 204);
  361. SetColorInt(126, 237, 234, 204);
  362. SetColorInt(127, 237, 234, 204);
  363. SetColorInt(128, 237, 234, 205);
  364. SetColorInt(129, 237, 234, 205);
  365. SetColorInt(130, 237, 235, 206);
  366. SetColorInt(131, 237, 235, 206);
  367. SetColorInt(132, 238, 235, 206);
  368. SetColorInt(133, 238, 235, 207);
  369. SetColorInt(134, 238, 235, 207);
  370. SetColorInt(135, 238, 235, 208);
  371. SetColorInt(136, 238, 236, 208);
  372. SetColorInt(137, 238, 236, 208);
  373. SetColorInt(138, 238, 236, 209);
  374. SetColorInt(139, 239, 236, 209);
  375. SetColorInt(140, 239, 236, 210);
  376. SetColorInt(141, 239, 236, 210);
  377. SetColorInt(142, 239, 237, 210);
  378. SetColorInt(143, 239, 237, 211);
  379. SetColorInt(144, 239, 237, 211);
  380. SetColorInt(145, 239, 237, 212);
  381. SetColorInt(146, 240, 237, 212);
  382. SetColorInt(147, 240, 237, 212);
  383. SetColorInt(148, 240, 238, 213);
  384. SetColorInt(149, 240, 238, 213);
  385. SetColorInt(150, 240, 238, 214);
  386. SetColorInt(151, 240, 238, 214);
  387. SetColorInt(152, 240, 238, 214);
  388. SetColorInt(153, 241, 238, 215);
  389. SetColorInt(154, 241, 239, 215);
  390. SetColorInt(155, 241, 239, 216);
  391. SetColorInt(156, 241, 239, 216);
  392. SetColorInt(157, 241, 239, 216);
  393. SetColorInt(158, 241, 239, 217);
  394. SetColorInt(159, 241, 239, 217);
  395. SetColorInt(160, 242, 240, 218);
  396. SetColorInt(161, 242, 240, 218);
  397. SetColorInt(162, 242, 240, 218);
  398. SetColorInt(163, 242, 240, 219);
  399. SetColorInt(164, 242, 240, 219);
  400. SetColorInt(165, 242, 240, 219);
  401. SetColorInt(166, 242, 240, 220);
  402. SetColorInt(167, 242, 241, 220);
  403. SetColorInt(168, 243, 241, 221);
  404. SetColorInt(169, 243, 241, 221);
  405. SetColorInt(170, 243, 241, 221);
  406. SetColorInt(171, 243, 241, 222);
  407. SetColorInt(172, 243, 241, 222);
  408. SetColorInt(173, 243, 242, 223);
  409. SetColorInt(174, 243, 242, 223);
  410. SetColorInt(175, 244, 242, 223);
  411. SetColorInt(176, 244, 242, 224);
  412. SetColorInt(177, 244, 242, 224);
  413. SetColorInt(178, 244, 242, 225);
  414. SetColorInt(179, 244, 243, 225);
  415. SetColorInt(180, 244, 243, 225);
  416. SetColorInt(181, 244, 243, 226);
  417. SetColorInt(182, 245, 243, 226);
  418. SetColorInt(183, 245, 243, 227);
  419. SetColorInt(184, 245, 243, 227);
  420. SetColorInt(185, 245, 244, 227);
  421. SetColorInt(186, 245, 244, 228);
  422. SetColorInt(187, 245, 244, 228);
  423. SetColorInt(188, 245, 244, 229);
  424. SetColorInt(189, 246, 244, 229);
  425. SetColorInt(190, 246, 244, 229);
  426. SetColorInt(191, 246, 245, 230);
  427. SetColorInt(192, 246, 245, 230);
  428. SetColorInt(193, 246, 245, 231);
  429. SetColorInt(194, 246, 245, 231);
  430. SetColorInt(195, 246, 245, 231);
  431. SetColorInt(196, 247, 245, 232);
  432. SetColorInt(197, 247, 246, 232);
  433. SetColorInt(198, 247, 246, 232);
  434. SetColorInt(199, 247, 246, 233);
  435. SetColorInt(200, 247, 246, 233);
  436. SetColorInt(201, 247, 246, 234);
  437. SetColorInt(202, 247, 246, 234);
  438. SetColorInt(203, 248, 247, 234);
  439. SetColorInt(204, 248, 247, 235);
  440. SetColorInt(205, 248, 247, 235);
  441. SetColorInt(206, 248, 247, 236);
  442. SetColorInt(207, 248, 247, 236);
  443. SetColorInt(208, 248, 247, 236);
  444. SetColorInt(209, 248, 247, 237);
  445. SetColorInt(210, 249, 248, 237);
  446. SetColorInt(211, 249, 248, 238);
  447. SetColorInt(212, 249, 248, 238);
  448. SetColorInt(213, 249, 248, 238);
  449. SetColorInt(214, 249, 248, 239);
  450. SetColorInt(215, 249, 248, 239);
  451. SetColorInt(216, 249, 249, 240);
  452. SetColorInt(217, 250, 249, 240);
  453. SetColorInt(218, 250, 249, 240);
  454. SetColorInt(219, 250, 249, 241);
  455. SetColorInt(220, 250, 249, 241);
  456. SetColorInt(221, 250, 249, 242);
  457. SetColorInt(222, 250, 250, 242);
  458. SetColorInt(223, 250, 250, 242);
  459. SetColorInt(224, 251, 250, 243);
  460. SetColorInt(225, 251, 250, 243);
  461. SetColorInt(226, 251, 250, 244);
  462. SetColorInt(227, 251, 250, 244);
  463. SetColorInt(228, 251, 251, 244);
  464. SetColorInt(229, 251, 251, 245);
  465. for i := 230 to 255 do
  466. SetColorInt(i, 251, 251, 245);
  467. end;
  468. procedure TFormFire2d_GR32.Timer1Timer(Sender: TObject);
  469. begin
  470. Caption := Format('Fire 2D - %.1f FPS', [GLSceneViewer1.FramesPerSecond]);
  471. GLSceneViewer1.ResetPerformanceMonitor;
  472. end;
  473. procedure TFormFire2d_GR32.GLCadencer1Progress(Sender: TObject; const deltaTime, newTime: Double);
  474. begin
  475. Cube1.TurnAngle := newTime * 15;
  476. end;
  477. end.