Debian Codegraph @

examples/lazarus/two_controls/mainf.pas

raw
1 {
2 Copyright 2014-2018 Michalis Kamburelis.
3
4 This file is part of "Castle Game Engine".
5
6 "Castle Game Engine" is free software; see the file COPYING.txt,
7 included in this distribution, for details about the copyright.
8
9 "Castle Game Engine" is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 ----------------------------------------------------------------------------
14 }
15
16 { Main form. }
17 unit mainf;
18
19 {$mode objfpc}{$H+}
20
21 interface
22
23 uses
24 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
25 ExtCtrls,
26 CastleControl, CastleDialogs, CastleViewport, CastleScene;
27
28 type
29 TMain = class(TForm)
30 CastleControl1: TCastleControl;
31 CastleControl2: TCastleControl;
32 LabelFps1: TLabel;
33 LabelFps2: TLabel;
34 Timer: TTimer;
35 procedure TimerTimer(Sender: TObject);
36 end;
37
38 var
39 Main: TMain;
40
41 implementation
42
43 uses X3DLoad, CastleLCLUtils, CastleSceneCore;
44
45 {$R *.lfm}
46
47 procedure TMain.TimerTimer(Sender: TObject);
48 begin
49 LabelFps1.Caption := 'FPS: ' + CastleControl1.Fps.ToString;
50 LabelFps2.Caption := 'FPS: ' + CastleControl2.Fps.ToString;
51 end;
52
53 end.