unit Main;
interface
uses
Windows,Dialogs, SysUtils, Graphics, Classes, Controls,
AdDraws, AdClasses, AdSetupDlg, AdPerformanceCounter, AdStdWindow,
AdTypes, AdComponents, AdPNG;
type
TAdAppl =
class
public
AdDraw:TAdDraw;
AdPerCounter:TAdPerformanceCounter;
procedure Idle(Sender:TObject;
var Done:boolean);
procedure Run;
end;
const
Path = '
';
var
Pattern: single;
implementation
procedure TAdAppl.Idle(Sender: TObject;
var Done: boolean);
begin
if AdDraw.CanDraw
then
begin
AdPerCounter.Calculate;
AdDraw.ClearSurface(0);
AdDraw.BeginScene;
AdDraw.EndScene;
AdDraw.Flip;
end;
Done := false;
end;
procedure TAdAppl.Run;
var
AdSetup: TAdSetup;
begin
AdPerCounter := TAdPerformanceCounter.Create;
AdDraw := TAdDraw.Create(
nil);
AdDraw.Options := AdDraw.Options+[doFullscreen];
AdSetup := TAdSetup.Create(
nil);
AdSetup.Title := '
test';
AdSetup.Image := path + '
img/logo.png';
AdSetup.AdDraw := AdDraw;
if AdSetup.Execute
then
begin
if AdDraw.Initialize
then
begin
AdDraw.Window.Events.OnIdle := Idle;
AdDraw.Window.CursorVisible := false;
AdDraw.Window.Title := '
cReal';
AdDraw.Run;
end else
ShowMessage('
Error while initializing Andorra 2D. Try to use another display '+
'
mode or another video adapter.');
end;
AdPerCounter.Free;
AdDraw.Free;
end;
end.