unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Addraws, AdClasses, AdTypes, ExtCtrls, StdCtrls, AdComponents,
AdGUIConnector, AdGUI;
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;
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');
ShowMessage('
Es wurde alles initialisiert!');
Timer1.Enabled := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
AdDraw.Free;
AdGui.Free;
//lässt man diese Zeile weg, kommen keine Fehlermeldungen
end;
procedure TForm1.FormKeyPress(Sender: TObject;
var Key: Char);
begin
if (key=#27)
then
halt;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
AdDraw.ClearSurface(clblack);
AdDraw.Flip;
end;
end.