GLScene před 4 roky
rodič
revize
551b7f9ff3
25 změnil soubory, kde provedl 3051 přidání a 3056 odebrání
  1. binární
      AdvDemos/Delphi/Christmas/Data/clouds.jpg
  2. 106 106
      Demos/Delphi/interface/GameMenu/fGameMenu.dfm
  3. 145 145
      Demos/Delphi/interface/GameMenu/fGameMenu.pas
  4. 858 858
      Demos/Delphi/interface/GuiPaint/fGuiPaint.dfm
  5. 306 306
      Demos/Delphi/interface/GuiPaint/fGuiPaint.pas
  6. 113 113
      Demos/Delphi/interface/bmpfont/fBmpFont.dfm
  7. 98 98
      Demos/Delphi/interface/bmpfont/fBmpFont.pas
  8. 102 102
      Demos/Delphi/interface/camera/fCamera.dfm
  9. 163 163
      Demos/Delphi/interface/camera/fCamera.pas
  10. 139 139
      Demos/Delphi/interface/fontcolor/fFontColor.dfm
  11. 106 106
      Demos/Delphi/interface/fontcolor/fFontColor.pas
  12. 25 25
      Demos/Delphi/interface/winfont/fFontTexture.dfm
  13. 25 25
      Demos/Delphi/interface/winfont/fFontTexture.pas
  14. 120 120
      Demos/Delphi/interface/winfont/fWinFont.dfm
  15. 132 131
      Demos/Delphi/interface/winfont/fWinFont.pas
  16. 74 76
      Demos/Delphi/materials/cubemap/fCubeMap.dfm
  17. 12 12
      Demos/Delphi/materials/cubemap/fCubeMap.pas
  18. 82 81
      Demos/Delphi/materials/customquad/fCustomQuad.dfm
  19. 5 8
      Demos/Delphi/materials/customquad/fCustomQuad.pas
  20. 81 80
      Demos/Delphi/materials/dynamictexture/fDynamicTexture.dfm
  21. 9 9
      Demos/Delphi/materials/dynamictexture/fDynamicTexture.pas
  22. 173 173
      Demos/Delphi/materials/dyncubemap/fDynCubeMap.dfm
  23. 9 9
      Demos/Delphi/materials/dyncubemap/fDynCubeMap.pas
  24. 100 100
      Demos/Delphi/utilities/fontgen/fFontGen.dfm
  25. 68 71
      Demos/Delphi/utilities/fontgen/fFontGen.pas

binární
AdvDemos/Delphi/Christmas/Data/clouds.jpg


+ 106 - 106
Demos/Delphi/interface/GameMenu/UnitM.dfm → Demos/Delphi/interface/GameMenu/fGameMenu.dfm

@@ -1,106 +1,106 @@
-object Form1: TForm1
-  Left = 192
-  Top = 114
-  Caption = 'Game Menu'
-  ClientHeight = 449
-  ClientWidth = 558
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  OnKeyPress = FormKeyPress
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 558
-    Height = 422
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clGray
-    FieldOfView = 153.337402343750000000
-    PenAsTouch = False
-    Align = alClient
-    OnMouseDown = GLSceneViewer1MouseDown
-    OnMouseMove = GLSceneViewer1MouseMove
-    TabOrder = 0
-  end
-  object MainPanel: TPanel
-    Left = 0
-    Top = 422
-    Width = 558
-    Height = 27
-    Align = alBottom
-    TabOrder = 1
-    OnResize = MainPanelResize
-    object Label1: TLabel
-      Left = 144
-      Top = 6
-      Width = 234
-      Height = 13
-      Caption = 'Press "W" or "S" to navigate or "Enter" to select '
-    end
-    object ShowTitleCheckbox: TCheckBox
-      Left = 8
-      Top = 6
-      Width = 81
-      Height = 17
-      Caption = 'Show Title'
-      Checked = True
-      State = cbChecked
-      TabOrder = 0
-      OnClick = ShowTitleCheckboxClick
-      OnKeyPress = FormKeyPress
-    end
-  end
-  object GLScene1: TGLScene
-    Left = 40
-    Top = 8
-    object GLDummyCube1: TGLDummyCube
-      CubeSize = 1.000000000000000000
-      object GLCube1: TGLCube
-        Position.Coordinates = {0000803F00000000000000000000803F}
-      end
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = GLDummyCube1
-      Position.Coordinates = {0000404000004040000040400000803F}
-      object GLLightSource1: TGLLightSource
-        ConstAttenuation = 1.000000000000000000
-        Position.Coordinates = {0000204100002041000020410000803F}
-        SpotCutOff = 180.000000000000000000
-      end
-    end
-  end
-  object GLWindowsBitmapFont1: TGLWindowsBitmapFont
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWhite
-    Font.Height = -32
-    Font.Name = 'MS Sans Serif'
-    Font.Style = []
-    Left = 128
-    Top = 8
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 40
-    Top = 72
-  end
-  object GLMaterialLibrary1: TGLMaterialLibrary
-    Materials = <
-      item
-        Name = 'LibMaterial'
-        Tag = 0
-        Material.Texture.Disabled = False
-      end>
-    Left = 128
-    Top = 72
-  end
-end
+object FormGameMenu: TFormGameMenu
+  Left = 192
+  Top = 114
+  Caption = 'Game Menu'
+  ClientHeight = 449
+  ClientWidth = 558
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  OnKeyPress = FormKeyPress
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 558
+    Height = 422
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clGray
+    FieldOfView = 153.337402343750000000
+    PenAsTouch = False
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    TabOrder = 0
+  end
+  object MainPanel: TPanel
+    Left = 0
+    Top = 422
+    Width = 558
+    Height = 27
+    Align = alBottom
+    TabOrder = 1
+    OnResize = MainPanelResize
+    object Label1: TLabel
+      Left = 144
+      Top = 6
+      Width = 234
+      Height = 13
+      Caption = 'Press "W" or "S" to navigate or "Enter" to select '
+    end
+    object ShowTitleCheckbox: TCheckBox
+      Left = 8
+      Top = 6
+      Width = 81
+      Height = 17
+      Caption = 'Show Title'
+      Checked = True
+      State = cbChecked
+      TabOrder = 0
+      OnClick = ShowTitleCheckboxClick
+      OnKeyPress = FormKeyPress
+    end
+  end
+  object GLScene1: TGLScene
+    Left = 40
+    Top = 8
+    object GLDummyCube1: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      object GLCube1: TGLCube
+        Position.Coordinates = {0000803F00000000000000000000803F}
+      end
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = GLDummyCube1
+      Position.Coordinates = {0000404000004040000040400000803F}
+      object GLLightSource1: TGLLightSource
+        ConstAttenuation = 1.000000000000000000
+        Position.Coordinates = {0000204100002041000020410000803F}
+        SpotCutOff = 180.000000000000000000
+      end
+    end
+  end
+  object GLWindowsBitmapFont1: TGLWindowsBitmapFont
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWhite
+    Font.Height = -32
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Left = 128
+    Top = 8
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 40
+    Top = 72
+  end
+  object GLMaterialLibrary1: TGLMaterialLibrary
+    Materials = <
+      item
+        Name = 'LibMaterial'
+        Tag = 0
+        Material.Texture.Disabled = False
+      end>
+    Left = 128
+    Top = 72
+  end
+end

+ 145 - 145
Demos/Delphi/interface/GameMenu/UnitM.pas → Demos/Delphi/interface/GameMenu/fGameMenu.pas

@@ -1,145 +1,145 @@
-unit UnitM;
-
-interface
-
-uses
-  Winapi.Windows,
-  Winapi.OpenGL,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.ExtCtrls,
-  Vcl.Dialogs,
-  Vcl.StdCtrls,
-  Vcl.Imaging.Jpeg,
-
-  
-  GLS.Scene,
-  GLS.Objects,
-  GLS.VectorTypes,
-  GLS.SceneViewer,
-  GLS.GeomObjects,
-  GLS.BitmapFont,
-  GLS.WindowsFont,
-  GLS.GameMenu,
-  GLS.Cadencer,
-  GLS.Texture,
-  GLS.Keyboard,
- 
-  GLS.Material,
-  GLS.Coordinates,
-  GLS.BaseClasses,
-  GLS.Utils;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    GLCamera1: TGLCamera;
-    GLDummyCube1: TGLDummyCube;
-    GLLightSource1: TGLLightSource;
-    GLWindowsBitmapFont1: TGLWindowsBitmapFont;
-    GLCadencer1: TGLCadencer;
-    GLMaterialLibrary1: TGLMaterialLibrary;
-    GLCube1: TGLCube;
-    MainPanel: TPanel;
-    ShowTitleCheckbox: TCheckBox;
-    Label1: TLabel;
-    procedure FormCreate(Sender: TObject);
-    procedure FormKeyPress(Sender: TObject; var Key: Char);
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
-    procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
-      X, Y: Integer);
-    procedure GLSceneViewer1MouseDown(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-    procedure ShowTitleCheckboxClick(Sender: TObject);
-    procedure MainPanelResize(Sender: TObject);
-  private
-     
-  public
-     
-    GameMenu: TGLGameMenu;
-  end;
-
-var
-  Form1: TForm1;
-  sMessage: String = 'You have selected the item ';
-  sMenu: String = 'menu line ';
-
-
-implementation
-
-{$R *.dfm}
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-  SetGLSceneMediaDir();
-  GLMaterialLibrary1.Materials[0].Material.Texture.Image.LoadFromFile('GLScene.bmp');
-
-  GameMenu := TGLGameMenu(GLScene1.Objects.AddNewChild(TGLGameMenu));
-  GameMenu.MaterialLibrary := GLMaterialLibrary1;
-  GameMenu.TitleMaterialName := 'LibMaterial';
-  GameMenu.TitleHeight := 80;
-  GameMenu.TitleWidth := 200;
-  GameMenu.Font := GLWindowsBitmapFont1;
-  GameMenu.Items.Add(sMenu+'1');
-  GameMenu.Items.Add(sMenu+'2');
-  GameMenu.Items.Add(sMenu+'3');
-  GameMenu.Items.Add(sMenu+'4');
-  GameMenu.Items.Add(sMenu+'5');
-  GameMenu.Items.Add(sMenu+'6');
-  GameMenu.Spacing := 1;
-  GameMenu.Selected := 0;
-  GameMenu.Position.Y := 200;
-end;
-
-procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
-begin
-  if IsKeyDown('W') then GameMenu.SelectPrev;
-//  if IsKeyDown(VK_UP) then GameMenu.SelectPrev;
-  if IsKeyDown('S') then GameMenu.SelectNext;
-//  if IsKeyDown(VK_DOWN) then GameMenu.SelectNext;
-  if IsKeyDown(VK_RETURN) then
-  begin
-    if GameMenu.Selected <> -1 then
-      ShowMessage(sMessage + '"'+GameMenu.SelectedText+ '"');
-  end;
-end;
-
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
-begin
-  GLSceneViewer1.Invalidate;
-end;
-
-procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
-  Shift: TShiftState; X, Y: Integer);
-begin
-  GameMenu.MouseMenuSelect(X, Y);
-end;
-
-procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  GameMenu.MouseMenuSelect(X, Y);
-  if GameMenu.Selected <> -1 then
-    ShowMessage(sMessage + '"'+GameMenu.SelectedText+'"');
-end;
-
-procedure TForm1.ShowTitleCheckboxClick(Sender: TObject);
-begin
-  if GameMenu.TitleHeight = 0 then
-    GameMenu.TitleHeight := 80
-  else
-   GameMenu.TitleHeight := 0;
-end;
-
-procedure TForm1.MainPanelResize(Sender: TObject);
-begin
-  GameMenu.Position.X := MainPanel.Width div 2;
-end;
-
-end.
+unit fGameMenu;
+
+interface
+
+uses
+  Winapi.Windows,
+  Winapi.OpenGL,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.ExtCtrls,
+  Vcl.Dialogs,
+  Vcl.StdCtrls,
+  Vcl.Imaging.Jpeg,
+
+  
+  GLS.Scene,
+  GLS.Objects,
+  GLS.VectorTypes,
+  GLS.SceneViewer,
+  GLS.GeomObjects,
+  GLS.BitmapFont,
+  GLS.WindowsFont,
+  GLS.GameMenu,
+  GLS.Cadencer,
+  GLS.Texture,
+  GLS.Keyboard,
+ 
+  GLS.Material,
+  GLS.Coordinates,
+  GLS.BaseClasses,
+  GLS.Utils;
+
+type
+  TFormGameMenu = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    GLCamera1: TGLCamera;
+    GLDummyCube1: TGLDummyCube;
+    GLLightSource1: TGLLightSource;
+    GLWindowsBitmapFont1: TGLWindowsBitmapFont;
+    GLCadencer1: TGLCadencer;
+    GLMaterialLibrary1: TGLMaterialLibrary;
+    GLCube1: TGLCube;
+    MainPanel: TPanel;
+    ShowTitleCheckbox: TCheckBox;
+    Label1: TLabel;
+    procedure FormCreate(Sender: TObject);
+    procedure FormKeyPress(Sender: TObject; var Key: Char);
+    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
+      newTime: Double);
+    procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
+      X, Y: Integer);
+    procedure GLSceneViewer1MouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure ShowTitleCheckboxClick(Sender: TObject);
+    procedure MainPanelResize(Sender: TObject);
+  private
+     
+  public
+     
+    GameMenu: TGLGameMenu;
+  end;
+
+var
+  FormGameMenu: TFormGameMenu;
+  sMessage: String = 'You have selected the item ';
+  sMenu: String = 'menu line ';
+
+
+implementation
+
+{$R *.dfm}
+
+procedure TFormGameMenu.FormCreate(Sender: TObject);
+begin
+  SetGLSceneMediaDir();
+  GLMaterialLibrary1.Materials[0].Material.Texture.Image.LoadFromFile('GLScene.bmp');
+
+  GameMenu := TGLGameMenu(GLScene1.Objects.AddNewChild(TGLGameMenu));
+  GameMenu.MaterialLibrary := GLMaterialLibrary1;
+  GameMenu.TitleMaterialName := 'LibMaterial';
+  GameMenu.TitleHeight := 80;
+  GameMenu.TitleWidth := 200;
+  GameMenu.Font := GLWindowsBitmapFont1;
+  GameMenu.Items.Add(sMenu+'1');
+  GameMenu.Items.Add(sMenu+'2');
+  GameMenu.Items.Add(sMenu+'3');
+  GameMenu.Items.Add(sMenu+'4');
+  GameMenu.Items.Add(sMenu+'5');
+  GameMenu.Items.Add(sMenu+'6');
+  GameMenu.Spacing := 1;
+  GameMenu.Selected := 0;
+  GameMenu.Position.Y := 200;
+end;
+
+procedure TFormGameMenu.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+  if IsKeyDown('W') then GameMenu.SelectPrev;
+//  if IsKeyDown(VK_UP) then GameMenu.SelectPrev;
+  if IsKeyDown('S') then GameMenu.SelectNext;
+//  if IsKeyDown(VK_DOWN) then GameMenu.SelectNext;
+  if IsKeyDown(VK_RETURN) then
+  begin
+    if GameMenu.Selected <> -1 then
+      ShowMessage(sMessage + '"'+GameMenu.SelectedText+ '"');
+  end;
+end;
+
+procedure TFormGameMenu.GLCadencer1Progress(Sender: TObject; const deltaTime,
+  newTime: Double);
+begin
+  GLSceneViewer1.Invalidate;
+end;
+
+procedure TFormGameMenu.GLSceneViewer1MouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  GameMenu.MouseMenuSelect(X, Y);
+end;
+
+procedure TFormGameMenu.GLSceneViewer1MouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  GameMenu.MouseMenuSelect(X, Y);
+  if GameMenu.Selected <> -1 then
+    ShowMessage(sMessage + '"'+GameMenu.SelectedText+'"');
+end;
+
+procedure TFormGameMenu.ShowTitleCheckboxClick(Sender: TObject);
+begin
+  if GameMenu.TitleHeight = 0 then
+    GameMenu.TitleHeight := 80
+  else
+   GameMenu.TitleHeight := 0;
+end;
+
+procedure TFormGameMenu.MainPanelResize(Sender: TObject);
+begin
+  GameMenu.Position.X := MainPanel.Width div 2;
+end;
+
+end.

+ 858 - 858
Demos/Delphi/interface/GuiPaint/Unit1.dfm → Demos/Delphi/interface/GuiPaint/fGuiPaint.dfm

@@ -1,858 +1,858 @@
-object Form1: TForm1
-  Left = 182
-  Top = 91
-  Caption = 'Gui Paint'
-  ClientHeight = 446
-  ClientWidth = 499
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  Menu = MainMenu1
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  OnKeyDown = FormKeyDown
-  OnKeyPress = FormKeyPress
-  OnKeyUp = FormKeyUp
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 499
-    Height = 446
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clBlack
-    FieldOfView = 154.724838256835900000
-    PenAsTouch = False
-    Align = alClient
-    OnMouseDown = GLSceneViewer1MouseDown
-    OnMouseMove = GLSceneViewer1MouseMove
-    OnMouseUp = GLSceneViewer1MouseUp
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    ObjectsSorting = osNone
-    Left = 32
-    Top = 16
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000204100002041000020410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object GuiRoot: TGLBaseControl
-      Autosize = False
-      RedrawAtOnce = False
-      Rotation = 0.000000000000000000
-      NoZWrite = False
-      DoChangesOnProgress = False
-      Width = 10000.000000000000000000
-      Height = 10000.000000000000000000
-      object GLForm1: TGLForm
-        Autosize = False
-        RedrawAtOnce = False
-        GuiLayout = GLGuiLayout1
-        GuiLayoutName = 'form'
-        Rotation = 0.000000000000000000
-        AlphaChannel = 0.500000000000000000
-        NoZWrite = False
-        DoChangesOnProgress = False
-        Width = 300.000000000000000000
-        Height = 300.000000000000000000
-        Left = 100.000000000000000000
-        Top = 100.000000000000000000
-        Position.Coordinates = {0000C8420000C842000000000000803F}
-        BitmapFont = WindowsBitmapFont1
-        DefaultColor = clMaroon
-        Caption = 'Paint'
-        TitleColor = clWhite
-        OnMoving = GLForm1Moving
-        TitleOffset = 2.000000000000000000
-        object PenButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 40.000000000000000000
-          Height = 40.000000000000000000
-          Left = 10.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {0000DC4200000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 1
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Pen'
-          Pressed = True
-          OnButtonClick = PenButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 24.000000000000000000
-          LogicHeight = 20.000000000000000000
-          YOffset = 1.000000000000000000
-          AllowUp = True
-        end
-        object BrushButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 40.000000000000000000
-          Height = 40.000000000000000000
-          Left = 50.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {0000164300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 1
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Brush'
-          Pressed = False
-          OnButtonClick = BrushButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 22.000000000000000000
-          LogicHeight = 20.000000000000000000
-          YOffset = 1.000000000000000000
-          AllowUp = True
-        end
-        object GLPanel1: TGLPanel
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 280.000000000000000000
-          Height = 214.000000000000000000
-          Left = 10.000000000000000000
-          Top = 76.000000000000000000
-          Position.Coordinates = {0000DC4200003043000000000000803F}
-          object GLCanvas: TGLCustomControl
-            Autosize = False
-            RedrawAtOnce = False
-            GuiLayout = GLGuiLayout1
-            GuiLayoutName = 'button'
-            Rotation = 0.000000000000000000
-            NoZWrite = False
-            DoChangesOnProgress = False
-            Width = 274.000000000000000000
-            Height = 208.000000000000000000
-            Left = 3.000000000000000000
-            Top = 3.000000000000000000
-            Position.Coordinates = {0000E24200003343000000000000803F}
-            OnMouseDown = GLCanvasMouseDown
-            OnMouseMove = GLCanvasMouseMove
-            OnMouseUp = GLCanvasMouseUp
-            OnAcceptMouseQuery = GLCanvasAcceptMouseQuery
-            BitmapFont = WindowsBitmapFont1
-            DefaultColor = clBlack
-            Focused = False
-            FocusedColor = clBlack
-            OnRender = GLCanvasRender
-            Centered = False
-            MaxInvalidRenderCount = 0
-          end
-        end
-        object WhiteButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 20.000000000000000000
-          Height = 20.000000000000000000
-          Left = 90.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {00003E4300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 2
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'White'
-          Pressed = False
-          OnButtonClick = WhiteButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 13.000000000000000000
-          LogicHeight = 10.000000000000000000
-          AllowUp = True
-        end
-        object BlackButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 20.000000000000000000
-          Height = 20.000000000000000000
-          Left = 110.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {0000524300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 2
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Black'
-          Pressed = True
-          OnButtonClick = BlackButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 13.000000000000000000
-          LogicHeight = 10.000000000000000000
-          AllowUp = True
-        end
-        object RedButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 20.000000000000000000
-          Height = 20.000000000000000000
-          Left = 130.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {0000664300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 2
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Red'
-          Pressed = False
-          OnButtonClick = RedButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 13.000000000000000000
-          LogicHeight = 10.000000000000000000
-          AllowUp = True
-        end
-        object GreenButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 20.000000000000000000
-          Height = 20.000000000000000000
-          Left = 150.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {00007A4300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 2
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Green'
-          Pressed = False
-          OnButtonClick = GreenButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 13.000000000000000000
-          LogicHeight = 10.000000000000000000
-          AllowUp = True
-        end
-        object BlueButton: TGLButton
-          Autosize = False
-          RedrawAtOnce = False
-          GuiLayout = GLGuiLayout1
-          GuiLayoutName = 'button'
-          Rotation = 0.000000000000000000
-          NoZWrite = False
-          DoChangesOnProgress = False
-          Width = 20.000000000000000000
-          Height = 20.000000000000000000
-          Left = 170.000000000000000000
-          Top = 32.000000000000000000
-          Position.Coordinates = {0000874300000443000000000000803F}
-          BitmapFont = WindowsBitmapFont1
-          DefaultColor = clBlack
-          Focused = False
-          FocusedColor = clBlack
-          Group = 2
-          BitBtn.MaterialLibrary = GLMaterialLibrary1
-          BitBtn.LibMaterialName = 'Blue'
-          Pressed = False
-          OnButtonClick = BlueButtonButtonClick
-          GuiLayoutNamePressed = 'buttonpressed'
-          LogicWidth = 13.000000000000000000
-          LogicHeight = 10.000000000000000000
-          AllowUp = True
-        end
-      end
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      Position.Coordinates = {0000A04000004040000080400000803F}
-      Left = 240
-      Top = 152
-    end
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 32
-    Top = 80
-  end
-  object Timer1: TTimer
-    OnTimer = Timer1Timer
-    Left = 304
-    Top = 16
-  end
-  object WindowsBitmapFont1: TGLWindowsBitmapFont
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWhite
-    Font.Height = -12
-    Font.Name = 'MS Sans Serif'
-    Font.Style = []
-    Left = 224
-    Top = 16
-  end
-  object MainMenu1: TMainMenu
-    Left = 368
-    Top = 16
-    object File1: TMenuItem
-      Caption = '&File'
-      object miOpen1: TMenuItem
-        Caption = '&Open...'
-        OnClick = miOpen1Click
-      end
-      object miSave1: TMenuItem
-        Caption = '&Save...'
-        OnClick = miSave1Click
-      end
-    end
-    object Font1: TMenuItem
-      Caption = 'Font'
-      object miWindowsFont1: TMenuItem
-        Caption = 'Set New Font...'
-        OnClick = miWindowsFont1Click
-      end
-    end
-    object miFPS: TMenuItem
-      Caption = 'FPS'
-    end
-  end
-  object FontDialog1: TFontDialog
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -11
-    Font.Name = 'MS Sans Serif'
-    Font.Style = []
-    Left = 440
-    Top = 16
-  end
-  object GLGuiLayout1: TGLGuiLayout
-    BitmapFont = WindowsBitmapFont1
-    Material.MaterialLibrary = GLMaterialLibrary1
-    Material.LibMaterialName = 'Gui'
-    GuiComponents = <
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {00003041000082420000000000000000}
-            BottomRight.Coordinates = {000020420000BC420000000000000000}
-            Align = GLAlCenter
-            Name = 'center1'
-          end
-          item
-            BottomRight.Coordinates = {000088410000F0410000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00008841000000000000000000000000}
-            BottomRight.Coordinates = {0000E0420000F0410000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {000000000000F8410000000000000000}
-            BottomRight.Coordinates = {000000410000DA420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {0000E042000000000000000000000000}
-            BottomRight.Coordinates = {000000430000F0410000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {0000F0420000F0410000000000000000}
-            BottomRight.Coordinates = {000000430000DE420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {000000000000E2420000000000000000}
-            BottomRight.Coordinates = {00007041000000430000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {000070410000F0420000000000000000}
-            BottomRight.Coordinates = {0000E242000000430000000000000000}
-            Align = GLAlBottom
-            Name = 'Bottom1'
-          end
-          item
-            TopLeft.Coordinates = {0000E2420000E2420000000000000000}
-            BottomRight.Coordinates = {00000043000000430000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'form'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {00003041000082420000000000000000}
-            BottomRight.Coordinates = {000020420000BC420000000000000000}
-            Align = GLAlCenter
-            Name = 'center1'
-          end
-          item
-            TopLeft.Coordinates = {00000041000078420000000000000000}
-            BottomRight.Coordinates = {00005041000086420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00003041000078420000000000000000}
-            BottomRight.Coordinates = {00002042000084420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {00000041000082420000000000000000}
-            BottomRight.Coordinates = {000040410000BC420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {00001842000078420000000000000000}
-            BottomRight.Coordinates = {00002C42000086420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {00001C42000082420000000000000000}
-            BottomRight.Coordinates = {00002C420000BC420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {000000410000B8420000000000000000}
-            BottomRight.Coordinates = {000050410000C2420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {000030410000BA420000000000000000}
-            BottomRight.Coordinates = {000020420000C2420000000000000000}
-            Align = GLAlBottom
-            Name = 'Bottom1'
-          end
-          item
-            TopLeft.Coordinates = {000018420000B8420000000000000000}
-            BottomRight.Coordinates = {00002C420000C2420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'panel'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {000024420000F8410000000000000000}
-            BottomRight.Coordinates = {00003042000010420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {000030420000F8410000000000000000}
-            BottomRight.Coordinates = {00005842000010420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {000058420000F8410000000000000000}
-            BottomRight.Coordinates = {00006442000010420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {00002442000010420000000000000000}
-            BottomRight.Coordinates = {00003042000034420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {00003042000010420000000000000000}
-            BottomRight.Coordinates = {00005842000030420000000000000000}
-            Align = GLAlCenter
-            Name = 'Center1'
-          end
-          item
-            TopLeft.Coordinates = {00005842000010420000000000000000}
-            BottomRight.Coordinates = {00006442000030420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {00002442000030420000000000000000}
-            BottomRight.Coordinates = {00003042000044420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00003042000030420000000000000000}
-            BottomRight.Coordinates = {00005842000044420000000000000000}
-            Align = GLAlBottom
-            Name = 'Bottom1'
-          end
-          item
-            TopLeft.Coordinates = {00005842000030420000000000000000}
-            BottomRight.Coordinates = {00006442000044420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'button_up'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {000068420000F8410000000000000000}
-            BottomRight.Coordinates = {00007442000010420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {000074420000F8410000000000000000}
-            BottomRight.Coordinates = {00008E42000010420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {00008E420000F8410000000000000000}
-            BottomRight.Coordinates = {00009442000010420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {00006842000010420000000000000000}
-            BottomRight.Coordinates = {00007442000034420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {00007442000010420000000000000000}
-            BottomRight.Coordinates = {00008E42000034420000000000000000}
-            Align = GLAlCenter
-            Name = 'Center1'
-          end
-          item
-            TopLeft.Coordinates = {00008E42000010420000000000000000}
-            BottomRight.Coordinates = {00009442000034420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {00006842000034420000000000000000}
-            BottomRight.Coordinates = {00007442000044420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00007442000034420000000000000000}
-            BottomRight.Coordinates = {00008E42000044420000000000000000}
-            Align = GLAlBottom
-            Name = 'Bottom1'
-          end
-          item
-            TopLeft.Coordinates = {00008E42000034420000000000000000}
-            BottomRight.Coordinates = {00009442000044420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'button_down'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {000096420000F8410000000000000000}
-            BottomRight.Coordinates = {00009A42000004420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00009A420000F8410000000000000000}
-            BottomRight.Coordinates = {0000AE42000004420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE420000F8410000000000000000}
-            BottomRight.Coordinates = {0000B242000004420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {00009642000004420000000000000000}
-            BottomRight.Coordinates = {00009A4200002C420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {00009A42000004420000000000000000}
-            BottomRight.Coordinates = {0000AE4200002C420000000000000000}
-            Align = GLAlCenter
-            Name = 'Center1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE42000004420000000000000000}
-            BottomRight.Coordinates = {0000B24200002C420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {0000964200002C420000000000000000}
-            BottomRight.Coordinates = {00009A42000034420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00009A4200002C420000000000000000}
-            BottomRight.Coordinates = {0000AE42000034420000000000000000}
-            Align = GLAlBottom
-            Name = 'BottomCenter1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE4200002C420000000000000000}
-            BottomRight.Coordinates = {0000B242000034420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'checkbox_checked'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {0000964200003C420000000000000000}
-            BottomRight.Coordinates = {00009A42000044420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00009A4200003C420000000000000000}
-            BottomRight.Coordinates = {0000AE42000044420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE4200003C420000000000000000}
-            BottomRight.Coordinates = {0000B242000044420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {00009642000044420000000000000000}
-            BottomRight.Coordinates = {00009A4200006C420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {00009A42000044420000000000000000}
-            BottomRight.Coordinates = {0000AE4200006C420000000000000000}
-            Align = GLAlCenter
-            Name = 'Center1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE42000044420000000000000000}
-            BottomRight.Coordinates = {0000B24200006C420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {0000964200006C420000000000000000}
-            BottomRight.Coordinates = {00009A42000074420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {00009A4200006C420000000000000000}
-            BottomRight.Coordinates = {0000AE42000074420000000000000000}
-            Align = GLAlBottom
-            Name = 'BottomCenter1'
-          end
-          item
-            TopLeft.Coordinates = {0000AE4200006C420000000000000000}
-            BottomRight.Coordinates = {0000B242000074420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'checkbox_unchecked'
-      end
-      item
-        Elements = <
-          item
-            TopLeft.Coordinates = {0000B44200003C420000000000000000}
-            BottomRight.Coordinates = {0000B842000044420000000000000000}
-            Align = GLAlTopLeft
-            Name = 'TopLeft1'
-          end
-          item
-            TopLeft.Coordinates = {0000B84200003C420000000000000000}
-            BottomRight.Coordinates = {0000CC42000044420000000000000000}
-            Align = GLAlTop
-            Name = 'Top1'
-          end
-          item
-            TopLeft.Coordinates = {0000CC4200003C420000000000000000}
-            BottomRight.Coordinates = {0000D042000044420000000000000000}
-            Align = GLAlTopRight
-            Name = 'TopRight1'
-          end
-          item
-            TopLeft.Coordinates = {0000B442000044420000000000000000}
-            BottomRight.Coordinates = {0000B84200006C420000000000000000}
-            Align = GLAlLeft
-            Name = 'Left1'
-          end
-          item
-            TopLeft.Coordinates = {0000B842000044420000000000000000}
-            BottomRight.Coordinates = {0000CC4200006C420000000000000000}
-            Align = GLAlCenter
-            Name = 'Center1'
-          end
-          item
-            TopLeft.Coordinates = {0000CC42000044420000000000000000}
-            BottomRight.Coordinates = {0000D04200006C420000000000000000}
-            Align = GLAlRight
-            Name = 'Right1'
-          end
-          item
-            TopLeft.Coordinates = {0000B44200006C420000000000000000}
-            BottomRight.Coordinates = {0000B842000074420000000000000000}
-            Align = GLAlBottomLeft
-            Name = 'BottomLeft1'
-          end
-          item
-            TopLeft.Coordinates = {0000B84200006C420000000000000000}
-            BottomRight.Coordinates = {0000CC42000074420000000000000000}
-            Align = GLAlBottom
-            Name = 'BottomCenter1'
-          end
-          item
-            TopLeft.Coordinates = {0000CC4200006C420000000000000000}
-            BottomRight.Coordinates = {0000D042000074420000000000000000}
-            Align = GLAlBottomRight
-            Name = 'BottomRight1'
-          end>
-        Name = 'edit'
-      end>
-    FileName = 'Default.layout'
-    Left = 32
-    Top = 144
-  end
-  object GLMaterialLibrary1: TGLMaterialLibrary
-    Materials = <
-      item
-        Name = 'Gui'
-        Tag = 0
-        Material.Texture.ImageClassName = 'TGLPicFileImage'
-        Material.Texture.Image.PictureFileName = 'defaultskin.bmp'
-        Material.Texture.ImageAlpha = tiaOpaque
-        Material.Texture.TextureMode = tmReplace
-        Material.Texture.Disabled = False
-      end
-      item
-        Name = 'Brush'
-        Tag = 0
-        Material.BlendingMode = bmTransparency
-        Material.Texture.ImageClassName = 'TGLPicFileImage'
-        Material.Texture.Image.PictureFileName = 'brush.bmp'
-        Material.Texture.ImageAlpha = tiaTopLeftPointColorTransparent
-        Material.Texture.TextureMode = tmReplace
-        Material.Texture.Disabled = False
-      end
-      item
-        Name = 'Pen'
-        Tag = 0
-        Material.BlendingMode = bmTransparency
-        Material.Texture.ImageClassName = 'TGLPicFileImage'
-        Material.Texture.Image.PictureFileName = 'pen.bmp'
-        Material.Texture.ImageAlpha = tiaTopLeftPointColorTransparent
-        Material.Texture.TextureMode = tmReplace
-        Material.Texture.Disabled = False
-      end
-      item
-        Name = 'White'
-        Tag = 0
-        Material.FrontProperties.Ambient.Color = {0000803F0000803F0000803F0000803F}
-        Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
-        Material.FrontProperties.Emission.Color = {0000803F0000803F0000803F0000803F}
-        Material.Texture.TextureMode = tmReplace
-      end
-      item
-        Name = 'Black'
-        Tag = 0
-        Material.FrontProperties.Diffuse.Color = {0000000000000000000000000000803F}
-        Material.Texture.TextureMode = tmReplace
-      end
-      item
-        Name = 'Red'
-        Tag = 0
-        Material.FrontProperties.Diffuse.Color = {0000803F00000000000000000000803F}
-      end
-      item
-        Name = 'Green'
-        Tag = 0
-        Material.FrontProperties.Diffuse.Color = {000000000000803F000000000000803F}
-      end
-      item
-        Name = 'Blue'
-        Tag = 0
-        Material.FrontProperties.Diffuse.Color = {00000000000000000000803F0000803F}
-      end>
-    Left = 120
-    Top = 16
-  end
-  object OpenDialog1: TOpenDialog
-    DefaultExt = 'bmp'
-    Filter = 'Bitmaps|*.bmp'
-    Title = 'Open Bitmap'
-    Left = 448
-    Top = 80
-  end
-  object SaveDialog1: TSaveDialog
-    DefaultExt = 'bmp'
-    Filter = 'Bitmaps|*.bmp'
-    Title = 'Save Bitmap'
-    Left = 448
-    Top = 136
-  end
-end
+object FormGuiPaint: TFormGuiPaint
+  Left = 182
+  Top = 91
+  Caption = 'Gui Paint'
+  ClientHeight = 446
+  ClientWidth = 499
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  Menu = MainMenu1
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  OnKeyDown = FormKeyDown
+  OnKeyPress = FormKeyPress
+  OnKeyUp = FormKeyUp
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 499
+    Height = 446
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clBlack
+    FieldOfView = 154.724838256835900000
+    PenAsTouch = False
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    OnMouseUp = GLSceneViewer1MouseUp
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    ObjectsSorting = osNone
+    Left = 32
+    Top = 16
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000204100002041000020410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object GuiRoot: TGLBaseControl
+      Autosize = False
+      RedrawAtOnce = False
+      Rotation = 0.000000000000000000
+      NoZWrite = False
+      DoChangesOnProgress = False
+      Width = 10000.000000000000000000
+      Height = 10000.000000000000000000
+      object GLForm1: TGLForm
+        Autosize = False
+        RedrawAtOnce = False
+        GuiLayout = GLGuiLayout1
+        GuiLayoutName = 'form'
+        Rotation = 0.000000000000000000
+        AlphaChannel = 0.500000000000000000
+        NoZWrite = False
+        DoChangesOnProgress = False
+        Width = 300.000000000000000000
+        Height = 300.000000000000000000
+        Left = 100.000000000000000000
+        Top = 100.000000000000000000
+        Position.Coordinates = {0000C8420000C842000000000000803F}
+        BitmapFont = WindowsBitmapFont1
+        DefaultColor = clMaroon
+        Caption = 'Paint'
+        TitleColor = clWhite
+        OnMoving = GLForm1Moving
+        TitleOffset = 2.000000000000000000
+        object PenButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 40.000000000000000000
+          Height = 40.000000000000000000
+          Left = 10.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {0000DC4200000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 1
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Pen'
+          Pressed = True
+          OnButtonClick = PenButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 24.000000000000000000
+          LogicHeight = 20.000000000000000000
+          YOffset = 1.000000000000000000
+          AllowUp = True
+        end
+        object BrushButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 40.000000000000000000
+          Height = 40.000000000000000000
+          Left = 50.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {0000164300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 1
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Brush'
+          Pressed = False
+          OnButtonClick = BrushButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 22.000000000000000000
+          LogicHeight = 20.000000000000000000
+          YOffset = 1.000000000000000000
+          AllowUp = True
+        end
+        object GLPanel1: TGLPanel
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 280.000000000000000000
+          Height = 214.000000000000000000
+          Left = 10.000000000000000000
+          Top = 76.000000000000000000
+          Position.Coordinates = {0000DC4200003043000000000000803F}
+          object GLCanvas: TGLCustomControl
+            Autosize = False
+            RedrawAtOnce = False
+            GuiLayout = GLGuiLayout1
+            GuiLayoutName = 'button'
+            Rotation = 0.000000000000000000
+            NoZWrite = False
+            DoChangesOnProgress = False
+            Width = 274.000000000000000000
+            Height = 208.000000000000000000
+            Left = 3.000000000000000000
+            Top = 3.000000000000000000
+            Position.Coordinates = {0000E24200003343000000000000803F}
+            OnMouseDown = GLCanvasMouseDown
+            OnMouseMove = GLCanvasMouseMove
+            OnMouseUp = GLCanvasMouseUp
+            OnAcceptMouseQuery = GLCanvasAcceptMouseQuery
+            BitmapFont = WindowsBitmapFont1
+            DefaultColor = clBlack
+            Focused = False
+            FocusedColor = clBlack
+            OnRender = GLCanvasRender
+            Centered = False
+            MaxInvalidRenderCount = 0
+          end
+        end
+        object WhiteButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 20.000000000000000000
+          Height = 20.000000000000000000
+          Left = 90.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {00003E4300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 2
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'White'
+          Pressed = False
+          OnButtonClick = WhiteButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 13.000000000000000000
+          LogicHeight = 10.000000000000000000
+          AllowUp = True
+        end
+        object BlackButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 20.000000000000000000
+          Height = 20.000000000000000000
+          Left = 110.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {0000524300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 2
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Black'
+          Pressed = True
+          OnButtonClick = BlackButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 13.000000000000000000
+          LogicHeight = 10.000000000000000000
+          AllowUp = True
+        end
+        object RedButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 20.000000000000000000
+          Height = 20.000000000000000000
+          Left = 130.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {0000664300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 2
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Red'
+          Pressed = False
+          OnButtonClick = RedButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 13.000000000000000000
+          LogicHeight = 10.000000000000000000
+          AllowUp = True
+        end
+        object GreenButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 20.000000000000000000
+          Height = 20.000000000000000000
+          Left = 150.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {00007A4300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 2
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Green'
+          Pressed = False
+          OnButtonClick = GreenButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 13.000000000000000000
+          LogicHeight = 10.000000000000000000
+          AllowUp = True
+        end
+        object BlueButton: TGLButton
+          Autosize = False
+          RedrawAtOnce = False
+          GuiLayout = GLGuiLayout1
+          GuiLayoutName = 'button'
+          Rotation = 0.000000000000000000
+          NoZWrite = False
+          DoChangesOnProgress = False
+          Width = 20.000000000000000000
+          Height = 20.000000000000000000
+          Left = 170.000000000000000000
+          Top = 32.000000000000000000
+          Position.Coordinates = {0000874300000443000000000000803F}
+          BitmapFont = WindowsBitmapFont1
+          DefaultColor = clBlack
+          Focused = False
+          FocusedColor = clBlack
+          Group = 2
+          BitBtn.MaterialLibrary = GLMaterialLibrary1
+          BitBtn.LibMaterialName = 'Blue'
+          Pressed = False
+          OnButtonClick = BlueButtonButtonClick
+          GuiLayoutNamePressed = 'buttonpressed'
+          LogicWidth = 13.000000000000000000
+          LogicHeight = 10.000000000000000000
+          AllowUp = True
+        end
+      end
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      Position.Coordinates = {0000A04000004040000080400000803F}
+      Left = 240
+      Top = 152
+    end
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 32
+    Top = 80
+  end
+  object Timer1: TTimer
+    OnTimer = Timer1Timer
+    Left = 304
+    Top = 16
+  end
+  object WindowsBitmapFont1: TGLWindowsBitmapFont
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWhite
+    Font.Height = -12
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Left = 224
+    Top = 16
+  end
+  object MainMenu1: TMainMenu
+    Left = 368
+    Top = 16
+    object File1: TMenuItem
+      Caption = '&File'
+      object miOpen1: TMenuItem
+        Caption = '&Open...'
+        OnClick = miOpen1Click
+      end
+      object miSave1: TMenuItem
+        Caption = '&Save...'
+        OnClick = miSave1Click
+      end
+    end
+    object Font1: TMenuItem
+      Caption = 'Font'
+      object miWindowsFont1: TMenuItem
+        Caption = 'Set New Font...'
+        OnClick = miWindowsFont1Click
+      end
+    end
+    object miFPS: TMenuItem
+      Caption = 'FPS'
+    end
+  end
+  object FontDialog1: TFontDialog
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -11
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Left = 440
+    Top = 16
+  end
+  object GLGuiLayout1: TGLGuiLayout
+    BitmapFont = WindowsBitmapFont1
+    Material.MaterialLibrary = GLMaterialLibrary1
+    Material.LibMaterialName = 'Gui'
+    GuiComponents = <
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {00003041000082420000000000000000}
+            BottomRight.Coordinates = {000020420000BC420000000000000000}
+            Align = GLAlCenter
+            Name = 'center1'
+          end
+          item
+            BottomRight.Coordinates = {000088410000F0410000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00008841000000000000000000000000}
+            BottomRight.Coordinates = {0000E0420000F0410000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {000000000000F8410000000000000000}
+            BottomRight.Coordinates = {000000410000DA420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {0000E042000000000000000000000000}
+            BottomRight.Coordinates = {000000430000F0410000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {0000F0420000F0410000000000000000}
+            BottomRight.Coordinates = {000000430000DE420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {000000000000E2420000000000000000}
+            BottomRight.Coordinates = {00007041000000430000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {000070410000F0420000000000000000}
+            BottomRight.Coordinates = {0000E242000000430000000000000000}
+            Align = GLAlBottom
+            Name = 'Bottom1'
+          end
+          item
+            TopLeft.Coordinates = {0000E2420000E2420000000000000000}
+            BottomRight.Coordinates = {00000043000000430000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'form'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {00003041000082420000000000000000}
+            BottomRight.Coordinates = {000020420000BC420000000000000000}
+            Align = GLAlCenter
+            Name = 'center1'
+          end
+          item
+            TopLeft.Coordinates = {00000041000078420000000000000000}
+            BottomRight.Coordinates = {00005041000086420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00003041000078420000000000000000}
+            BottomRight.Coordinates = {00002042000084420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {00000041000082420000000000000000}
+            BottomRight.Coordinates = {000040410000BC420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {00001842000078420000000000000000}
+            BottomRight.Coordinates = {00002C42000086420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {00001C42000082420000000000000000}
+            BottomRight.Coordinates = {00002C420000BC420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {000000410000B8420000000000000000}
+            BottomRight.Coordinates = {000050410000C2420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {000030410000BA420000000000000000}
+            BottomRight.Coordinates = {000020420000C2420000000000000000}
+            Align = GLAlBottom
+            Name = 'Bottom1'
+          end
+          item
+            TopLeft.Coordinates = {000018420000B8420000000000000000}
+            BottomRight.Coordinates = {00002C420000C2420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'panel'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {000024420000F8410000000000000000}
+            BottomRight.Coordinates = {00003042000010420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {000030420000F8410000000000000000}
+            BottomRight.Coordinates = {00005842000010420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {000058420000F8410000000000000000}
+            BottomRight.Coordinates = {00006442000010420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {00002442000010420000000000000000}
+            BottomRight.Coordinates = {00003042000034420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {00003042000010420000000000000000}
+            BottomRight.Coordinates = {00005842000030420000000000000000}
+            Align = GLAlCenter
+            Name = 'Center1'
+          end
+          item
+            TopLeft.Coordinates = {00005842000010420000000000000000}
+            BottomRight.Coordinates = {00006442000030420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {00002442000030420000000000000000}
+            BottomRight.Coordinates = {00003042000044420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00003042000030420000000000000000}
+            BottomRight.Coordinates = {00005842000044420000000000000000}
+            Align = GLAlBottom
+            Name = 'Bottom1'
+          end
+          item
+            TopLeft.Coordinates = {00005842000030420000000000000000}
+            BottomRight.Coordinates = {00006442000044420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'button_up'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {000068420000F8410000000000000000}
+            BottomRight.Coordinates = {00007442000010420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {000074420000F8410000000000000000}
+            BottomRight.Coordinates = {00008E42000010420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {00008E420000F8410000000000000000}
+            BottomRight.Coordinates = {00009442000010420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {00006842000010420000000000000000}
+            BottomRight.Coordinates = {00007442000034420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {00007442000010420000000000000000}
+            BottomRight.Coordinates = {00008E42000034420000000000000000}
+            Align = GLAlCenter
+            Name = 'Center1'
+          end
+          item
+            TopLeft.Coordinates = {00008E42000010420000000000000000}
+            BottomRight.Coordinates = {00009442000034420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {00006842000034420000000000000000}
+            BottomRight.Coordinates = {00007442000044420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00007442000034420000000000000000}
+            BottomRight.Coordinates = {00008E42000044420000000000000000}
+            Align = GLAlBottom
+            Name = 'Bottom1'
+          end
+          item
+            TopLeft.Coordinates = {00008E42000034420000000000000000}
+            BottomRight.Coordinates = {00009442000044420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'button_down'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {000096420000F8410000000000000000}
+            BottomRight.Coordinates = {00009A42000004420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00009A420000F8410000000000000000}
+            BottomRight.Coordinates = {0000AE42000004420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE420000F8410000000000000000}
+            BottomRight.Coordinates = {0000B242000004420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {00009642000004420000000000000000}
+            BottomRight.Coordinates = {00009A4200002C420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {00009A42000004420000000000000000}
+            BottomRight.Coordinates = {0000AE4200002C420000000000000000}
+            Align = GLAlCenter
+            Name = 'Center1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE42000004420000000000000000}
+            BottomRight.Coordinates = {0000B24200002C420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {0000964200002C420000000000000000}
+            BottomRight.Coordinates = {00009A42000034420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00009A4200002C420000000000000000}
+            BottomRight.Coordinates = {0000AE42000034420000000000000000}
+            Align = GLAlBottom
+            Name = 'BottomCenter1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE4200002C420000000000000000}
+            BottomRight.Coordinates = {0000B242000034420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'checkbox_checked'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {0000964200003C420000000000000000}
+            BottomRight.Coordinates = {00009A42000044420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00009A4200003C420000000000000000}
+            BottomRight.Coordinates = {0000AE42000044420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE4200003C420000000000000000}
+            BottomRight.Coordinates = {0000B242000044420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {00009642000044420000000000000000}
+            BottomRight.Coordinates = {00009A4200006C420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {00009A42000044420000000000000000}
+            BottomRight.Coordinates = {0000AE4200006C420000000000000000}
+            Align = GLAlCenter
+            Name = 'Center1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE42000044420000000000000000}
+            BottomRight.Coordinates = {0000B24200006C420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {0000964200006C420000000000000000}
+            BottomRight.Coordinates = {00009A42000074420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {00009A4200006C420000000000000000}
+            BottomRight.Coordinates = {0000AE42000074420000000000000000}
+            Align = GLAlBottom
+            Name = 'BottomCenter1'
+          end
+          item
+            TopLeft.Coordinates = {0000AE4200006C420000000000000000}
+            BottomRight.Coordinates = {0000B242000074420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'checkbox_unchecked'
+      end
+      item
+        Elements = <
+          item
+            TopLeft.Coordinates = {0000B44200003C420000000000000000}
+            BottomRight.Coordinates = {0000B842000044420000000000000000}
+            Align = GLAlTopLeft
+            Name = 'TopLeft1'
+          end
+          item
+            TopLeft.Coordinates = {0000B84200003C420000000000000000}
+            BottomRight.Coordinates = {0000CC42000044420000000000000000}
+            Align = GLAlTop
+            Name = 'Top1'
+          end
+          item
+            TopLeft.Coordinates = {0000CC4200003C420000000000000000}
+            BottomRight.Coordinates = {0000D042000044420000000000000000}
+            Align = GLAlTopRight
+            Name = 'TopRight1'
+          end
+          item
+            TopLeft.Coordinates = {0000B442000044420000000000000000}
+            BottomRight.Coordinates = {0000B84200006C420000000000000000}
+            Align = GLAlLeft
+            Name = 'Left1'
+          end
+          item
+            TopLeft.Coordinates = {0000B842000044420000000000000000}
+            BottomRight.Coordinates = {0000CC4200006C420000000000000000}
+            Align = GLAlCenter
+            Name = 'Center1'
+          end
+          item
+            TopLeft.Coordinates = {0000CC42000044420000000000000000}
+            BottomRight.Coordinates = {0000D04200006C420000000000000000}
+            Align = GLAlRight
+            Name = 'Right1'
+          end
+          item
+            TopLeft.Coordinates = {0000B44200006C420000000000000000}
+            BottomRight.Coordinates = {0000B842000074420000000000000000}
+            Align = GLAlBottomLeft
+            Name = 'BottomLeft1'
+          end
+          item
+            TopLeft.Coordinates = {0000B84200006C420000000000000000}
+            BottomRight.Coordinates = {0000CC42000074420000000000000000}
+            Align = GLAlBottom
+            Name = 'BottomCenter1'
+          end
+          item
+            TopLeft.Coordinates = {0000CC4200006C420000000000000000}
+            BottomRight.Coordinates = {0000D042000074420000000000000000}
+            Align = GLAlBottomRight
+            Name = 'BottomRight1'
+          end>
+        Name = 'edit'
+      end>
+    FileName = 'Default.layout'
+    Left = 32
+    Top = 144
+  end
+  object GLMaterialLibrary1: TGLMaterialLibrary
+    Materials = <
+      item
+        Name = 'Gui'
+        Tag = 0
+        Material.Texture.ImageClassName = 'TGLPicFileImage'
+        Material.Texture.Image.PictureFileName = 'defaultskin.bmp'
+        Material.Texture.ImageAlpha = tiaOpaque
+        Material.Texture.TextureMode = tmReplace
+        Material.Texture.Disabled = False
+      end
+      item
+        Name = 'Brush'
+        Tag = 0
+        Material.BlendingMode = bmTransparency
+        Material.Texture.ImageClassName = 'TGLPicFileImage'
+        Material.Texture.Image.PictureFileName = 'brush.bmp'
+        Material.Texture.ImageAlpha = tiaTopLeftPointColorTransparent
+        Material.Texture.TextureMode = tmReplace
+        Material.Texture.Disabled = False
+      end
+      item
+        Name = 'Pen'
+        Tag = 0
+        Material.BlendingMode = bmTransparency
+        Material.Texture.ImageClassName = 'TGLPicFileImage'
+        Material.Texture.Image.PictureFileName = 'pen.bmp'
+        Material.Texture.ImageAlpha = tiaTopLeftPointColorTransparent
+        Material.Texture.TextureMode = tmReplace
+        Material.Texture.Disabled = False
+      end
+      item
+        Name = 'White'
+        Tag = 0
+        Material.FrontProperties.Ambient.Color = {0000803F0000803F0000803F0000803F}
+        Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
+        Material.FrontProperties.Emission.Color = {0000803F0000803F0000803F0000803F}
+        Material.Texture.TextureMode = tmReplace
+      end
+      item
+        Name = 'Black'
+        Tag = 0
+        Material.FrontProperties.Diffuse.Color = {0000000000000000000000000000803F}
+        Material.Texture.TextureMode = tmReplace
+      end
+      item
+        Name = 'Red'
+        Tag = 0
+        Material.FrontProperties.Diffuse.Color = {0000803F00000000000000000000803F}
+      end
+      item
+        Name = 'Green'
+        Tag = 0
+        Material.FrontProperties.Diffuse.Color = {000000000000803F000000000000803F}
+      end
+      item
+        Name = 'Blue'
+        Tag = 0
+        Material.FrontProperties.Diffuse.Color = {00000000000000000000803F0000803F}
+      end>
+    Left = 120
+    Top = 16
+  end
+  object OpenDialog1: TOpenDialog
+    DefaultExt = 'bmp'
+    Filter = 'Bitmaps|*.bmp'
+    Title = 'Open Bitmap'
+    Left = 448
+    Top = 80
+  end
+  object SaveDialog1: TSaveDialog
+    DefaultExt = 'bmp'
+    Filter = 'Bitmaps|*.bmp'
+    Title = 'Save Bitmap'
+    Left = 448
+    Top = 136
+  end
+end

+ 306 - 306
Demos/Delphi/interface/GuiPaint/Unit1.pas → Demos/Delphi/interface/GuiPaint/fGuiPaint.pas

@@ -1,306 +1,306 @@
-unit Unit1;
-
-interface
-
-uses
-  Winapi.OpenGL,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.Dialogs,
-  Vcl.ExtCtrls,
-  Vcl.Menus,
-  
-  GLS.Scene,
-  GLS.VectorTypes,
-  GLS.HUDObjects,
-  GLS.Objects,
-  GLS.Cadencer,
-  GLS.BitmapFont,
-  GLS.SceneViewer,
-  GLS.WindowsFont,
-  GLS.Windows,
-  GLS.Gui,
-  GLS.Texture,
- 
-  GLS.Material,
-  GLS.Coordinates,
-  GLS.BaseClasses,
-  GLS.Utils;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    GLLightSource1: TGLLightSource;
-    GLCamera1: TGLCamera;
-    GLCadencer1: TGLCadencer;
-    Timer1: TTimer;
-    WindowsBitmapFont1: TGLWindowsBitmapFont;
-    MainMenu1: TMainMenu;
-    Font1: TMenuItem;
-    miWindowsFont1: TMenuItem;
-    FontDialog1: TFontDialog;
-    GLGuiLayout1: TGLGuiLayout;
-    GLForm1: TGLForm;
-    GLMaterialLibrary1: TGLMaterialLibrary;
-    BrushButton: TGLButton;
-    PenButton: TGLButton;
-    GLPanel1: TGLPanel;
-    GLCanvas: TGLCustomControl;
-    WhiteButton: TGLButton;
-    BlackButton: TGLButton;
-    RedButton: TGLButton;
-    GreenButton: TGLButton;
-    BlueButton: TGLButton;
-    GuiRoot: TGLBaseControl;
-    File1: TMenuItem;
-    miOpen1: TMenuItem;
-    miSave1: TMenuItem;
-    OpenDialog1: TOpenDialog;
-    SaveDialog1: TSaveDialog;
-    miFPS: TMenuItem;
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
-    procedure Timer1Timer(Sender: TObject);
-    procedure miWindowsFont1Click(Sender: TObject);
-    procedure GLSceneViewer1MouseDown(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-    procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
-      X, Y: Integer);
-    procedure GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton;
-      Shift: TShiftState; X, Y: Integer);
-    procedure FormKeyDown(Sender: TObject; var Key: Word;
-      Shift: TShiftState);
-    procedure FormKeyPress(Sender: TObject; var Key: Char);
-    procedure FormKeyUp(Sender: TObject; var Key: Word;
-      Shift: TShiftState);
-    procedure GLCanvasMouseDown(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-    procedure GLCanvasMouseMove(Sender: TObject;
-      Shift: TShiftState; X, Y: Integer);
-    procedure GLCanvasMouseUp(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-    procedure GLCanvasRender(Sender: TGLCustomControl; Bitmap: TBitmap);
-    procedure FormCreate(Sender: TObject);
-    procedure WhiteButtonButtonClick(Sender: TObject);
-    procedure BlackButtonButtonClick(Sender: TObject);
-    procedure RedButtonButtonClick(Sender: TObject);
-    procedure GreenButtonButtonClick(Sender: TObject);
-    procedure BlueButtonButtonClick(Sender: TObject);
-    procedure PenButtonButtonClick(Sender: TObject);
-    procedure BrushButtonButtonClick(Sender: TObject);
-    procedure GLCanvasAcceptMouseQuery(Sender: TGLBaseControl;
-      Shift: TShiftState; Action: TGLMouseAction; Button: TMouseButton; X,
-      Y: Integer; var accept: Boolean);
-    procedure GLForm1Moving(Sender: TGLForm; var Left, Top: Single);
-    procedure miOpen1Click(Sender: TObject);
-    procedure miSave1Click(Sender: TObject);
-  private
-    { Déclarations privées }
-  public
-    StartX   : Integer;
-    StartY   : Integer;
-    CurrentX : Integer;
-    CurrentY : Integer;
-  end;
-
-var
-  Form1: TForm1;
-
-implementation
-
-{$R *.DFM}
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-  SetGLSceneMediaDir();  // go to media dir
-  GLMaterialLibrary1.TexturePaths := GetCurrentDir();
-  GLCanvas.MaxInvalidRenderCount := 40;
-  StartX := -1;
-end;
-
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
-begin
-  // set frame rate to 10 when program is not focused to reduce cpu usage...
-  If Form1.Focused then
-    GLCadencer1.SleepLength := 0
-  else GLCadencer1.SleepLength := 100;
-
-  // make things move a little
-  GLForm1.DoChanges;
-end;
-
-procedure TForm1.Timer1Timer(Sender: TObject);
-begin
-   miFPS.Caption:=Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
-   GLSceneViewer1.ResetPerformanceMonitor;
-end;
-
-procedure TForm1.miWindowsFont1Click(Sender: TObject);
-begin
-   FontDialog1.Font:=WindowsBitmapFont1.Font;
-   if FontDialog1.Execute then
-      WindowsBitmapFont1.Font:=FontDialog1.Font;
-end;
-
-procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  GuiRoot.MouseDown(Sender,TMouseButton(Button),Shift,X,Y);
-end;
-
-procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
-  Shift: TShiftState; X, Y: Integer);
-begin
-  GuiRoot.MouseMove(Sender,Shift,X,Y);
-end;
-
-procedure TForm1.GLSceneViewer1MouseUp(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  GuiRoot.MouseUp(Sender,TMouseButton(Button),Shift,X,Y);
-end;
-
-procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
-  Shift: TShiftState);
-begin
-  GuiRoot.KeyDown(Sender,Key,Shift);
-end;
-
-procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
-begin
-  GuiRoot.KeyPress(Sender,Key);
-end;
-
-procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
-  Shift: TShiftState);
-begin
-  GuiRoot.KeyUp(Sender,Key,Shift);
-end;
-
-procedure TForm1.GLCanvasMouseDown(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  if Button = mbLeft then
-  begin
-    // Make sure all mouse events are sent to the canvas before other GuiComponents, see GLCanvasAcceptMouseQuery.
-    GuiRoot.ActiveControl := GLCanvas;
-    // Set a status not to send mouse message to child components if any, see GLCanvasAcceptMouseQuery.
-    GLCanvas.KeepMouseEvents := True;
-    StartX := X;
-    StartY := Y;
-  end;
-end;
-
-procedure TForm1.GLCanvasMouseMove(Sender: TObject;
-  Shift: TShiftState; X, Y: Integer);
-begin
-  CurrentX := X;
-  CurrentY := Y;
-end;
-
-procedure TForm1.GLCanvasMouseUp(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  if Button = mbLeft then
-  begin
-    StartX := -1;
-    StartY := -1;
-    // Set normal mouse message handling, see GLCanvasAcceptMouseQuery.
-    GuiRoot.ActiveControl := Nil;
-    // Set that childs are allowed to get mouse events, meant for then, see GLCanvasAcceptMouseQuery.
-    GLCanvas.KeepMouseEvents := False;
-  end;
-end;
-
-procedure TForm1.GLCanvasRender(Sender: TGLCustomControl; Bitmap: TBitmap);
-begin
-  Bitmap.Width := Round(GLCanvas.Width);
-  Bitmap.Height := Round(GLCanvas.Height);
-  if StartX <> -1 then
-  begin
-    Bitmap.Canvas.MoveTo(StartX-Round(Sender.Position.X),StartY-Round(Sender.Position.Y));
-    Bitmap.Canvas.LineTo(CurrentX-Round(Sender.Position.X),CurrentY-Round(Sender.Position.Y));
-    StartX := CurrentX;
-    StartY := CurrentY;
-  end;
-end;
-
-procedure TForm1.PenButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Width := 1;
-end;
-
-procedure TForm1.BrushButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Width := 5;
-end;
-
-procedure TForm1.WhiteButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Color := clWhite;
-end;
-
-procedure TForm1.BlackButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Color := clBlack;
-end;
-
-procedure TForm1.RedButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Color := clRed;
-end;
-
-procedure TForm1.GreenButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Color := clGreen;
-end;
-
-procedure TForm1.BlueButtonButtonClick(Sender: TObject);
-begin
-  GLCanvas.Bitmap.Canvas.Pen.Color := clBlue;
-end;
-
-procedure TForm1.GLCanvasAcceptMouseQuery(Sender: TGLBaseControl;
-  Shift: TShiftState; Action: TGLMouseAction; Button: TMouseButton; X,
-  Y: Integer; var accept: Boolean);
-begin
-// Sender.KeepMouseEvents is set when drawing,
-// if drawing this component, gets mouse events even if they are out of bounds!
-  if Sender.KeepMouseEvents then Accept := True;
-end;
-
-procedure TForm1.GLForm1Moving(Sender: TGLForm; var Left, Top: Single);
-begin
-// make sure the form isn't moved out of bounds...
-
-  if Left > GLSceneViewer1.width-32 then
-    Left := GLSceneViewer1.width-32;
-
-  if Left+Sender.width < 32 then
-    Left := 32-Sender.Width;
-
-  if Top > GLSceneViewer1.Height-32 then
-    Top := GLSceneViewer1.Height-32;
-
-  if Top < 0 then
-    Top := 0;
-end;
-
-procedure TForm1.miOpen1Click(Sender: TObject);
-begin
-  if OpenDialog1.Execute then
-    GLCanvas.Bitmap.LoadFromFile(OpenDialog1.FileName);
-end;
-
-procedure TForm1.miSave1Click(Sender: TObject);
-begin
-  if SaveDialog1.Execute then
-    GLCanvas.Bitmap.SaveToFile(SaveDialog1.FileName);
-end;
-
-end.
+unit fGuiPaint;
+
+interface
+
+uses
+  Winapi.OpenGL,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.Dialogs,
+  Vcl.ExtCtrls,
+  Vcl.Menus,
+  
+  GLS.Scene,
+  GLS.VectorTypes,
+  GLS.HUDObjects,
+  GLS.Objects,
+  GLS.Cadencer,
+  GLS.BitmapFont,
+  GLS.SceneViewer,
+  GLS.WindowsFont,
+  GLS.Windows,
+  GLS.Gui,
+  GLS.Texture,
+ 
+  GLS.Material,
+  GLS.Coordinates,
+  GLS.BaseClasses,
+  GLS.Utils;
+
+type
+  TFormGuiPaint = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    GLLightSource1: TGLLightSource;
+    GLCamera1: TGLCamera;
+    GLCadencer1: TGLCadencer;
+    Timer1: TTimer;
+    WindowsBitmapFont1: TGLWindowsBitmapFont;
+    MainMenu1: TMainMenu;
+    Font1: TMenuItem;
+    miWindowsFont1: TMenuItem;
+    FontDialog1: TFontDialog;
+    GLGuiLayout1: TGLGuiLayout;
+    GLForm1: TGLForm;
+    GLMaterialLibrary1: TGLMaterialLibrary;
+    BrushButton: TGLButton;
+    PenButton: TGLButton;
+    GLPanel1: TGLPanel;
+    GLCanvas: TGLCustomControl;
+    WhiteButton: TGLButton;
+    BlackButton: TGLButton;
+    RedButton: TGLButton;
+    GreenButton: TGLButton;
+    BlueButton: TGLButton;
+    GuiRoot: TGLBaseControl;
+    File1: TMenuItem;
+    miOpen1: TMenuItem;
+    miSave1: TMenuItem;
+    OpenDialog1: TOpenDialog;
+    SaveDialog1: TSaveDialog;
+    miFPS: TMenuItem;
+    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
+      newTime: Double);
+    procedure Timer1Timer(Sender: TObject);
+    procedure miWindowsFont1Click(Sender: TObject);
+    procedure GLSceneViewer1MouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
+      X, Y: Integer);
+    procedure GLSceneViewer1MouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure FormKeyDown(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
+    procedure FormKeyPress(Sender: TObject; var Key: Char);
+    procedure FormKeyUp(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
+    procedure GLCanvasMouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure GLCanvasMouseMove(Sender: TObject;
+      Shift: TShiftState; X, Y: Integer);
+    procedure GLCanvasMouseUp(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+    procedure GLCanvasRender(Sender: TGLCustomControl; Bitmap: TBitmap);
+    procedure FormCreate(Sender: TObject);
+    procedure WhiteButtonButtonClick(Sender: TObject);
+    procedure BlackButtonButtonClick(Sender: TObject);
+    procedure RedButtonButtonClick(Sender: TObject);
+    procedure GreenButtonButtonClick(Sender: TObject);
+    procedure BlueButtonButtonClick(Sender: TObject);
+    procedure PenButtonButtonClick(Sender: TObject);
+    procedure BrushButtonButtonClick(Sender: TObject);
+    procedure GLCanvasAcceptMouseQuery(Sender: TGLBaseControl;
+      Shift: TShiftState; Action: TGLMouseAction; Button: TMouseButton; X,
+      Y: Integer; var accept: Boolean);
+    procedure GLForm1Moving(Sender: TGLForm; var Left, Top: Single);
+    procedure miOpen1Click(Sender: TObject);
+    procedure miSave1Click(Sender: TObject);
+  private
+    { Déclarations privées }
+  public
+    StartX   : Integer;
+    StartY   : Integer;
+    CurrentX : Integer;
+    CurrentY : Integer;
+  end;
+
+var
+  FormGuiPaint: TFormGuiPaint;
+
+implementation
+
+{$R *.DFM}
+
+procedure TFormGuiPaint.FormCreate(Sender: TObject);
+begin
+  SetGLSceneMediaDir();  // go to media dir
+  GLMaterialLibrary1.TexturePaths := GetCurrentDir();
+  GLCanvas.MaxInvalidRenderCount := 40;
+  StartX := -1;
+end;
+
+procedure TFormGuiPaint.GLCadencer1Progress(Sender: TObject; const deltaTime,
+  newTime: Double);
+begin
+  // set frame rate to 10 when program is not focused to reduce cpu usage...
+  If FormGuiPaint.Focused then
+    GLCadencer1.SleepLength := 0
+  else GLCadencer1.SleepLength := 100;
+
+  // make things move a little
+  GLForm1.DoChanges;
+end;
+
+procedure TFormGuiPaint.Timer1Timer(Sender: TObject);
+begin
+   miFPS.Caption:=Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
+   GLSceneViewer1.ResetPerformanceMonitor;
+end;
+
+procedure TFormGuiPaint.miWindowsFont1Click(Sender: TObject);
+begin
+   FontDialog1.Font:=WindowsBitmapFont1.Font;
+   if FontDialog1.Execute then
+      WindowsBitmapFont1.Font:=FontDialog1.Font;
+end;
+
+procedure TFormGuiPaint.GLSceneViewer1MouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  GuiRoot.MouseDown(Sender,TMouseButton(Button),Shift,X,Y);
+end;
+
+procedure TFormGuiPaint.GLSceneViewer1MouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  GuiRoot.MouseMove(Sender,Shift,X,Y);
+end;
+
+procedure TFormGuiPaint.GLSceneViewer1MouseUp(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  GuiRoot.MouseUp(Sender,TMouseButton(Button),Shift,X,Y);
+end;
+
+procedure TFormGuiPaint.FormKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  GuiRoot.KeyDown(Sender,Key,Shift);
+end;
+
+procedure TFormGuiPaint.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+  GuiRoot.KeyPress(Sender,Key);
+end;
+
+procedure TFormGuiPaint.FormKeyUp(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  GuiRoot.KeyUp(Sender,Key,Shift);
+end;
+
+procedure TFormGuiPaint.GLCanvasMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  if Button = mbLeft then
+  begin
+    // Make sure all mouse events are sent to the canvas before other GuiComponents, see GLCanvasAcceptMouseQuery.
+    GuiRoot.ActiveControl := GLCanvas;
+    // Set a status not to send mouse message to child components if any, see GLCanvasAcceptMouseQuery.
+    GLCanvas.KeepMouseEvents := True;
+    StartX := X;
+    StartY := Y;
+  end;
+end;
+
+procedure TFormGuiPaint.GLCanvasMouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  CurrentX := X;
+  CurrentY := Y;
+end;
+
+procedure TFormGuiPaint.GLCanvasMouseUp(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  if Button = mbLeft then
+  begin
+    StartX := -1;
+    StartY := -1;
+    // Set normal mouse message handling, see GLCanvasAcceptMouseQuery.
+    GuiRoot.ActiveControl := Nil;
+    // Set that childs are allowed to get mouse events, meant for then, see GLCanvasAcceptMouseQuery.
+    GLCanvas.KeepMouseEvents := False;
+  end;
+end;
+
+procedure TFormGuiPaint.GLCanvasRender(Sender: TGLCustomControl; Bitmap: TBitmap);
+begin
+  Bitmap.Width := Round(GLCanvas.Width);
+  Bitmap.Height := Round(GLCanvas.Height);
+  if StartX <> -1 then
+  begin
+    Bitmap.Canvas.MoveTo(StartX-Round(Sender.Position.X),StartY-Round(Sender.Position.Y));
+    Bitmap.Canvas.LineTo(CurrentX-Round(Sender.Position.X),CurrentY-Round(Sender.Position.Y));
+    StartX := CurrentX;
+    StartY := CurrentY;
+  end;
+end;
+
+procedure TFormGuiPaint.PenButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Width := 1;
+end;
+
+procedure TFormGuiPaint.BrushButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Width := 5;
+end;
+
+procedure TFormGuiPaint.WhiteButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Color := clWhite;
+end;
+
+procedure TFormGuiPaint.BlackButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Color := clBlack;
+end;
+
+procedure TFormGuiPaint.RedButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Color := clRed;
+end;
+
+procedure TFormGuiPaint.GreenButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Color := clGreen;
+end;
+
+procedure TFormGuiPaint.BlueButtonButtonClick(Sender: TObject);
+begin
+  GLCanvas.Bitmap.Canvas.Pen.Color := clBlue;
+end;
+
+procedure TFormGuiPaint.GLCanvasAcceptMouseQuery(Sender: TGLBaseControl;
+  Shift: TShiftState; Action: TGLMouseAction; Button: TMouseButton; X,
+  Y: Integer; var accept: Boolean);
+begin
+// Sender.KeepMouseEvents is set when drawing,
+// if drawing this component, gets mouse events even if they are out of bounds!
+  if Sender.KeepMouseEvents then Accept := True;
+end;
+
+procedure TFormGuiPaint.GLForm1Moving(Sender: TGLForm; var Left, Top: Single);
+begin
+// make sure the form isn't moved out of bounds...
+
+  if Left > GLSceneViewer1.width-32 then
+    Left := GLSceneViewer1.width-32;
+
+  if Left+Sender.width < 32 then
+    Left := 32-Sender.Width;
+
+  if Top > GLSceneViewer1.Height-32 then
+    Top := GLSceneViewer1.Height-32;
+
+  if Top < 0 then
+    Top := 0;
+end;
+
+procedure TFormGuiPaint.miOpen1Click(Sender: TObject);
+begin
+  if OpenDialog1.Execute then
+    GLCanvas.Bitmap.LoadFromFile(OpenDialog1.FileName);
+end;
+
+procedure TFormGuiPaint.miSave1Click(Sender: TObject);
+begin
+  if SaveDialog1.Execute then
+    GLCanvas.Bitmap.SaveToFile(SaveDialog1.FileName);
+end;
+
+end.

+ 113 - 113
Demos/Delphi/interface/bmpfont/Unit1.dfm → Demos/Delphi/interface/bmpfont/fBmpFont.dfm

@@ -1,113 +1,113 @@
-object Form1: TForm1
-  Left = 166
-  Top = 102
-  Caption = 'Bitmap Font'
-  ClientHeight = 359
-  ClientWidth = 505
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 505
-    Height = 359
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clBackground
-    FieldOfView = 148.869476318359400000
-    PenAsTouch = False
-    Align = alClient
-    OnClick = GLSceneViewer1Click
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    ObjectsSorting = osNone
-    Left = 16
-    Top = 16
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = Teapot1
-      Position.Coordinates = {0000A04000004040000080400000803F}
-      Left = 240
-      Top = 152
-    end
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000204100002041000020410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Teapot1: TGLTeapot
-      Material.FrontProperties.Diffuse.Color = {ADAC2C3FAAA9293FF0EF6F3F0000803F}
-      Direction.Coordinates = {EE83843E00000000EA46773F00000000}
-      Scale.Coordinates = {0000A0400000A0400000A04000000000}
-    end
-    object HUDText1: TGLHUDText
-      Position.Coordinates = {0000484200008C42000000000000803F}
-      BitmapFont = BitmapFont1
-      Text = 'Hello World'
-      Rotation = 0.000000000000000000
-    end
-    object HUDText2: TGLHUDText
-      Position.Coordinates = {0000C84200009643000000000000803F}
-      BitmapFont = BitmapFont1
-      Text = 'Spin'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      Layout = tlCenter
-    end
-    object HUDText3: TGLHUDText
-      Position.Coordinates = {0000AF4300009643000000000000803F}
-      BitmapFont = BitmapFont1
-      Text = 'Scale'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      Layout = tlCenter
-    end
-    object HUDTextFPS: TGLHUDText
-      Position.Coordinates = {0000C8420000A041000000000000803F}
-      BitmapFont = BitmapFont1
-      Text = 'FPS'
-      Rotation = 0.000000000000000000
-    end
-  end
-  object BitmapFont1: TGLBitmapFont
-    GlyphsIntervalX = 1
-    GlyphsIntervalY = 1
-    Ranges = <
-      item
-        StartASCII = ' '
-        StopASCII = 'Z'
-        StartGlyphIdx = 0
-      end
-      item
-        StartASCII = 'a'
-        StopASCII = 'z'
-        StartGlyphIdx = 33
-      end>
-    CharWidth = 30
-    CharHeight = 30
-    HSpace = 3
-    VSpace = 6
-    Left = 80
-    Top = 16
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 16
-    Top = 48
-  end
-  object Timer1: TTimer
-    OnTimer = Timer1Timer
-    Left = 16
-    Top = 80
-  end
-end
+object FormBmpFont: TFormBmpFont
+  Left = 166
+  Top = 102
+  Caption = 'Bitmap Font'
+  ClientHeight = 359
+  ClientWidth = 505
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 505
+    Height = 359
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clBackground
+    FieldOfView = 148.869476318359400000
+    PenAsTouch = False
+    Align = alClient
+    OnClick = GLSceneViewer1Click
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    ObjectsSorting = osNone
+    Left = 16
+    Top = 16
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = Teapot1
+      Position.Coordinates = {0000A04000004040000080400000803F}
+      Left = 240
+      Top = 152
+    end
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000204100002041000020410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Teapot1: TGLTeapot
+      Material.FrontProperties.Diffuse.Color = {ADAC2C3FAAA9293FF0EF6F3F0000803F}
+      Direction.Coordinates = {EE83843E00000000EA46773F00000000}
+      Scale.Coordinates = {0000A0400000A0400000A04000000000}
+    end
+    object HUDText1: TGLHUDText
+      Position.Coordinates = {0000484200008C42000000000000803F}
+      BitmapFont = BitmapFont1
+      Text = 'Hello World'
+      Rotation = 0.000000000000000000
+    end
+    object HUDText2: TGLHUDText
+      Position.Coordinates = {0000C84200009643000000000000803F}
+      BitmapFont = BitmapFont1
+      Text = 'Spin'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      Layout = tlCenter
+    end
+    object HUDText3: TGLHUDText
+      Position.Coordinates = {0000AF4300009643000000000000803F}
+      BitmapFont = BitmapFont1
+      Text = 'Scale'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      Layout = tlCenter
+    end
+    object HUDTextFPS: TGLHUDText
+      Position.Coordinates = {0000C8420000A041000000000000803F}
+      BitmapFont = BitmapFont1
+      Text = 'FPS'
+      Rotation = 0.000000000000000000
+    end
+  end
+  object BitmapFont1: TGLBitmapFont
+    GlyphsIntervalX = 1
+    GlyphsIntervalY = 1
+    Ranges = <
+      item
+        StartASCII = ' '
+        StopASCII = 'Z'
+        StartGlyphIdx = 0
+      end
+      item
+        StartASCII = 'a'
+        StopASCII = 'z'
+        StartGlyphIdx = 33
+      end>
+    CharWidth = 30
+    CharHeight = 30
+    HSpace = 3
+    VSpace = 6
+    Left = 80
+    Top = 16
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 16
+    Top = 48
+  end
+  object Timer1: TTimer
+    OnTimer = Timer1Timer
+    Left = 16
+    Top = 80
+  end
+end

+ 98 - 98
Demos/Delphi/interface/bmpfont/Unit1.pas → Demos/Delphi/interface/bmpfont/fBmpFont.pas

@@ -1,98 +1,98 @@
-unit Unit1;
-
-interface
-
-uses
-  Winapi.Opengl,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.Dialogs,
-  Vcl.ExtCtrls,
-  
-  GLS.Scene,
-  GLS.VectorTypes,
-  GLS.HUDObjects,
-  GLS.Objects,
-  GLS.Cadencer,
-  GLS.BitmapFont,
-  GLS.GeomObjects,
-  GLS.Coordinates,
-  GLS.BaseClasses,
-  GLS.Utils,
-  GLS.SceneViewer;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    BitmapFont1: TGLBitmapFont;
-    GLLightSource1: TGLLightSource;
-    GLCamera1: TGLCamera;
-    HUDText1: TGLHUDText;
-    GLCadencer1: TGLCadencer;
-    Timer1: TTimer;
-    HUDText2: TGLHUDText;
-    HUDText3: TGLHUDText;
-    Teapot1: TGLTeapot;
-    HUDTextFPS: TGLHUDText;
-    procedure GLCadencer1Progress(Sender: TObject;
-      const deltaTime, newTime: Double);
-    procedure Timer1Timer(Sender: TObject);
-    procedure FormCreate(Sender: TObject);
-    procedure GLSceneViewer1Click(Sender: TObject);
-  private
-     
-  public
-     
-  end;
-
-var
-  Form1: TForm1;
-
-implementation
-
-{$R *.DFM}
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-  // Load the font bitmap from media dir
-  SetGLSceneMediaDir();
-  BitmapFont1.Glyphs.LoadFromFile('darkgold_font.bmp');
-  // sorry, couldn't resist...
-  {$IFDEF WIN32}
-  HUDText1.Text := 'Hello WIN 32!'#13#10#13#10 + 'This is me, '#13#10 +
-    'the HUD Text.'#13#10#13#10 + 'Bitmap Fonts!';
-  {$ENDIF}
- {$IFDEF WIN64}
-  HUDText1.Text := 'Hello WIN 64!'#13#10#13#10 + 'This is me, '#13#10 +
-    'the HUD Text.'#13#10#13#10 + 'Bitmap Fonts!';
-  {$ENDIF}
-end;
-
-procedure TForm1.GLCadencer1Progress(Sender: TObject;
-  const deltaTime, newTime: Double);
-begin
-  // make things move a little
-  HUDText2.Rotation := HUDText2.Rotation + 15 * deltaTime;
-  HUDText3.Scale.X := 0.5 * sin(newTime) + 1;
-  HUDText3.Scale.Y := 0.5 * cos(newTime) + 1;
-  GLSceneViewer1.Invalidate;
-end;
-
-procedure TForm1.Timer1Timer(Sender: TObject);
-begin
-  FormatSettings.DecimalSeparator := ',';
-  HUDTextFPS.Text := FloatToStr(-2.01);
-  HUDTextFPS.Text := Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
-  GLSceneViewer1.ResetPerformanceMonitor;
-end;
-
-procedure TForm1.GLSceneViewer1Click(Sender: TObject);
-begin
-  Teapot1.Visible := not Teapot1.Visible;
-end;
-
-end.
+unit fBmpFont;
+
+interface
+
+uses
+  Winapi.Opengl,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.Dialogs,
+  Vcl.ExtCtrls,
+  
+  GLS.Scene,
+  GLS.VectorTypes,
+  GLS.HUDObjects,
+  GLS.Objects,
+  GLS.Cadencer,
+  GLS.BitmapFont,
+  GLS.GeomObjects,
+  GLS.Coordinates,
+  GLS.BaseClasses,
+  GLS.Utils,
+  GLS.SceneViewer;
+
+type
+  TFormBmpFont = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    BitmapFont1: TGLBitmapFont;
+    GLLightSource1: TGLLightSource;
+    GLCamera1: TGLCamera;
+    HUDText1: TGLHUDText;
+    GLCadencer1: TGLCadencer;
+    Timer1: TTimer;
+    HUDText2: TGLHUDText;
+    HUDText3: TGLHUDText;
+    Teapot1: TGLTeapot;
+    HUDTextFPS: TGLHUDText;
+    procedure GLCadencer1Progress(Sender: TObject;
+      const deltaTime, newTime: Double);
+    procedure Timer1Timer(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure GLSceneViewer1Click(Sender: TObject);
+  private
+     
+  public
+     
+  end;
+
+var
+  FormBmpFont: TFormBmpFont;
+
+implementation
+
+{$R *.DFM}
+
+procedure TFormBmpFont.FormCreate(Sender: TObject);
+begin
+  // Load the font bitmap from media dir
+  SetGLSceneMediaDir();
+  BitmapFont1.Glyphs.LoadFromFile('darkgold_font.bmp');
+  // sorry, couldn't resist...
+  {$IFDEF WIN32}
+  HUDText1.Text := 'Hello WIN 32!'#13#10#13#10 + 'This is me, '#13#10 +
+    'the HUD Text.'#13#10#13#10 + 'Bitmap Fonts!';
+  {$ENDIF}
+ {$IFDEF WIN64}
+  HUDText1.Text := 'Hello WIN 64!'#13#10#13#10 + 'This is me, '#13#10 +
+    'the HUD Text.'#13#10#13#10 + 'Bitmap Fonts!';
+  {$ENDIF}
+end;
+
+procedure TFormBmpFont.GLCadencer1Progress(Sender: TObject;
+  const deltaTime, newTime: Double);
+begin
+  // make things move a little
+  HUDText2.Rotation := HUDText2.Rotation + 15 * deltaTime;
+  HUDText3.Scale.X := 0.5 * sin(newTime) + 1;
+  HUDText3.Scale.Y := 0.5 * cos(newTime) + 1;
+  GLSceneViewer1.Invalidate;
+end;
+
+procedure TFormBmpFont.Timer1Timer(Sender: TObject);
+begin
+  FormatSettings.DecimalSeparator := ',';
+  HUDTextFPS.Text := FloatToStr(-2.01);
+  HUDTextFPS.Text := Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
+  GLSceneViewer1.ResetPerformanceMonitor;
+end;
+
+procedure TFormBmpFont.GLSceneViewer1Click(Sender: TObject);
+begin
+  Teapot1.Visible := not Teapot1.Visible;
+end;
+
+end.

+ 102 - 102
Demos/Delphi/interface/camera/Unit1.dfm → Demos/Delphi/interface/camera/fCamera.dfm

@@ -1,102 +1,102 @@
-object Form1: TForm1
-  Left = 299
-  Top = 129
-  BorderWidth = 6
-  Caption = 'Camera'
-  ClientHeight = 420
-  ClientWidth = 465
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  OnKeyPress = FormKeyPress
-  OnMouseWheel = FormMouseWheel
-  DesignSize = (
-    465
-    420)
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 465
-    Height = 420
-    Camera = GLCamera1
-    VSync = vsmSync
-    Buffer.BackgroundColor = clTeal
-    FieldOfView = 153.215011596679700000
-    PenAsTouch = False
-    Align = alClient
-    OnMouseDown = GLSceneViewer1MouseDown
-    OnMouseMove = GLSceneViewer1MouseMove
-    TabOrder = 0
-  end
-  object RadioGroup1: TRadioGroup
-    Left = 4
-    Top = 348
-    Width = 181
-    Height = 73
-    Anchors = [akLeft, akBottom]
-    Caption = 'Style'
-    ItemIndex = 0
-    Items.Strings = (
-      'Perspective'
-      'Infinite perspective'
-      'Perspective, keep field of view'
-      'Custom')
-    TabOrder = 1
-    OnClick = RadioGroup1Click
-  end
-  object RadioGroup2: TRadioGroup
-    Left = 309
-    Top = 364
-    Width = 145
-    Height = 57
-    Anchors = [akRight, akBottom]
-    Caption = 'Keep mode'
-    ItemIndex = 0
-    Items.Strings = (
-      'Horizontal'
-      'Vertical')
-    TabOrder = 2
-    OnClick = RadioGroup2Click
-  end
-  object GLScene1: TGLScene
-    Left = 32
-    Top = 8
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000204100002041000020410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Teapot1: TGLTeapot
-      Material.FrontProperties.Diffuse.Color = {9493133F0000803F9291113F0000803F}
-      Direction.Coordinates = {0000803F000000000000000000000000}
-      Scale.Coordinates = {00000040000000400000004000000000}
-      Up.Coordinates = {00000080000000000000803F00000000}
-    end
-    object DummyCube1: TGLDummyCube
-      ShowAxes = True
-      CubeSize = 1.000000000000000000
-      VisibleAtRunTime = True
-      object GLCamera1: TGLCamera
-        DepthOfView = 10.000000000000000000
-        FocalLength = 50.000000000000000000
-        TargetObject = DummyCube1
-        OnCustomPerspective = GLCamera1CustomPerspective
-        Position.Coordinates = {00004040000000400000803F0000803F}
-        Direction.Coordinates = {2EF964BF2EF9E43E0000000000000000}
-        Up.Coordinates = {00000000000000000000803F00000000}
-      end
-    end
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 112
-    Top = 8
-  end
-end
+object FormCamera: TFormCamera
+  Left = 299
+  Top = 129
+  BorderWidth = 6
+  Caption = 'Camera'
+  ClientHeight = 420
+  ClientWidth = 465
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnKeyPress = FormKeyPress
+  OnMouseWheel = FormMouseWheel
+  DesignSize = (
+    465
+    420)
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 465
+    Height = 420
+    Camera = GLCamera1
+    VSync = vsmSync
+    Buffer.BackgroundColor = clTeal
+    FieldOfView = 153.215011596679700000
+    PenAsTouch = False
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    TabOrder = 0
+  end
+  object RadioGroup1: TRadioGroup
+    Left = 4
+    Top = 348
+    Width = 181
+    Height = 73
+    Anchors = [akLeft, akBottom]
+    Caption = 'Style'
+    ItemIndex = 0
+    Items.Strings = (
+      'Perspective'
+      'Infinite perspective'
+      'Perspective, keep field of view'
+      'Custom')
+    TabOrder = 1
+    OnClick = RadioGroup1Click
+  end
+  object RadioGroup2: TRadioGroup
+    Left = 309
+    Top = 364
+    Width = 145
+    Height = 57
+    Anchors = [akRight, akBottom]
+    Caption = 'Keep mode'
+    ItemIndex = 0
+    Items.Strings = (
+      'Horizontal'
+      'Vertical')
+    TabOrder = 2
+    OnClick = RadioGroup2Click
+  end
+  object GLScene1: TGLScene
+    Left = 32
+    Top = 8
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000204100002041000020410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Teapot1: TGLTeapot
+      Material.FrontProperties.Diffuse.Color = {9493133F0000803F9291113F0000803F}
+      Direction.Coordinates = {0000803F000000000000000000000000}
+      Scale.Coordinates = {00000040000000400000004000000000}
+      Up.Coordinates = {00000080000000000000803F00000000}
+    end
+    object DummyCube1: TGLDummyCube
+      ShowAxes = True
+      CubeSize = 1.000000000000000000
+      VisibleAtRunTime = True
+      object GLCamera1: TGLCamera
+        DepthOfView = 10.000000000000000000
+        FocalLength = 50.000000000000000000
+        TargetObject = DummyCube1
+        OnCustomPerspective = GLCamera1CustomPerspective
+        Position.Coordinates = {00004040000000400000803F0000803F}
+        Direction.Coordinates = {2EF964BF2EF9E43E0000000000000000}
+        Up.Coordinates = {00000000000000000000803F00000000}
+      end
+    end
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 112
+    Top = 8
+  end
+end

+ 163 - 163
Demos/Delphi/interface/camera/Unit1.pas → Demos/Delphi/interface/camera/fCamera.pas

@@ -1,163 +1,163 @@
-unit Unit1;
-
-interface
-
-uses
-  System.Classes,
-  System.Math,
-  System.Types,
-  Vcl.Forms,
-  Vcl.Controls,
-  Vcl.StdCtrls,
-  Vcl.ExtCtrls,
-
-  GLS.Scene,
-  GLS.VectorTypes,
-  GLS.Objects,
-  GLS.PersistentClasses,
-  GLS.PipelineTransformation,
-  GLS.GeomObjects,
-  GLS.Coordinates,
-  GLS.BaseClasses,
-  GLS.VectorGeometry,
-  GLS.Cadencer,
-  GLS.Context,
-  GLS.SceneViewer;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    GLCamera1: TGLCamera;
-    Teapot1: TGLTeapot;
-    GLLightSource1: TGLLightSource;
-    DummyCube1: TGLDummyCube;
-    RadioGroup1: TRadioGroup;
-    RadioGroup2: TRadioGroup;
-    GLCadencer1: TGLCadencer;
-    procedure GLSceneViewer1MouseDown(Sender: TObject;
-      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-	 procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
-      X, Y: Integer);
-    procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
-      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
-    procedure FormKeyPress(Sender: TObject; var Key: Char);
-    procedure RadioGroup1Click(Sender: TObject);
-    procedure RadioGroup2Click(Sender: TObject);
-    procedure GLCamera1CustomPerspective(const viewport: TRectangle; width,
-      height, DPI: Integer; var viewPortRadius: Single);
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
-  private
-	 mdx, mdy: Integer;
-   a: Double;
-  public
-
-  end;
-
-var
-  Form1: TForm1;
-
-implementation
-
-{$R *.DFM}
-
-procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
-  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
-begin
-  // store mouse coordinates when a button went down
-  mdx := X;
-  mdy := Y;
-end;
-
-procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
-  Shift: TShiftState; X, Y: Integer);
-var
-  dx, dy: Integer;
-  v: TVector;
-begin
-  // calculate delta since last move or last mousedown
-  dx := mdx - X;
-  dy := mdy - Y;
-  mdx := X;
-  mdy := Y;
-  if ssLeft in Shift then
-  begin
-    if ssShift in Shift then
-    begin
-      // right button with shift rotates the teapot
-      // (rotation happens around camera's axis)
-      GLCamera1.RotateObject(Teapot1, dy, dx);
-    end
-    else
-    begin
-      // right button without shift changes camera angle
-      // (we're moving around the parent and target dummycube)
-      GLCamera1.MoveAroundTarget(dy, dx)
-    end;
-  end
-  else if Shift = [ssRight] then
-  begin
-    // left button moves our target and parent dummycube
-    v := GLCamera1.ScreenDeltaToVectorXY(dx, -dy,
-      0.12 * GLCamera1.DistanceToTarget / GLCamera1.FocalLength);
-    DummyCube1.Position.Translate(v);
-    // notify camera that its position/target has been changed
-    GLCamera1.TransformationChanged;
-  end;
-end;
-
-procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
-  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
-begin
-	// Note that 1 wheel-step induces a WheelDelta of 120,
-	// this code adjusts the distance to target with a 10% per wheel-step ratio
-	GLCamera1.AdjustDistanceToTarget(Power(1.1, WheelDelta/120));
-end;
-
-procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
-begin
-	with Teapot1 do case Key of
-    '1' : RotateAbsolute(  0,  0,-15);
-    '3' : RotateAbsolute(  0,  0,+15);
-    '4' : RotateAbsolute(  0,-15,  0);
-    '6' : RotateAbsolute(  0,+15,  0);
-		'7' : RotateAbsolute(-15,  0,  0);
-		'9' : RotateAbsolute(+15,  0,  0);
-	end;
-end;
-
-procedure TForm1.RadioGroup1Click(Sender: TObject);
-begin
-  case RadioGroup1.ItemIndex of
-    0: GLCamera1.CameraStyle := csPerspective;
-    1: GLCamera1.CameraStyle := csInfinitePerspective;
-    2: GLCamera1.CameraStyle := csPerspectiveKeepFOV;
-    3: GLCamera1.CameraStyle := csCustom;
-  end;
-end;
-
-procedure TForm1.RadioGroup2Click(Sender: TObject);
-begin
-  GLCamera1.KeepFOVMode := TGLCameraKeepFOVMode(RadioGroup2.ItemIndex);
-end;
-
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
-begin
-  a := Pi * sin(newTime) / 18;
-  GLSceneViewer1.Invalidate();
-end;
-
-procedure TForm1.GLCamera1CustomPerspective(const viewport: TRectangle;
-  width, height, DPI: Integer; var viewPortRadius: Single);
-var
-  Mat: TMatrix;
-begin
-  Mat :=  CreatePerspectiveMatrix(GLCamera1.GetFieldOfView(Width)/4,
-    Width / Height, GLCamera1.NearPlaneBias, GLCamera1.DepthOfView);
-  Mat := MatrixMultiply(Mat, CreateRotationMatrixZ(a));
-  CurrentGLContext.PipelineTransformation.ProjectionMatrix^ := Mat;
-end;
-
-end.
+unit fCamera;
+
+interface
+
+uses
+  System.Classes,
+  System.Math,
+  System.Types,
+  Vcl.Forms,
+  Vcl.Controls,
+  Vcl.StdCtrls,
+  Vcl.ExtCtrls,
+
+  GLS.Scene,
+  GLS.VectorTypes,
+  GLS.Objects,
+  GLS.PersistentClasses,
+  GLS.PipelineTransformation,
+  GLS.GeomObjects,
+  GLS.Coordinates,
+  GLS.BaseClasses,
+  GLS.VectorGeometry,
+  GLS.Cadencer,
+  GLS.Context,
+  GLS.SceneViewer;
+
+type
+  TFormCamera = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    GLCamera1: TGLCamera;
+    Teapot1: TGLTeapot;
+    GLLightSource1: TGLLightSource;
+    DummyCube1: TGLDummyCube;
+    RadioGroup1: TRadioGroup;
+    RadioGroup2: TRadioGroup;
+    GLCadencer1: TGLCadencer;
+    procedure GLSceneViewer1MouseDown(Sender: TObject;
+      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+	 procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
+      X, Y: Integer);
+    procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
+      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
+    procedure FormKeyPress(Sender: TObject; var Key: Char);
+    procedure RadioGroup1Click(Sender: TObject);
+    procedure RadioGroup2Click(Sender: TObject);
+    procedure GLCamera1CustomPerspective(const viewport: TRectangle; width,
+      height, DPI: Integer; var viewPortRadius: Single);
+    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
+      newTime: Double);
+  private
+	 mdx, mdy: Integer;
+   a: Double;
+  public
+
+  end;
+
+var
+  FormCamera: TFormCamera;
+
+implementation
+
+{$R *.DFM}
+
+procedure TFormCamera.GLSceneViewer1MouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  // store mouse coordinates when a button went down
+  mdx := X;
+  mdy := Y;
+end;
+
+procedure TFormCamera.GLSceneViewer1MouseMove(Sender: TObject;
+  Shift: TShiftState; X, Y: Integer);
+var
+  dx, dy: Integer;
+  v: TVector;
+begin
+  // calculate delta since last move or last mousedown
+  dx := mdx - X;
+  dy := mdy - Y;
+  mdx := X;
+  mdy := Y;
+  if ssLeft in Shift then
+  begin
+    if ssShift in Shift then
+    begin
+      // right button with shift rotates the teapot
+      // (rotation happens around camera's axis)
+      GLCamera1.RotateObject(Teapot1, dy, dx);
+    end
+    else
+    begin
+      // right button without shift changes camera angle
+      // (we're moving around the parent and target dummycube)
+      GLCamera1.MoveAroundTarget(dy, dx)
+    end;
+  end
+  else if Shift = [ssRight] then
+  begin
+    // left button moves our target and parent dummycube
+    v := GLCamera1.ScreenDeltaToVectorXY(dx, -dy,
+      0.12 * GLCamera1.DistanceToTarget / GLCamera1.FocalLength);
+    DummyCube1.Position.Translate(v);
+    // notify camera that its position/target has been changed
+    GLCamera1.TransformationChanged;
+  end;
+end;
+
+procedure TFormCamera.FormMouseWheel(Sender: TObject; Shift: TShiftState;
+  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
+begin
+	// Note that 1 wheel-step induces a WheelDelta of 120,
+	// this code adjusts the distance to target with a 10% per wheel-step ratio
+	GLCamera1.AdjustDistanceToTarget(Power(1.1, WheelDelta/120));
+end;
+
+procedure TFormCamera.FormKeyPress(Sender: TObject; var Key: Char);
+begin
+	with Teapot1 do case Key of
+    '1' : RotateAbsolute(  0,  0,-15);
+    '3' : RotateAbsolute(  0,  0,+15);
+    '4' : RotateAbsolute(  0,-15,  0);
+    '6' : RotateAbsolute(  0,+15,  0);
+		'7' : RotateAbsolute(-15,  0,  0);
+		'9' : RotateAbsolute(+15,  0,  0);
+	end;
+end;
+
+procedure TFormCamera.RadioGroup1Click(Sender: TObject);
+begin
+  case RadioGroup1.ItemIndex of
+    0: GLCamera1.CameraStyle := csPerspective;
+    1: GLCamera1.CameraStyle := csInfinitePerspective;
+    2: GLCamera1.CameraStyle := csPerspectiveKeepFOV;
+    3: GLCamera1.CameraStyle := csCustom;
+  end;
+end;
+
+procedure TFormCamera.RadioGroup2Click(Sender: TObject);
+begin
+  GLCamera1.KeepFOVMode := TGLCameraKeepFOVMode(RadioGroup2.ItemIndex);
+end;
+
+procedure TFormCamera.GLCadencer1Progress(Sender: TObject; const deltaTime,
+  newTime: Double);
+begin
+  a := Pi * sin(newTime) / 18;
+  GLSceneViewer1.Invalidate();
+end;
+
+procedure TFormCamera.GLCamera1CustomPerspective(const viewport: TRectangle;
+  width, height, DPI: Integer; var viewPortRadius: Single);
+var
+  Mat: TMatrix;
+begin
+  Mat :=  CreatePerspectiveMatrix(GLCamera1.GetFieldOfView(Width)/4,
+    Width / Height, GLCamera1.NearPlaneBias, GLCamera1.DepthOfView);
+  Mat := MatrixMultiply(Mat, CreateRotationMatrixZ(a));
+  CurrentGLContext.PipelineTransformation.ProjectionMatrix^ := Mat;
+end;
+
+end.

+ 139 - 139
Demos/Delphi/interface/fontcolor/Unit1.dfm → Demos/Delphi/interface/fontcolor/fFontColor.dfm

@@ -1,139 +1,139 @@
-object Form1: TForm1
-  Left = 219
-  Top = 107
-  BorderIcons = [biSystemMenu]
-  Caption = 'Font Color'
-  ClientHeight = 371
-  ClientWidth = 477
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 477
-    Height = 371
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clTeal
-    FieldOfView = 149.829803466796900000
-    PenAsTouch = False
-    Align = alClient
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    Left = 24
-    Top = 16
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000004000000040000000400000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Teapot1: TGLTeapot
-      Material.FrontProperties.Diffuse.Color = {9D9C1C3FB3B2323F0000803F0000803F}
-    end
-    object HUDText1: TGLHUDText
-      Position.Coordinates = {0000484300008C42000000000000803F}
-      BitmapFont = BitmapFont
-      Text = 'FADING OUT'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      ModulateColor.Color = {0000803F0000803F0000803F3333333F}
-    end
-    object HUDText2: TGLHUDText
-      Position.Coordinates = {0000484300009143000000000000803F}
-      BitmapFont = BitmapFont
-      Text = 'THE END'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      ModulateColor.Color = {0000803FF8FEFE3E000000003333333F}
-    end
-    object HUDText3: TGLHUDText
-      Position.Coordinates = {000048430000A041000000000000803F}
-      BitmapFont = BitmapFont
-      Text = 'RED RED'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      ModulateColor.Color = {0000803F00000000000000000000803F}
-    end
-    object HUDText4: TGLHUDText
-      Position.Coordinates = {0000484300007A43000000000000803F}
-      BitmapFont = BitmapFont
-      Text = 'TRANSPARENT'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      ModulateColor.Color = {9A99593F9A99593FCDCCCC3DCDCCCC3E}
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = Teapot1
-      Position.Coordinates = {0000803F0000003F0000803F0000803F}
-    end
-  end
-  object BitmapFont: TGLBitmapFont
-    GlyphsIntervalX = 7
-    GlyphsIntervalY = 0
-    Ranges = <
-      item
-        StartASCII = 'A'
-        StopASCII = 'H'
-        StartGlyphIdx = 0
-      end
-      item
-        StartASCII = 'I'
-        StopASCII = 'P'
-        StartGlyphIdx = 8
-      end
-      item
-        StartASCII = 'Q'
-        StopASCII = 'X'
-        StartGlyphIdx = 16
-      end
-      item
-        StartASCII = '!'
-        StopASCII = '!'
-        StartGlyphIdx = 27
-      end>
-    CharWidth = 27
-    CharHeight = 32
-    HSpace = 0
-    Left = 24
-    Top = 72
-  end
-  object GLTimeEventsMGR1: TGLTimeEventsMGR
-    Cadencer = GLCadencer1
-    Events = <
-      item
-        Name = 'Event0'
-        StartTime = 1.500000000000000000
-        EndTime = 3.000000000000000000
-        EventType = etContinuous
-        OnEvent = GLTimeEventsMGR1Events0Event
-      end
-      item
-        Name = 'Event1'
-        OnEvent = GLTimeEventsMGR1Events1Event
-      end
-      item
-        Name = 'Event2'
-        StartTime = 2.000000000000000000
-        EndTime = 10.000000000000000000
-        EventType = etContinuous
-        OnEvent = GLTimeEventsMGR1Events2Event
-      end>
-    Left = 328
-    Top = 72
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    Left = 328
-    Top = 8
-  end
-end
+object FormFontColor: TFormFontColor
+  Left = 219
+  Top = 107
+  BorderIcons = [biSystemMenu]
+  Caption = 'Font Color'
+  ClientHeight = 371
+  ClientWidth = 477
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 477
+    Height = 371
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clTeal
+    FieldOfView = 149.829803466796900000
+    PenAsTouch = False
+    Align = alClient
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    Left = 24
+    Top = 16
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000004000000040000000400000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Teapot1: TGLTeapot
+      Material.FrontProperties.Diffuse.Color = {9D9C1C3FB3B2323F0000803F0000803F}
+    end
+    object HUDText1: TGLHUDText
+      Position.Coordinates = {0000484300008C42000000000000803F}
+      BitmapFont = BitmapFont
+      Text = 'FADING OUT'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      ModulateColor.Color = {0000803F0000803F0000803F3333333F}
+    end
+    object HUDText2: TGLHUDText
+      Position.Coordinates = {0000484300009143000000000000803F}
+      BitmapFont = BitmapFont
+      Text = 'THE END'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      ModulateColor.Color = {0000803FF8FEFE3E000000003333333F}
+    end
+    object HUDText3: TGLHUDText
+      Position.Coordinates = {000048430000A041000000000000803F}
+      BitmapFont = BitmapFont
+      Text = 'RED RED'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      ModulateColor.Color = {0000803F00000000000000000000803F}
+    end
+    object HUDText4: TGLHUDText
+      Position.Coordinates = {0000484300007A43000000000000803F}
+      BitmapFont = BitmapFont
+      Text = 'TRANSPARENT'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      ModulateColor.Color = {9A99593F9A99593FCDCCCC3DCDCCCC3E}
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = Teapot1
+      Position.Coordinates = {0000803F0000003F0000803F0000803F}
+    end
+  end
+  object BitmapFont: TGLBitmapFont
+    GlyphsIntervalX = 7
+    GlyphsIntervalY = 0
+    Ranges = <
+      item
+        StartASCII = 'A'
+        StopASCII = 'H'
+        StartGlyphIdx = 0
+      end
+      item
+        StartASCII = 'I'
+        StopASCII = 'P'
+        StartGlyphIdx = 8
+      end
+      item
+        StartASCII = 'Q'
+        StopASCII = 'X'
+        StartGlyphIdx = 16
+      end
+      item
+        StartASCII = '!'
+        StopASCII = '!'
+        StartGlyphIdx = 27
+      end>
+    CharWidth = 27
+    CharHeight = 32
+    HSpace = 0
+    Left = 24
+    Top = 72
+  end
+  object GLTimeEventsMGR1: TGLTimeEventsMGR
+    Cadencer = GLCadencer1
+    Events = <
+      item
+        Name = 'Event0'
+        StartTime = 1.500000000000000000
+        EndTime = 3.000000000000000000
+        EventType = etContinuous
+        OnEvent = GLTimeEventsMGR1Events0Event
+      end
+      item
+        Name = 'Event1'
+        OnEvent = GLTimeEventsMGR1Events1Event
+      end
+      item
+        Name = 'Event2'
+        StartTime = 2.000000000000000000
+        EndTime = 10.000000000000000000
+        EventType = etContinuous
+        OnEvent = GLTimeEventsMGR1Events2Event
+      end>
+    Left = 328
+    Top = 72
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    Left = 328
+    Top = 8
+  end
+end

+ 106 - 106
Demos/Delphi/interface/fontcolor/Unit1.pas → Demos/Delphi/interface/fontcolor/fFontColor.pas

@@ -1,106 +1,106 @@
-unit Unit1;
-
-interface
-
-uses
-  Winapi.OpenGL,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.Dialogs,
-  
-  GLS.SceneViewer,
-  GLS.Scene,
-  GLS.Objects,
-  GLS.HUDObjects,
-  GLS.VectorGeometry,
-  GLS.VectorTypes,
-  GLS.BitmapFont,
-  GLS.Cadencer,
-  GLS.TimeEventsMgr,
-  GLS.GeomObjects,
- 
-  GLS.Coordinates,
-  GLS.Utils,
-  GLS.BaseClasses;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    BitmapFont: TGLBitmapFont;
-    GLCamera1: TGLCamera;
-    HUDText1: TGLHUDText;
-    GLLightSource1: TGLLightSource;
-    Teapot1: TGLTeapot;
-    GLTimeEventsMGR1: TGLTimeEventsMGR;
-    GLCadencer1: TGLCadencer;
-    HUDText2: TGLHUDText;
-    HUDText3: TGLHUDText;
-    HUDText4: TGLHUDText;
-    procedure GLTimeEventsMGR1Events0Event(event: TTimeEvent);
-    procedure GLTimeEventsMGR1Events1Event(event: TTimeEvent);
-    procedure GLTimeEventsMGR1Events2Event(event: TTimeEvent);
-    procedure FormCreate(Sender: TObject);
-  private
-     
-  public
-     
-  end;
-
-var
-  Form1: TForm1;
-
-const FadeOutMax = 100;
-      FadeInMax  = 100;
-      OverallTrans = 0.7;
-
-implementation
-
-{$R *.dfm}
-
-var
-  FadeOutCount : integer;
-  FadeInCount : integer;
-  OriginalColor : TVector4f;
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-   SetGLSceneMediaDir();
-   BitmapFont.Glyphs.LoadFromFile('toonfont.bmp');
-end;
-
-procedure TForm1.GLTimeEventsMGR1Events0Event(event: TTimeEvent);
-begin
-   if FadeOutCount < 0 then exit;
-
-   HUDText1.ModulateColor.Color:=VectorMake(1, 1, 1, (FadeOutCount/FadeOutMax)*OverallTrans);
-   dec(FadeOutCount);
-end;
-
-procedure TForm1.GLTimeEventsMGR1Events1Event(event: TTimeEvent);
-begin
-   FadeOutCount:=FadeOutMax;
-   FadeInCount:=0;
-
-   OriginalColor:=HUDText2.ModulateColor.Color;
-
-   HUDText1.ModulateColor.Color:=VectorMake(1, 1, 1, (FadeOutCount/FadeOutMax)*OverallTrans);
-   HUDText2.ModulateColor.Color:=VectorMake(1, 1, 1, 0);
-end;
-
-procedure TForm1.GLTimeEventsMGR1Events2Event(event: TTimeEvent);
-var
-   NewColor : TVector4f;
-begin
-   if FadeInCount >= FadeInMax then exit;
-
-   NewColor:=VectorScale(OriginalColor, FadeInCount/FadeInMax);
-
-   HUDText2.ModulateColor.Color:=NewColor;
-   Inc(FadeInCount);
-end;
-
-end.
+unit fFontColor;
+
+interface
+
+uses
+  Winapi.OpenGL,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.Dialogs,
+  
+  GLS.SceneViewer,
+  GLS.Scene,
+  GLS.Objects,
+  GLS.HUDObjects,
+  GLS.VectorGeometry,
+  GLS.VectorTypes,
+  GLS.BitmapFont,
+  GLS.Cadencer,
+  GLS.TimeEventsMgr,
+  GLS.GeomObjects,
+ 
+  GLS.Coordinates,
+  GLS.Utils,
+  GLS.BaseClasses;
+
+type
+  TFormFontColor = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    BitmapFont: TGLBitmapFont;
+    GLCamera1: TGLCamera;
+    HUDText1: TGLHUDText;
+    GLLightSource1: TGLLightSource;
+    Teapot1: TGLTeapot;
+    GLTimeEventsMGR1: TGLTimeEventsMGR;
+    GLCadencer1: TGLCadencer;
+    HUDText2: TGLHUDText;
+    HUDText3: TGLHUDText;
+    HUDText4: TGLHUDText;
+    procedure GLTimeEventsMGR1Events0Event(event: TTimeEvent);
+    procedure GLTimeEventsMGR1Events1Event(event: TTimeEvent);
+    procedure GLTimeEventsMGR1Events2Event(event: TTimeEvent);
+    procedure FormCreate(Sender: TObject);
+  private
+     
+  public
+     
+  end;
+
+var
+  FormFontColor: TFormFontColor;
+
+const FadeOutMax = 100;
+      FadeInMax  = 100;
+      OverallTrans = 0.7;
+
+implementation
+
+{$R *.dfm}
+
+var
+  FadeOutCount : integer;
+  FadeInCount : integer;
+  OriginalColor : TVector4f;
+
+procedure TFormFontColor.FormCreate(Sender: TObject);
+begin
+   SetGLSceneMediaDir();
+   BitmapFont.Glyphs.LoadFromFile('toonfont.bmp');
+end;
+
+procedure TFormFontColor.GLTimeEventsMGR1Events0Event(event: TTimeEvent);
+begin
+   if FadeOutCount < 0 then exit;
+
+   HUDText1.ModulateColor.Color:=VectorMake(1, 1, 1, (FadeOutCount/FadeOutMax)*OverallTrans);
+   dec(FadeOutCount);
+end;
+
+procedure TFormFontColor.GLTimeEventsMGR1Events1Event(event: TTimeEvent);
+begin
+   FadeOutCount:=FadeOutMax;
+   FadeInCount:=0;
+
+   OriginalColor:=HUDText2.ModulateColor.Color;
+
+   HUDText1.ModulateColor.Color:=VectorMake(1, 1, 1, (FadeOutCount/FadeOutMax)*OverallTrans);
+   HUDText2.ModulateColor.Color:=VectorMake(1, 1, 1, 0);
+end;
+
+procedure TFormFontColor.GLTimeEventsMGR1Events2Event(event: TTimeEvent);
+var
+   NewColor : TVector4f;
+begin
+   if FadeInCount >= FadeInMax then exit;
+
+   NewColor:=VectorScale(OriginalColor, FadeInCount/FadeInMax);
+
+   HUDText2.ModulateColor.Color:=NewColor;
+   Inc(FadeInCount);
+end;
+
+end.

+ 25 - 25
Demos/Delphi/interface/winfont/Unit2.dfm → Demos/Delphi/interface/winfont/fFontTexture.dfm

@@ -1,25 +1,25 @@
-object Form2: TForm2
-  Left = 324
-  Top = 160
-  AutoSize = True
-  BorderStyle = bsSizeToolWin
-  Caption = 'Font Texture'
-  ClientHeight = 264
-  ClientWidth = 388
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  PixelsPerInch = 96
-  TextHeight = 13
-  object Image1: TImage
-    Left = 0
-    Top = 0
-    Width = 388
-    Height = 264
-    AutoSize = True
-  end
-end
+object FormFontTexture: TFormFontTexture
+  Left = 324
+  Top = 160
+  AutoSize = True
+  BorderStyle = bsSizeToolWin
+  Caption = 'Font Texture'
+  ClientHeight = 264
+  ClientWidth = 388
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Image1: TImage
+    Left = 0
+    Top = 0
+    Width = 388
+    Height = 264
+    AutoSize = True
+  end
+end

+ 25 - 25
Demos/Delphi/interface/winfont/Unit2.pas → Demos/Delphi/interface/winfont/fFontTexture.pas

@@ -1,25 +1,25 @@
-unit Unit2;
-
-interface
-
-uses
-  Windows, Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
-  ExtCtrls;
-
-type
-  TForm2 = class(TForm)
-    Image1: TImage;
-  private
-    { Déclarations privées }
-  public
-    { Déclarations publiques }
-  end;
-
-var
-  Form2: TForm2;
-
-implementation
-
-{$R *.DFM}
-
-end.
+unit fFontTexture;
+
+interface
+
+uses
+  Windows, Messages, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
+  ExtCtrls;
+
+type
+  TFormFontTexture = class(TForm)
+    Image1: TImage;
+  private
+    { Déclarations privées }
+  public
+    { Déclarations publiques }
+  end;
+
+var
+  FormFontTexture: TFormFontTexture;
+
+implementation
+
+{$R *.DFM}
+
+end.

+ 120 - 120
Demos/Delphi/interface/winfont/Unit1.dfm → Demos/Delphi/interface/winfont/fWinFont.dfm

@@ -1,120 +1,120 @@
-object Form1: TForm1
-  Left = 129
-  Top = 112
-  Caption = 'Windows Font'
-  ClientHeight = 383
-  ClientWidth = 696
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  Menu = MainMenu1
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 696
-    Height = 383
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clBackground
-    FieldOfView = 150.733886718750000000
-    PenAsTouch = False
-    Align = alClient
-    OnClick = GLSceneViewer1Click
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    ObjectsSorting = osNone
-    Left = 40
-    Top = 64
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000204100002041000020410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Teapot1: TGLTeapot
-      Material.FrontProperties.Diffuse.Color = {ADAC2C3FAAA9293FF0EF6F3F0000803F}
-      Direction.Coordinates = {EE83843E00000000EA46773F00000000}
-      Scale.Coordinates = {0000A0400000A0400000A04000000000}
-    end
-    object HUDText1: TGLHUDText
-      Position.Coordinates = {0000A0410000C841000000000000803F}
-      BitmapFont = WindowsBitmapFont1
-      Text = 'Hello World'
-      Rotation = 0.000000000000000000
-    end
-    object HUDText2: TGLHUDText
-      Position.Coordinates = {000016430000AF43000000000000803F}
-      BitmapFont = WindowsBitmapFont1
-      Text = 'Spin'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      Layout = tlCenter
-    end
-    object HUDText3: TGLHUDText
-      Position.Coordinates = {008009440000AF43000000000000803F}
-      BitmapFont = WindowsBitmapFont1
-      Text = 'Scale'
-      Rotation = 0.000000000000000000
-      Alignment = taCenter
-      Layout = tlCenter
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = Teapot1
-      Position.Coordinates = {0000A04000004040000080400000803F}
-      Left = 240
-      Top = 152
-    end
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 40
-    Top = 120
-  end
-  object Timer1: TTimer
-    OnTimer = Timer1Timer
-    Left = 120
-    Top = 184
-  end
-  object WindowsBitmapFont1: TGLWindowsBitmapFont
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWhite
-    Font.Height = -20
-    Font.Name = '@Arial Unicode MS'
-    Font.Style = [fsBold]
-    Left = 40
-    Top = 192
-  end
-  object MainMenu1: TMainMenu
-    Left = 112
-    Top = 64
-    object MIPickFont: TMenuItem
-      Caption = 'Pick Font'
-      OnClick = MIPickFontClick
-    end
-    object MIViewTexture: TMenuItem
-      Caption = 'View Texture'
-      OnClick = MIViewTextureClick
-    end
-    object MIFPS: TMenuItem
-      Caption = 'FPS'
-    end
-  end
-  object FontDialog1: TFontDialog
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -11
-    Font.Name = 'MS Sans Serif'
-    Font.Style = []
-    Left = 112
-    Top = 120
-  end
-end
+object FormWinFont: TFormWinFont
+  Left = 129
+  Top = 112
+  Caption = 'Windows Font'
+  ClientHeight = 383
+  ClientWidth = 696
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  Menu = MainMenu1
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 696
+    Height = 383
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clBackground
+    FieldOfView = 150.733886718750000000
+    PenAsTouch = False
+    Align = alClient
+    OnClick = GLSceneViewer1Click
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    ObjectsSorting = osNone
+    Left = 40
+    Top = 64
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000204100002041000020410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Teapot1: TGLTeapot
+      Material.FrontProperties.Diffuse.Color = {ADAC2C3FAAA9293FF0EF6F3F0000803F}
+      Direction.Coordinates = {EE83843E00000000EA46773F00000000}
+      Scale.Coordinates = {0000A0400000A0400000A04000000000}
+    end
+    object HUDText1: TGLHUDText
+      Position.Coordinates = {0000A0410000C841000000000000803F}
+      BitmapFont = WindowsBitmapFont1
+      Text = 'Hello World'
+      Rotation = 0.000000000000000000
+    end
+    object HUDText2: TGLHUDText
+      Position.Coordinates = {000016430000AF43000000000000803F}
+      BitmapFont = WindowsBitmapFont1
+      Text = 'Spin'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      Layout = tlCenter
+    end
+    object HUDText3: TGLHUDText
+      Position.Coordinates = {008009440000AF43000000000000803F}
+      BitmapFont = WindowsBitmapFont1
+      Text = 'Scale'
+      Rotation = 0.000000000000000000
+      Alignment = taCenter
+      Layout = tlCenter
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = Teapot1
+      Position.Coordinates = {0000A04000004040000080400000803F}
+      Left = 240
+      Top = 152
+    end
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 40
+    Top = 120
+  end
+  object Timer1: TTimer
+    OnTimer = Timer1Timer
+    Left = 120
+    Top = 184
+  end
+  object WindowsBitmapFont1: TGLWindowsBitmapFont
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWhite
+    Font.Height = -20
+    Font.Name = '@Arial Unicode MS'
+    Font.Style = [fsBold]
+    Left = 40
+    Top = 192
+  end
+  object MainMenu1: TMainMenu
+    Left = 112
+    Top = 64
+    object MIPickFont: TMenuItem
+      Caption = 'Pick Font'
+      OnClick = MIPickFontClick
+    end
+    object MIViewTexture: TMenuItem
+      Caption = 'View Texture'
+      OnClick = MIViewTextureClick
+    end
+    object MIFPS: TMenuItem
+      Caption = 'FPS'
+    end
+  end
+  object FontDialog1: TFontDialog
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -11
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Left = 112
+    Top = 120
+  end
+end

+ 132 - 131
Demos/Delphi/interface/winfont/Unit1.pas → Demos/Delphi/interface/winfont/fWinFont.pas

@@ -1,131 +1,132 @@
-unit Unit1;
-
-interface
-
-uses
-  Winapi.OpenGL,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.Dialogs,
-  Vcl.ExtCtrls,
-  Vcl.Menus,
-
-  
-  GLS.Scene,
-  GLS.VectorTypes,
-  GLS.HUDObjects,
-  GLS.Objects,
-  GLS.Cadencer,
-  GLS.SceneViewer,
-  GLS.WindowsFont,
-  GLS.GeomObjects,
-  GLS.Coordinates,
- 
-  GLS.BaseClasses,
-  GLS.BitmapFont;
-
-type
-  TForm1 = class(TForm)
-    GLScene1: TGLScene;
-    GLSceneViewer1: TGLSceneViewer;
-    GLLightSource1: TGLLightSource;
-    GLCamera1: TGLCamera;
-    HUDText1: TGLHUDText;
-    GLCadencer1: TGLCadencer;
-    Timer1: TTimer;
-    HUDText2: TGLHUDText;
-    HUDText3: TGLHUDText;
-    Teapot1: TGLTeapot;
-    WindowsBitmapFont1: TGLWindowsBitmapFont;
-    MainMenu1: TMainMenu;
-    MIPickFont: TMenuItem;
-    FontDialog1: TFontDialog;
-    MIViewTexture: TMenuItem;
-    MIFPS: TMenuItem;
-    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
-      newTime: Double);
-    procedure Timer1Timer(Sender: TObject);
-    procedure FormCreate(Sender: TObject);
-    procedure GLSceneViewer1Click(Sender: TObject);
-    procedure MIPickFontClick(Sender: TObject);
-    procedure MIViewTextureClick(Sender: TObject);
-  private
-     
-  public
-     
-  end;
-
-var
-  Form1: TForm1;
-
-implementation
-
-uses Unit2;
-
-{$R *.DFM}
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-   // sorry, couldn't resist again...
-   HUDText1.Text:= 'Lorem ipsum dolor sit amer, consectetaur adipisicing elit,'#13#10
-                  +'sed do eiusmod tempor incididunt ut labore et dolore magna'#13#10
-                  +'aliqua. Ut enim ad minim veniam, quis nostrud exercitation'#13#10
-                  +'ullamco laboris nisi ut aliquip ex ea commodo consequat.'#13#10
-                  +'Duis aute irure dolor in reprehenderit in voluptate velit'#13#10
-                  +'esse cillum dolore eu fugiat nulla pariatur. Excepteur sint'#13#10
-                  +'occaecat cupidatat non proident, sunt in culpa qui officia'#13#10
-                  +'deserunt mollit anim id est laborum.'#13#10
-                  +'Woblis ten caracuro Zapothek it Setag!'; // I needed an uppercase 'W' too...
-
-  HUDText1.Text := HUDText1.Text + #13#10'Unicode text...' +
-    WideChar($0699)+WideChar($069A)+WideChar($963f)+WideChar($54c0);
-  WindowsBitmapFont1.EnsureString(HUDText1.Text);
-end;
-
-procedure TForm1.MIPickFontClick(Sender: TObject);
-begin
-   FontDialog1.Font:=WindowsBitmapFont1.Font;
-   if FontDialog1.Execute then begin
-      WindowsBitmapFont1.Font:=FontDialog1.Font;
-      HUDText1.ModulateColor.AsWinColor:=FontDialog1.Font.Color;
-   end;
-end;
-
-procedure TForm1.MIViewTextureClick(Sender: TObject);
-begin
-   with Form2.Image1 do begin
-      Picture:=WindowsBitmapFont1.Glyphs;
-      Form2.Width:=Picture.Width;
-      Form2.Height:=Picture.Height;
-   end;
-   Form2.Show;
-end;
-
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
-  newTime: Double);
-begin
-   // make things move a little
-   HUDText2.Rotation:=HUDText2.Rotation+15*deltaTime;
-   HUDText3.Scale.X:=sin(newTime)+1.5;
-   HUDText3.Scale.Y:=cos(newTime)+1.5;
-   GLSceneViewer1.Invalidate;
-end;
-
-procedure TForm1.Timer1Timer(Sender: TObject);
-begin
-   miFPS.Caption:=Format('%.1f FPS - %d x %d Font Texture',
-                   [GLSceneViewer1.FramesPerSecond,
-                    WindowsBitmapFont1.FontTextureWidth,
-                    WindowsBitmapFont1.FontTextureHeight]);
-   GLSceneViewer1.ResetPerformanceMonitor;
-end;
-
-procedure TForm1.GLSceneViewer1Click(Sender: TObject);
-begin
-   Teapot1.Visible:=not Teapot1.Visible;
-end;
-
-end.
+unit fWinFont;
+
+interface
+
+uses
+  Winapi.OpenGL,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.Dialogs,
+  Vcl.ExtCtrls,
+  Vcl.Menus,
+
+  
+  GLS.Scene,
+  GLS.VectorTypes,
+  GLS.HUDObjects,
+  GLS.Objects,
+  GLS.Cadencer,
+  GLS.SceneViewer,
+  GLS.WindowsFont,
+  GLS.GeomObjects,
+  GLS.Coordinates,
+ 
+  GLS.BaseClasses,
+  GLS.BitmapFont;
+
+type
+  TFormWinFont = class(TForm)
+    GLScene1: TGLScene;
+    GLSceneViewer1: TGLSceneViewer;
+    GLLightSource1: TGLLightSource;
+    GLCamera1: TGLCamera;
+    HUDText1: TGLHUDText;
+    GLCadencer1: TGLCadencer;
+    Timer1: TTimer;
+    HUDText2: TGLHUDText;
+    HUDText3: TGLHUDText;
+    Teapot1: TGLTeapot;
+    WindowsBitmapFont1: TGLWindowsBitmapFont;
+    MainMenu1: TMainMenu;
+    MIPickFont: TMenuItem;
+    FontDialog1: TFontDialog;
+    MIViewTexture: TMenuItem;
+    MIFPS: TMenuItem;
+    procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
+      newTime: Double);
+    procedure Timer1Timer(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure GLSceneViewer1Click(Sender: TObject);
+    procedure MIPickFontClick(Sender: TObject);
+    procedure MIViewTextureClick(Sender: TObject);
+  private
+     
+  public
+     
+  end;
+
+var
+  FormWinFont: TFormWinFont;
+
+implementation
+
+uses
+  fFontTexture;
+
+{$R *.DFM}
+
+procedure TFormWinFont.FormCreate(Sender: TObject);
+begin
+   // sorry, couldn't resist again...
+   HUDText1.Text:= 'Lorem ipsum dolor sit amer, consectetaur adipisicing elit,'#13#10
+                  +'sed do eiusmod tempor incididunt ut labore et dolore magna'#13#10
+                  +'aliqua. Ut enim ad minim veniam, quis nostrud exercitation'#13#10
+                  +'ullamco laboris nisi ut aliquip ex ea commodo consequat.'#13#10
+                  +'Duis aute irure dolor in reprehenderit in voluptate velit'#13#10
+                  +'esse cillum dolore eu fugiat nulla pariatur. Excepteur sint'#13#10
+                  +'occaecat cupidatat non proident, sunt in culpa qui officia'#13#10
+                  +'deserunt mollit anim id est laborum.'#13#10
+                  +'Woblis ten caracuro Zapothek it Setag!'; // I needed an uppercase 'W' too...
+
+  HUDText1.Text := HUDText1.Text + #13#10'Unicode text...' +
+    WideChar($0699)+WideChar($069A)+WideChar($963f)+WideChar($54c0);
+  WindowsBitmapFont1.EnsureString(HUDText1.Text);
+end;
+
+procedure TFormWinFont.MIPickFontClick(Sender: TObject);
+begin
+   FontDialog1.Font:=WindowsBitmapFont1.Font;
+   if FontDialog1.Execute then begin
+      WindowsBitmapFont1.Font:=FontDialog1.Font;
+      HUDText1.ModulateColor.AsWinColor:=FontDialog1.Font.Color;
+   end;
+end;
+
+procedure TFormWinFont.MIViewTextureClick(Sender: TObject);
+begin
+   with FormFontTexture.Image1 do begin
+      Picture:=WindowsBitmapFont1.Glyphs;
+      FormFontTexture.Width:=Picture.Width;
+      FormFontTexture.Height:=Picture.Height;
+   end;
+   FormFontTexture.Show;
+end;
+
+procedure TFormWinFont.GLCadencer1Progress(Sender: TObject; const deltaTime,
+  newTime: Double);
+begin
+   // make things move a little
+   HUDText2.Rotation:=HUDText2.Rotation+15*deltaTime;
+   HUDText3.Scale.X:=sin(newTime)+1.5;
+   HUDText3.Scale.Y:=cos(newTime)+1.5;
+   GLSceneViewer1.Invalidate;
+end;
+
+procedure TFormWinFont.Timer1Timer(Sender: TObject);
+begin
+   miFPS.Caption:=Format('%.1f FPS - %d x %d Font Texture',
+                   [GLSceneViewer1.FramesPerSecond,
+                    WindowsBitmapFont1.FontTextureWidth,
+                    WindowsBitmapFont1.FontTextureHeight]);
+   GLSceneViewer1.ResetPerformanceMonitor;
+end;
+
+procedure TFormWinFont.GLSceneViewer1Click(Sender: TObject);
+begin
+   Teapot1.Visible:=not Teapot1.Visible;
+end;
+
+end.

+ 74 - 76
Demos/Delphi/materials/cubemap/Unit1.dfm → Demos/Delphi/materials/cubemap/fCubeMap.dfm

@@ -1,76 +1,74 @@
-object Form1: TForm1
-  Left = 135
-  Top = 85
-  Caption = 'Cube Map'
-  ClientHeight = 590
-  ClientWidth = 677
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  Position = poScreenCenter
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 677
-    Height = 590
-    Camera = GLCamera1
-    BeforeRender = GLSceneViewer1BeforeRender
-    Buffer.BackgroundColor = clTeal
-    FieldOfView = 89.037071228027340000
-    PenAsTouch = False
-    Align = alClient
-    OnMouseDown = GLSceneViewer1MouseDown
-    OnMouseMove = GLSceneViewer1MouseMove
-    TabOrder = 0
-    ExplicitWidth = 415
-    ExplicitHeight = 364
-  end
-  object Button1: TButton
-    Left = 264
-    Top = 24
-    Width = 163
-    Height = 25
-    Caption = 'Apply Cube Environment Map'
-    TabOrder = 1
-    OnClick = Button1Click
-  end
-  object GLScene1: TGLScene
-    Left = 8
-    Top = 8
-    object DummyCube1: TGLDummyCube
-      CubeSize = 0.800000011920929000
-      VisibleAtRunTime = True
-    end
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000E0400000A040000040400000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Teapot1: TGLTeapot
-      Material.BackProperties.Ambient.Color = {ADAC2C3FCDCC4C3ECDCC4C3E0000803F}
-      Material.BackProperties.Emission.Color = {FBFAFA3EB9B8383FB7B6B63E6ABC343F}
-      Material.BackProperties.Shininess = 101
-      Material.FrontProperties.Ambient.Color = {A7A6263FCDCC4C3ECDCC4C3E0000803F}
-      Material.FrontProperties.Shininess = 46
-      Material.FrontProperties.Specular.Color = {0000000000000000000000007F6A1C3F}
-      Material.Texture.ImageClassName = 'TGLCubeMapImage'
-      Material.Texture.ImageAlpha = tiaAlphaFromIntensity
-      Material.Texture.MinFilter = miNearest
-      Material.Texture.TextureMode = tmReplace
-      Position.Coordinates = {00000000000080BE000000000000803F}
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 300.000000000000000000
-      TargetObject = Teapot1
-      Position.Coordinates = {000040400000A0400000E0400000803F}
-    end
-  end
-end
+object FormCubeMap: TFormCubeMap
+  Left = 135
+  Top = 85
+  Caption = 'Cube Map'
+  ClientHeight = 590
+  ClientWidth = 677
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poScreenCenter
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 677
+    Height = 590
+    Camera = GLCamera1
+    BeforeRender = GLSceneViewer1BeforeRender
+    Buffer.BackgroundColor = clTeal
+    FieldOfView = 89.037071228027340000
+    PenAsTouch = False
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    TabOrder = 0
+  end
+  object Button1: TButton
+    Left = 264
+    Top = 24
+    Width = 163
+    Height = 25
+    Caption = 'Apply Cube Environment Map'
+    TabOrder = 1
+    OnClick = Button1Click
+  end
+  object GLScene1: TGLScene
+    Left = 8
+    Top = 8
+    object DummyCube1: TGLDummyCube
+      CubeSize = 0.800000011920929000
+      VisibleAtRunTime = True
+    end
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000E0400000A040000040400000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Teapot1: TGLTeapot
+      Material.BackProperties.Ambient.Color = {ADAC2C3FCDCC4C3ECDCC4C3E0000803F}
+      Material.BackProperties.Emission.Color = {FBFAFA3EB9B8383FB7B6B63E6ABC343F}
+      Material.BackProperties.Shininess = 101
+      Material.FrontProperties.Ambient.Color = {A7A6263FCDCC4C3ECDCC4C3E0000803F}
+      Material.FrontProperties.Shininess = 46
+      Material.FrontProperties.Specular.Color = {0000000000000000000000007F6A1C3F}
+      Material.Texture.ImageClassName = 'TGLCubeMapImage'
+      Material.Texture.ImageAlpha = tiaAlphaFromIntensity
+      Material.Texture.MinFilter = miNearest
+      Material.Texture.TextureMode = tmReplace
+      Position.Coordinates = {00000000000080BE000000000000803F}
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 300.000000000000000000
+      TargetObject = Teapot1
+      Position.Coordinates = {000040400000A0400000E0400000803F}
+    end
+  end
+end

+ 12 - 12
Demos/Delphi/materials/cubemap/Unit1.pas → Demos/Delphi/materials/cubemap/fCubeMap.pas

@@ -1,4 +1,4 @@
-unit Unit1;
+unit fCubeMap;
 
 interface
 
@@ -23,7 +23,7 @@ uses
   GLS.GeomObjects;
 
 type
-  TForm1 = class(TForm)
+  TFormCubeMap = class(TForm)
     GLScene1: TGLScene;
     GLSceneViewer1: TGLSceneViewer;
     GLCamera1: TGLCamera;
@@ -45,25 +45,25 @@ type
   end;
 
 var
-  Form1: TForm1;
+  FormCubeMap: TFormCubeMap;
 
 implementation
 
 {$R *.dfm}
 
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-  // Our cube map images are here
+procedure TFormCubeMap.FormCreate(Sender: TObject);
+begin
+  // Our cube map images are here
   SetGLSceneMediaDir();
-end;
-
-procedure TForm1.GLSceneViewer1BeforeRender(Sender: TObject);
+end;
+
+procedure TFormCubeMap.GLSceneViewer1BeforeRender(Sender: TObject);
 begin
   CubmapSupported := gl.ARB_texture_cube_map;
   GLSceneViewer1.BeforeRender := nil;
 end;
 
-procedure TForm1.Button1Click(Sender: TObject);
+procedure TFormCubeMap.Button1Click(Sender: TObject);
 begin
   // Cube map warning message
   // If you don't check and turn off cube maps yourself in your apps when
@@ -103,14 +103,14 @@ end;
 
 // standard issue handlers for mouse movement
 
-procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
+procedure TFormCubeMap.GLSceneViewer1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
   mx := x;
   my := y;
 end;
 
-procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
+procedure TFormCubeMap.GLSceneViewer1MouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
 begin
   if Shift <> [] then

+ 82 - 81
Demos/Delphi/materials/customquad/Unit1.dfm → Demos/Delphi/materials/customquad/fCustomQuad.dfm

@@ -1,81 +1,82 @@
-object Form1: TForm1
-  Left = 185
-  Top = 101
-  Caption = 'Custom Quad'
-  ClientHeight = 324
-  ClientWidth = 444
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  Position = poScreenCenter
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 444
-    Height = 324
-    Camera = GLCamera1
-    FieldOfView = 130.315216064453100000
-    Align = alClient
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    Left = 8
-    Top = 8
-    object DummyCube1: TGLDummyCube
-      CubeSize = 1.000000000000000000
-      BehavioursData = {
-        0458434F4C02010201060B54474C42496E657274696102001200000000020002
-        00050000000000000080FF3F0200080500000000000000B40540050000000000
-        0000000000050000000000000000000009020008020008}
-      object DirectOpenGL1: TGLDirectOpenGL
-        Direction.Coordinates = {000000000000803F2EBD3BB300000000}
-        Up.Coordinates = {000000002EBD3BB3000080BF00000000}
-        UseBuildList = False
-        OnRender = DirectOpenGL1Render
-        Blend = False
-      end
-    end
-    object Torus1: TGLTorus
-      Direction.Coordinates = {000000000000803F2EBD3BB300000000}
-      Up.Coordinates = {000000002EBD3BB3000080BF00000000}
-      MajorRadius = 1.299999952316284000
-      MinorRadius = 0.100000001490116100
-      Rings = 36
-      StopAngle = 360.000000000000000000
-      Parts = [toSides, toStartDisk, toStopDisk]
-      BehavioursData = {
-        0458434F4C02010201060B54474C42496E657274696102001200000000020002
-        00050000000000000080FF3F0200080500000000000000000000050000000000
-        00000000000500000000000000F0034009020008020008}
-    end
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000A0410000A0410000A0410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 75.000000000000000000
-      TargetObject = DummyCube1
-      Position.Coordinates = {00004040000000400000803F0000803F}
-      Left = 200
-      Top = 136
-    end
-  end
-  object GLMaterialLibrary: TGLMaterialLibrary
-    Left = 8
-    Top = 40
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    Left = 8
-    Top = 72
-  end
-end
+object FormCustomQuad: TFormCustomQuad
+  Left = 185
+  Top = 101
+  Caption = 'Custom Quad'
+  ClientHeight = 324
+  ClientWidth = 444
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poScreenCenter
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 444
+    Height = 324
+    Camera = GLCamera1
+    FieldOfView = 130.315216064453100000
+    PenAsTouch = False
+    Align = alClient
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    Left = 8
+    Top = 8
+    object DummyCube1: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      BehavioursData = {
+        0458434F4C02010201060B54474C42496E657274696102001200000000020002
+        00050000000000000080FF3F0200080500000000000000B40540050000000000
+        0000000000050000000000000000000009020008020008}
+      object DirectOpenGL1: TGLDirectOpenGL
+        Direction.Coordinates = {000000000000803F2EBD3BB300000000}
+        Up.Coordinates = {000000002EBD3BB3000080BF00000000}
+        UseBuildList = False
+        OnRender = DirectOpenGL1Render
+        Blend = False
+      end
+    end
+    object Torus1: TGLTorus
+      Direction.Coordinates = {000000000000803F2EBD3BB300000000}
+      Up.Coordinates = {000000002EBD3BB3000080BF00000000}
+      MajorRadius = 1.299999952316284000
+      MinorRadius = 0.100000001490116100
+      Rings = 36
+      StopAngle = 360.000000000000000000
+      Parts = [toSides, toStartDisk, toStopDisk]
+      BehavioursData = {
+        0458434F4C02010201060B54474C42496E657274696102001200000000020002
+        00050000000000000080FF3F0200080500000000000000000000050000000000
+        00000000000500000000000000F0034009020008020008}
+    end
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000A0410000A0410000A0410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 75.000000000000000000
+      TargetObject = DummyCube1
+      Position.Coordinates = {00004040000000400000803F0000803F}
+      Left = 200
+      Top = 136
+    end
+  end
+  object GLMaterialLibrary: TGLMaterialLibrary
+    Left = 8
+    Top = 40
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    Left = 8
+    Top = 72
+  end
+end

+ 5 - 8
Demos/Delphi/materials/customquad/Unit1.pas → Demos/Delphi/materials/customquad/fCustomQuad.pas

@@ -1,4 +1,4 @@
-unit Unit1;
+unit fCustomQuad;
 
 interface
 
@@ -27,7 +27,7 @@ uses
   GLS.RenderContextInfo;
 
 type
-  TForm1 = class(TForm)
+  TFormCustomQuad = class(TForm)
     GLScene1: TGLScene;
     GLSceneViewer1: TGLSceneViewer;
     GLMaterialLibrary: TGLMaterialLibrary;
@@ -40,13 +40,10 @@ type
     procedure DirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
     procedure FormCreate(Sender: TObject);
   private
-    { Private declarations  }
-  public
-    { Public declarations  }
   end;
 
 var
-  Form1: TForm1;
+  FormCustomQuad: TFormCustomQuad;
 
 implementation
 
@@ -57,7 +54,7 @@ uses
   GLS.State,
   GLS.Utils;
 
-procedure TForm1.FormCreate(Sender: TObject);
+procedure TFormCustomQuad.FormCreate(Sender: TObject);
 begin
    SetGLSceneMediaDir();
    // dynamically create 2 materials and load 2 textures
@@ -75,7 +72,7 @@ begin
    end;
 end;
 
-procedure TForm1.DirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
+procedure TFormCustomQuad.DirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
 var
    material : TGLLibMaterial;
 begin

+ 81 - 80
Demos/Delphi/materials/dynamictexture/unit1.dfm → Demos/Delphi/materials/dynamictexture/fDynamicTexture.dfm

@@ -1,80 +1,81 @@
-object Form1: TForm1
-  Left = 407
-  Top = 201
-  Caption = 'Dynamic Texture'
-  ClientHeight = 362
-  ClientWidth = 591
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'Tahoma'
-  Font.Style = []
-  OldCreateOrder = False
-  WindowState = wsMaximized
-  OnCreate = FormCreate
-  OnKeyDown = FormKeyDown
-  OnResize = FormResize
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 0
-    Width = 591
-    Height = 362
-    Camera = GLCamera1
-    Buffer.BackgroundColor = clGray
-    FieldOfView = 149.115112304687500000
-    Align = alClient
-    TabOrder = 0
-  end
-  object GLScene1: TGLScene
-    Left = 64
-    Top = 16
-    object GLDirectOpenGL1: TGLDirectOpenGL
-      UseBuildList = False
-      OnRender = GLDirectOpenGL1Render
-      Blend = False
-    end
-    object GLDummyCube1: TGLDummyCube
-      CubeSize = 1.000000000000000000
-      object GLCube1: TGLCube
-        Material.MaterialLibrary = GLMaterialLibrary1
-        Material.LibMaterialName = 'Anim'
-      end
-    end
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Position.Coordinates = {0000404000002041000020410000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = GLDummyCube1
-      Position.Coordinates = {0000803F0000803F000040400000803F}
-    end
-  end
-  object GLMaterialLibrary1: TGLMaterialLibrary
-    Materials = <
-      item
-        Name = 'Anim'
-        Tag = 0
-        Material.Texture.TextureMode = tmReplace
-      end>
-    Left = 160
-    Top = 16
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    OnProgress = GLCadencer1Progress
-    Left = 64
-    Top = 88
-  end
-  object Timer1: TTimer
-    Interval = 3000
-    OnTimer = Timer1Timer
-    Left = 496
-    Top = 16
-  end
-end
+object FormDynamicTexture: TFormDynamicTexture
+  Left = 407
+  Top = 201
+  Caption = 'Dynamic Texture'
+  ClientHeight = 362
+  ClientWidth = 591
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Tahoma'
+  Font.Style = []
+  OldCreateOrder = False
+  WindowState = wsMaximized
+  OnCreate = FormCreate
+  OnKeyDown = FormKeyDown
+  OnResize = FormResize
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 0
+    Width = 591
+    Height = 362
+    Camera = GLCamera1
+    Buffer.BackgroundColor = clGray
+    FieldOfView = 149.115112304687500000
+    PenAsTouch = False
+    Align = alClient
+    TabOrder = 0
+  end
+  object GLScene1: TGLScene
+    Left = 64
+    Top = 16
+    object GLDirectOpenGL1: TGLDirectOpenGL
+      UseBuildList = False
+      OnRender = GLDirectOpenGL1Render
+      Blend = False
+    end
+    object GLDummyCube1: TGLDummyCube
+      CubeSize = 1.000000000000000000
+      object GLCube1: TGLCube
+        Material.MaterialLibrary = GLMaterialLibrary1
+        Material.LibMaterialName = 'Anim'
+      end
+    end
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Position.Coordinates = {0000404000002041000020410000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = GLDummyCube1
+      Position.Coordinates = {0000803F0000803F000040400000803F}
+    end
+  end
+  object GLMaterialLibrary1: TGLMaterialLibrary
+    Materials = <
+      item
+        Name = 'Anim'
+        Tag = 0
+        Material.Texture.TextureMode = tmReplace
+      end>
+    Left = 160
+    Top = 16
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    OnProgress = GLCadencer1Progress
+    Left = 64
+    Top = 88
+  end
+  object Timer1: TTimer
+    Interval = 3000
+    OnTimer = Timer1Timer
+    Left = 496
+    Top = 16
+  end
+end

+ 9 - 9
Demos/Delphi/materials/dynamictexture/unit1.pas → Demos/Delphi/materials/dynamictexture/fDynamicTexture.pas

@@ -1,4 +1,4 @@
-unit Unit1;
+unit fDynamicTexture;
 
 interface
 
@@ -26,7 +26,7 @@ uses
   GLS.Utils;
 
 type
-  TForm1 = class(TForm)
+  TFormDynamicTexture = class(TForm)
     GLScene1: TGLScene;
     GLSceneViewer1: TGLSceneViewer;
     GLMaterialLibrary1: TGLMaterialLibrary;
@@ -52,18 +52,18 @@ type
   end;
 
 var
-  Form1: TForm1;
+  FormDynamicTexture: TFormDynamicTexture;
 
 implementation
 
 {$R *.dfm}
 
-procedure TForm1.FormCreate(Sender: TObject);
+procedure TFormDynamicTexture.FormCreate(Sender: TObject);
 begin
   GLSceneViewer1.Align := alClient;
 end;
 
-procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
+procedure TFormDynamicTexture.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
 var
   tex: TGLTexture;
   img: TGLDynamicTextureImage;
@@ -94,17 +94,17 @@ begin
   end;
 end;
 
-procedure TForm1.FormResize(Sender: TObject);
+procedure TFormDynamicTexture.FormResize(Sender: TObject);
 begin
   GLCamera1.SceneScale := GLSceneViewer1.ClientWidth / 400;
 end;
 
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const DeltaTime, newTime: Double);
+procedure TFormDynamicTexture.GLCadencer1Progress(Sender: TObject; const DeltaTime, newTime: Double);
 begin
   GLSceneViewer1.Invalidate;
 end;
 
-procedure TForm1.GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
+procedure TFormDynamicTexture.GLDirectOpenGL1Render(Sender: TObject; var rci: TGLRenderContextInfo);
 var
   tex:  TGLTexture;
   img:  TGLDynamicTextureImage;
@@ -163,7 +163,7 @@ begin
   img.EndUpdate;
 end;
 
-procedure TForm1.Timer1Timer(Sender: TObject);
+procedure TFormDynamicTexture.Timer1Timer(Sender: TObject);
 const
   PBOText: array[Boolean] of string = ('PBO disabled', 'PBO enabled');
 var

+ 173 - 173
Demos/Delphi/materials/dyncubemap/Unit1.dfm → Demos/Delphi/materials/dyncubemap/fDynCubeMap.dfm

@@ -1,173 +1,173 @@
-object Form1: TForm1
-  Left = 208
-  Top = 104
-  Caption = 'Dynamic Cube Map'
-  ClientHeight = 327
-  ClientWidth = 405
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GLSceneViewer1: TGLSceneViewer
-    Left = 0
-    Top = 25
-    Width = 405
-    Height = 302
-    Camera = GLCamera1
-    BeforeRender = GLSceneViewer1BeforeRender
-    Buffer.BackgroundColor = clBlack
-    FieldOfView = 143.357925415039100000
-    PenAsTouch = False
-    Align = alClient
-    OnMouseDown = GLSceneViewer1MouseDown
-    OnMouseMove = GLSceneViewer1MouseMove
-    TabOrder = 0
-  end
-  object Panel1: TPanel
-    Left = 0
-    Top = 0
-    Width = 405
-    Height = 25
-    Align = alTop
-    BevelOuter = bvLowered
-    TabOrder = 1
-    object LabelFPS: TLabel
-      Left = 288
-      Top = 8
-      Width = 20
-      Height = 13
-      Caption = 'FPS'
-    end
-    object CBDynamic: TCheckBox
-      Left = 8
-      Top = 4
-      Width = 273
-      Height = 17
-      Caption = 'Animate and dynamically generate cube map'
-      Checked = True
-      State = cbChecked
-      TabOrder = 0
-    end
-  end
-  object GLScene1: TGLScene
-    Left = 8
-    Top = 32
-    object SkyDome1: TGLSkyDome
-      Direction.Coordinates = {000000000000803F0000000000000000}
-      Up.Coordinates = {E9DC72BF000000009BE8A13E00000000}
-      Bands = <
-        item
-          StartColor.Color = {0000803F0000803F0000803F0000803F}
-          StopAngle = 15.000000000000000000
-          Slices = 6
-        end
-        item
-          StartAngle = 15.000000000000000000
-          StopAngle = 90.000000000000000000
-          StopColor.Color = {5C8F023F5C8F023F0000803F0000803F}
-          Slices = 6
-          Stacks = 4
-        end
-        item
-          StartAngle = -90.000000000000000000
-          StartColor.Color = {000000001283803E000000000000803F}
-          StopAngle = -5.000000000000000000
-          StopColor.Color = {000000001283003F000000000000803F}
-          Slices = 6
-        end
-        item
-          StartAngle = -5.000000000000000000
-          StartColor.Color = {000000001283003F000000000000803F}
-          StopColor.Color = {0000803F0000803F0000803F0000803F}
-          Slices = 6
-        end>
-      Stars = <>
-    end
-    object GLLightSource1: TGLLightSource
-      ConstAttenuation = 1.000000000000000000
-      Diffuse.Color = {E5D0623FE5D0623FE5D0623F0000803F}
-      Position.Coordinates = {0000484200004842000048420000803F}
-      SpotCutOff = 180.000000000000000000
-    end
-    object Torus1: TGLTorus
-      Direction.Coordinates = {000000000000803F0000000000000000}
-      Up.Coordinates = {0000803F000000000000000000000000}
-      MajorRadius = 5.000000000000000000
-      MinorRadius = 0.300000011920929000
-      Rings = 32
-      Sides = 12
-      StopAngle = 360.000000000000000000
-      Parts = [toSides, toStartDisk, toStopDisk]
-      object Cylinder1: TGLCylinder
-        Material.FrontProperties.Emission.Color = {00000000000000000000803F0000803F}
-        Direction.Coordinates = {000000800000803F0000000000000000}
-        Position.Coordinates = {0000A04000000000000000000000803F}
-        Up.Coordinates = {00000000000000000000803F00000000}
-        BottomRadius = 0.300000011920929000
-        Height = 5.000000000000000000
-        Slices = 12
-        Stacks = 1
-        TopRadius = 0.300000011920929000
-      end
-      object Sphere1: TGLSphere
-        Material.FrontProperties.Diffuse.Color = {1283003F0000803F000000000000803F}
-        Material.FrontProperties.Emission.Color = {00000000448B0C3FBA490C3E0000803F}
-        Position.Coordinates = {0000A0C000000000000000000000803F}
-        Radius = 1.000000000000000000
-        Slices = 12
-        Stacks = 12
-      end
-      object Cube1: TGLCube
-        Material.FrontProperties.Diffuse.Color = {AE47613EAE47613EAE47613E0000803F}
-        Material.FrontProperties.Emission.Color = {1283003F00000000000000000000803F}
-        Position.Coordinates = {000000000000A040000000000000803F}
-        CubeSize = {0000C03F0000C03F0000C03F}
-      end
-    end
-    object Teapot1: TGLTeapot
-      Material.Texture.ImageClassName = 'TGLCubeMapImage'
-      Material.Texture.MinFilter = miLinear
-      Material.Texture.TextureMode = tmReplace
-      Material.Texture.MappingMode = tmmCubeMapReflection
-      Direction.Coordinates = {F404353F00000000F204353F00000000}
-      Scale.Coordinates = {00000041000000410000004100000000}
-      Visible = False
-      object CubeMapCamera: TGLCamera
-        DepthOfView = 50.000000000000000000
-        FocalLength = 25.000000000000000000
-        TargetObject = Sphere1
-      end
-    end
-    object GLCamera1: TGLCamera
-      DepthOfView = 100.000000000000000000
-      FocalLength = 50.000000000000000000
-      TargetObject = Torus1
-      Position.Coordinates = {0000204100008040000000410000803F}
-    end
-  end
-  object GLMemoryViewer1: TGLMemoryViewer
-    Camera = CubeMapCamera
-    Width = 128
-    Height = 128
-    Buffer.BackgroundColor = clMaroon
-    Left = 40
-    Top = 32
-  end
-  object GLCadencer1: TGLCadencer
-    Scene = GLScene1
-    MaxDeltaTime = 20.000000000000000000
-    OnProgress = GLCadencer1Progress
-    Left = 8
-    Top = 64
-  end
-  object Timer1: TTimer
-    OnTimer = Timer1Timer
-    Left = 40
-    Top = 64
-  end
-end
+object FormDynCubeMap: TFormDynCubeMap
+  Left = 208
+  Top = 104
+  Caption = 'Dynamic Cube Map'
+  ClientHeight = 327
+  ClientWidth = 405
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GLSceneViewer1: TGLSceneViewer
+    Left = 0
+    Top = 25
+    Width = 405
+    Height = 302
+    Camera = GLCamera1
+    BeforeRender = GLSceneViewer1BeforeRender
+    Buffer.BackgroundColor = clBlack
+    FieldOfView = 143.357925415039100000
+    PenAsTouch = False
+    Align = alClient
+    OnMouseDown = GLSceneViewer1MouseDown
+    OnMouseMove = GLSceneViewer1MouseMove
+    TabOrder = 0
+  end
+  object Panel1: TPanel
+    Left = 0
+    Top = 0
+    Width = 405
+    Height = 25
+    Align = alTop
+    BevelOuter = bvLowered
+    TabOrder = 1
+    object LabelFPS: TLabel
+      Left = 288
+      Top = 8
+      Width = 20
+      Height = 13
+      Caption = 'FPS'
+    end
+    object CBDynamic: TCheckBox
+      Left = 8
+      Top = 4
+      Width = 273
+      Height = 17
+      Caption = 'Animate and dynamically generate cube map'
+      Checked = True
+      State = cbChecked
+      TabOrder = 0
+    end
+  end
+  object GLScene1: TGLScene
+    Left = 8
+    Top = 32
+    object SkyDome1: TGLSkyDome
+      Direction.Coordinates = {000000000000803F0000000000000000}
+      Up.Coordinates = {E9DC72BF000000009BE8A13E00000000}
+      Bands = <
+        item
+          StartColor.Color = {0000803F0000803F0000803F0000803F}
+          StopAngle = 15.000000000000000000
+          Slices = 6
+        end
+        item
+          StartAngle = 15.000000000000000000
+          StopAngle = 90.000000000000000000
+          StopColor.Color = {5C8F023F5C8F023F0000803F0000803F}
+          Slices = 6
+          Stacks = 4
+        end
+        item
+          StartAngle = -90.000000000000000000
+          StartColor.Color = {000000001283803E000000000000803F}
+          StopAngle = -5.000000000000000000
+          StopColor.Color = {000000001283003F000000000000803F}
+          Slices = 6
+        end
+        item
+          StartAngle = -5.000000000000000000
+          StartColor.Color = {000000001283003F000000000000803F}
+          StopColor.Color = {0000803F0000803F0000803F0000803F}
+          Slices = 6
+        end>
+      Stars = <>
+    end
+    object GLLightSource1: TGLLightSource
+      ConstAttenuation = 1.000000000000000000
+      Diffuse.Color = {E5D0623FE5D0623FE5D0623F0000803F}
+      Position.Coordinates = {0000484200004842000048420000803F}
+      SpotCutOff = 180.000000000000000000
+    end
+    object Torus1: TGLTorus
+      Direction.Coordinates = {000000000000803F0000000000000000}
+      Up.Coordinates = {0000803F000000000000000000000000}
+      MajorRadius = 5.000000000000000000
+      MinorRadius = 0.300000011920929000
+      Rings = 32
+      Sides = 12
+      StopAngle = 360.000000000000000000
+      Parts = [toSides, toStartDisk, toStopDisk]
+      object Cylinder1: TGLCylinder
+        Material.FrontProperties.Emission.Color = {00000000000000000000803F0000803F}
+        Direction.Coordinates = {000000800000803F0000000000000000}
+        Position.Coordinates = {0000A04000000000000000000000803F}
+        Up.Coordinates = {00000000000000000000803F00000000}
+        BottomRadius = 0.300000011920929000
+        Height = 5.000000000000000000
+        Slices = 12
+        Stacks = 1
+        TopRadius = 0.300000011920929000
+      end
+      object Sphere1: TGLSphere
+        Material.FrontProperties.Diffuse.Color = {1283003F0000803F000000000000803F}
+        Material.FrontProperties.Emission.Color = {00000000448B0C3FBA490C3E0000803F}
+        Position.Coordinates = {0000A0C000000000000000000000803F}
+        Radius = 1.000000000000000000
+        Slices = 12
+        Stacks = 12
+      end
+      object Cube1: TGLCube
+        Material.FrontProperties.Diffuse.Color = {AE47613EAE47613EAE47613E0000803F}
+        Material.FrontProperties.Emission.Color = {1283003F00000000000000000000803F}
+        Position.Coordinates = {000000000000A040000000000000803F}
+        CubeSize = {0000C03F0000C03F0000C03F}
+      end
+    end
+    object Teapot1: TGLTeapot
+      Material.Texture.ImageClassName = 'TGLCubeMapImage'
+      Material.Texture.MinFilter = miLinear
+      Material.Texture.TextureMode = tmReplace
+      Material.Texture.MappingMode = tmmCubeMapReflection
+      Direction.Coordinates = {F404353F00000000F204353F00000000}
+      Scale.Coordinates = {00000041000000410000004100000000}
+      Visible = False
+      object CubeMapCamera: TGLCamera
+        DepthOfView = 50.000000000000000000
+        FocalLength = 25.000000000000000000
+        TargetObject = Sphere1
+      end
+    end
+    object GLCamera1: TGLCamera
+      DepthOfView = 100.000000000000000000
+      FocalLength = 50.000000000000000000
+      TargetObject = Torus1
+      Position.Coordinates = {0000204100008040000000410000803F}
+    end
+  end
+  object GLMemoryViewer1: TGLMemoryViewer
+    Camera = CubeMapCamera
+    Width = 128
+    Height = 128
+    Buffer.BackgroundColor = clMaroon
+    Left = 40
+    Top = 32
+  end
+  object GLCadencer1: TGLCadencer
+    Scene = GLScene1
+    MaxDeltaTime = 20.000000000000000000
+    OnProgress = GLCadencer1Progress
+    Left = 8
+    Top = 64
+  end
+  object Timer1: TTimer
+    OnTimer = Timer1Timer
+    Left = 40
+    Top = 64
+  end
+end

+ 9 - 9
Demos/Delphi/materials/dyncubemap/Unit1.pas → Demos/Delphi/materials/dyncubemap/fDynCubeMap.pas

@@ -1,4 +1,4 @@
-unit Unit1;
+unit fDynCubeMap;
 
 interface
 
@@ -26,7 +26,7 @@ uses
   GLS.BaseClasses;
 
 type
-  TForm1 = class(TForm)
+  TFormDynCubeMap = class(TForm)
     GLScene1: TGLScene;
     GLSceneViewer1: TGLSceneViewer;
     GLMemoryViewer1: TGLMemoryViewer;
@@ -61,7 +61,7 @@ type
   end;
 
 var
-  Form1: TForm1;
+  FormDynCubeMap: TFormDynCubeMap;
 
 //===================================
 implementation
@@ -69,7 +69,7 @@ implementation
 
 {$R *.dfm}
 
-procedure TForm1.GenerateCubeMap;
+procedure TFormDynCubeMap.GenerateCubeMap;
 begin
    // Don't do anything if cube maps aren't supported
    if not CubmapSupported then begin
@@ -91,7 +91,7 @@ begin
    end;
 end;
 
-procedure TForm1.GLCadencer1Progress(Sender: TObject; const deltaTime,
+procedure TFormDynCubeMap.GLCadencer1Progress(Sender: TObject; const deltaTime,
   newTime: Double);
 begin
    if CBDynamic.Checked then begin
@@ -106,14 +106,14 @@ end;
 
 // Standard issue mouse movement
 
-procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject;
+procedure TFormDynCubeMap.GLSceneViewer1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 begin
    mx:=x;
    my:=y;
 end;
 
-procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject;
+procedure TFormDynCubeMap.GLSceneViewer1MouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
 begin
    if Shift<>[] then begin
@@ -123,13 +123,13 @@ begin
    end;
 end;
 
-procedure TForm1.Timer1Timer(Sender: TObject);
+procedure TFormDynCubeMap.Timer1Timer(Sender: TObject);
 begin
    LabelFPS.Caption:=Format('%.1f FPS', [GLSceneViewer1.FramesPerSecond]);
    GLSceneViewer1.ResetPerformanceMonitor;
 end;
 
-procedure TForm1.GLSceneViewer1BeforeRender(Sender: TObject);
+procedure TFormDynCubeMap.GLSceneViewer1BeforeRender(Sender: TObject);
 begin
   CubmapSupported := GL.ARB_texture_cube_map;
   GLSceneViewer1.BeforeRender := nil;

+ 100 - 100
Demos/Delphi/utilities/fontgen/main.dfm → Demos/Delphi/utilities/fontgen/fFontGen.dfm

@@ -1,100 +1,100 @@
-object frmMain: TfrmMain
-  Left = 277
-  Top = 178
-  BorderStyle = bsSingle
-  Caption = 'FontGen for GLScene'
-  ClientHeight = 363
-  ClientWidth = 378
-  Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
-  Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
-  Font.Style = []
-  OldCreateOrder = False
-  OnCreate = FormCreate
-  PixelsPerInch = 96
-  TextHeight = 13
-  object GroupBox1: TGroupBox
-    Left = 6
-    Top = 8
-    Width = 363
-    Height = 109
-    Caption = '1. Select Windows font :'
-    TabOrder = 0
-    object Panel1: TPanel
-      Left = 10
-      Top = 20
-      Width = 343
-      Height = 41
-      BevelOuter = bvLowered
-      Caption = 'Sample AaBbCcDd'
-      Font.Charset = RUSSIAN_CHARSET
-      Font.Color = clWindowText
-      Font.Height = -11
-      Font.Name = 'Arial'
-      Font.Style = []
-      ParentFont = False
-      TabOrder = 0
-    end
-    object Button1: TButton
-      Left = 142
-      Top = 70
-      Width = 75
-      Height = 25
-      Caption = 'Select...'
-      TabOrder = 1
-      OnClick = Button1Click
-    end
-  end
-  object GroupBox2: TGroupBox
-    Left = 6
-    Top = 120
-    Width = 363
-    Height = 169
-    Caption = '2. Check glyphs'
-    TabOrder = 1
-    object Image1: TImage
-      Left = 2
-      Top = 15
-      Width = 359
-      Height = 152
-      Align = alClient
-      Center = True
-    end
-  end
-  object GroupBox3: TGroupBox
-    Left = 6
-    Top = 290
-    Width = 363
-    Height = 65
-    Caption = '3. Save font:'
-    TabOrder = 2
-    object Button2: TButton
-      Left = 150
-      Top = 24
-      Width = 75
-      Height = 25
-      Caption = 'Save...'
-      TabOrder = 0
-      OnClick = Button2Click
-    end
-  end
-  object FontDialog1: TFontDialog
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -11
-    Font.Name = 'MS Sans Serif'
-    Font.Style = []
-    Left = 264
-    Top = 74
-  end
-  object SaveDialog1: TSaveDialog
-    DefaultExt = 'gsf'
-    FileName = 'font'
-    Filter = 'GlScene Font|*.gsf|All Files|*.*'
-    Title = 'Save font'
-    Left = 290
-    Top = 310
-  end
-end
+object FormFontGen: TFormFontGen
+  Left = 277
+  Top = 178
+  BorderStyle = bsSingle
+  Caption = 'FontGen for GLScene'
+  ClientHeight = 363
+  ClientWidth = 378
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'MS Sans Serif'
+  Font.Style = []
+  OldCreateOrder = False
+  OnCreate = FormCreate
+  PixelsPerInch = 96
+  TextHeight = 13
+  object GroupBox1: TGroupBox
+    Left = 6
+    Top = 8
+    Width = 363
+    Height = 109
+    Caption = '1. Select Windows font :'
+    TabOrder = 0
+    object Panel1: TPanel
+      Left = 10
+      Top = 20
+      Width = 343
+      Height = 41
+      BevelOuter = bvLowered
+      Caption = 'Sample AaBbCcDd'
+      Font.Charset = RUSSIAN_CHARSET
+      Font.Color = clWindowText
+      Font.Height = -11
+      Font.Name = 'Arial'
+      Font.Style = []
+      ParentFont = False
+      TabOrder = 0
+    end
+    object Button1: TButton
+      Left = 142
+      Top = 70
+      Width = 75
+      Height = 25
+      Caption = 'Select...'
+      TabOrder = 1
+      OnClick = Button1Click
+    end
+  end
+  object GroupBox2: TGroupBox
+    Left = 6
+    Top = 120
+    Width = 363
+    Height = 169
+    Caption = '2. Check glyphs'
+    TabOrder = 1
+    object Image1: TImage
+      Left = 2
+      Top = 15
+      Width = 359
+      Height = 152
+      Align = alClient
+      Center = True
+    end
+  end
+  object GroupBox3: TGroupBox
+    Left = 6
+    Top = 290
+    Width = 363
+    Height = 65
+    Caption = '3. Save font:'
+    TabOrder = 2
+    object Button2: TButton
+      Left = 150
+      Top = 24
+      Width = 75
+      Height = 25
+      Caption = 'Save...'
+      TabOrder = 0
+      OnClick = Button2Click
+    end
+  end
+  object FontDialog1: TFontDialog
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -11
+    Font.Name = 'MS Sans Serif'
+    Font.Style = []
+    Left = 264
+    Top = 74
+  end
+  object SaveDialog1: TSaveDialog
+    DefaultExt = 'gsf'
+    FileName = 'font'
+    Filter = 'GlScene Font|*.gsf|All Files|*.*'
+    Title = 'Save font'
+    Left = 290
+    Top = 310
+  end
+end

+ 68 - 71
Demos/Delphi/utilities/fontgen/main.pas → Demos/Delphi/utilities/fontgen/fFontGen.pas

@@ -1,71 +1,68 @@
-unit main;
-
-interface
-
-uses
-  Winapi.OpenGL,
-  System.SysUtils,
-  System.Classes,
-  Vcl.Graphics,
-  Vcl.Controls,
-  Vcl.Forms,
-  Vcl.Dialogs,
-  Vcl.StdCtrls,
-  Vcl.ExtCtrls,
-  
-  GLS.BitmapFont,
-  GLS.WindowsFont;
-
-type
-  TfrmMain = class(TForm)
-    GroupBox1: TGroupBox;
-    Panel1: TPanel;
-    Button1: TButton;
-    FontDialog1: TFontDialog;
-    GroupBox2: TGroupBox;
-    Image1: TImage;
-    GroupBox3: TGroupBox;
-    SaveDialog1: TSaveDialog;
-    Button2: TButton;
-    procedure Button1Click(Sender: TObject);
-    procedure FormCreate(Sender: TObject);
-    procedure Button2Click(Sender: TObject);
-  private
-     
-  public
-     
-    FFont: TGLWindowsBitmapFont;
-  end;
-
-var
-  frmMain: TfrmMain;
-
-implementation
-
-{$R *.dfm}
-
-procedure TfrmMain.Button1Click(Sender: TObject);
-begin
-  FontDialog1.Font := Panel1.Font;
-  if FontDialog1.Execute then
-  begin
-    Panel1.Font := FontDialog1.Font;
-    FFont.Font := FontDialog1.Font;
-    Image1.Picture.Assign(FFont.Glyphs);
-  end;
-end;
-
-procedure TfrmMain.FormCreate(Sender: TObject);
-begin
-  FFont := TGLWindowsBitmapFont.Create(Self);
-end;
-
-procedure TfrmMain.Button2Click(Sender: TObject);
-begin
-  if SaveDialog1.Execute then
-  begin
-    FFont.Glyphs.SaveToFile(SaveDialog1.FileName);
-  end;
-end;
-
-end.
+unit fFontGen;
+
+interface
+
+uses
+  Winapi.OpenGL,
+  System.SysUtils,
+  System.Classes,
+  Vcl.Graphics,
+  Vcl.Controls,
+  Vcl.Forms,
+  Vcl.Dialogs,
+  Vcl.StdCtrls,
+  Vcl.ExtCtrls,
+
+  GLS.BitmapFont,
+  GLS.WindowsFont;
+
+type
+  TFormFontGen = class(TForm)
+    GroupBox1: TGroupBox;
+    Panel1: TPanel;
+    Button1: TButton;
+    FontDialog1: TFontDialog;
+    GroupBox2: TGroupBox;
+    Image1: TImage;
+    GroupBox3: TGroupBox;
+    SaveDialog1: TSaveDialog;
+    Button2: TButton;
+    procedure Button1Click(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure Button2Click(Sender: TObject);
+  public
+    FFont: TGLWindowsBitmapFont;
+  end;
+
+var
+  FormFontGen: TFormFontGen;
+
+implementation
+
+{$R *.dfm}
+
+procedure TFormFontGen.Button1Click(Sender: TObject);
+begin
+  FontDialog1.Font := Panel1.Font;
+  if FontDialog1.Execute then
+  begin
+    Panel1.Font := FontDialog1.Font;
+    FFont.Font := FontDialog1.Font;
+    Image1.Picture.Assign(FFont.Glyphs);
+  end;
+end;
+
+procedure TFormFontGen.FormCreate(Sender: TObject);
+begin
+  FFont := TGLWindowsBitmapFont.Create(Self);
+end;
+
+procedure TFormFontGen.Button2Click(Sender: TObject);
+begin
+  if SaveDialog1.Execute then
+  begin
+    FFont.Glyphs.SaveToFile(SaveDialog1.FileName);
+  end;
+end;
+
+end.