unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Addraws, AdClasses, AdTypes, ExtCtrls, StdCtrls, AdComponents,
AdGUIConnector, AdGUI, AdPerformanceCounter;
type
TForm1 =
class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormKeyPress(Sender: TObject;
var Key: Char);
procedure Timer1Timer(Sender: TObject);
private
public
AdDraw : TAdDraw;
AdGUI : TAdGUI;
AdPerformanceCounter : TAdPerformanceCounter;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
AdDraw := TAdDraw.Create(self);
AdDraw.DllName := '
AndorraDX93D.dll';
AdDraw.Options := AdDraw.Options + [DoFullscreen];
AdDraw.Display.Width := 800;
Addraw.Display.Height := 600;
AdDraw.Display.BitCount := 32;
if not AdDraw.Initialize
then
begin
ShowMessage('
Andorra 2D konnte nicht gestartet werden.');
halt;
end;
AdGUI := TAdGUI.Create(AdDraw);
AdGUI.Skin.LoadFromFile('
sunna.axs');
AdGUI.Cursors.LoadFromFile('
Cursors.xml');
AdGUI.LoadFromFile('
Test.axg');
AdPerformanceCounter := TAdPerformanceCounter.Create;
Timer1.Enabled := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
AdPerformanceCounter.Free;
AdGUI.Free;
AdDraw.Free;
end;
procedure TForm1.FormKeyPress(Sender: TObject;
var Key: Char);
begin
if (key=#27)
then
halt;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
AdPerformanceCounter.Calculate;
AdDraw.ClearSurface(clblack);
AdDraw.BeginScene;
AdGUI.Update(AdPerformanceCounter.TimeGap/1000);
AdDraw.EndScene;
AdDraw.Flip;
end;
end.