Fire_GR32D.dpr 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {:
  2. A demo for using Alex Denissov's Graphics32 library (http://www.g32.org)
  3. to generate 2D texture for use with GLScene.
  4. By Nelson Chu
  5. Try lighting the white line near the bottom of the window with your mouse
  6. pointer and see the fire spreads. Press ESC to quit.
  7. To use Graphics32 with GLScene:
  8. 1. Make sure GLS_Graphics32_SUPPORT is defined in GLSCene.inc. Recompile if
  9. needed.
  10. 2. In your program, use code like:
  11. GLTexture.Image.GetBitmap32(0).assign(Bitmap32);
  12. GLTexture.Image.NotifyChange(self);
  13. to assign the Bitmap32 to your GLScene texture and notify GLScene.
  14. To get fast assignment, remember to make the dimensions of your Bitmap32 equal
  15. to a power of two, so that GLScene doesn't need to do conversion internally.
  16. In this sample program, a 256 x 256 Graphics32 TByteMap is used to generate a
  17. "fire" image. At each frame, the fire image is first "visualized" in a
  18. Graphics32 Bitmap32. Then, the TBitmap32 is copied to the texture of a Cube.
  19. }
  20. program Fire_GR32D;
  21. uses
  22. Forms,
  23. fFire_GR32D in 'fFire_GR32D.pas' {FormFire2d_GR32};
  24. {$R *.RES}
  25. begin
  26. Application.Initialize;
  27. Application.CreateForm(TFormFire2d_GR32, FormFire2d_GR32);
  28. Application.Run;
  29. end.