{
Autor: Michael Springwald
Erstellt am: 19.04.2004
Upgedatet am: 19.04.2004
}
unit gameunit;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DXDraws, DXClass, StdCtrls, AppEvnts, jpeg, ExtCtrls;
type
TGame =
class(TComponent)
Zeitgeber: TDXTimer;
ListImage:TDXImageList;
Draw:TDXDraw;
constructor Create(F:TForm);
procedure Create_Component(F1:TForm);
procedure DXTimerTimer(Sender: TObject; LagCount: Integer);
public
// procedure DrawGame;
end;
implementation
procedure TGame.Create_Component(F1:TForm);
begin
Draw:=TDXDraw.Create(F1);
Draw.AutoInitialize:=True;
Draw.Height:=480; Draw.Width:=640; Draw.Left:=0; Draw.Top:=0;
Draw.Parent:=F1;
//Draw.C
ListImage:=TDXImageList.Create(ListImage);
ListImage.DXDraw:=Draw;
Zeitgeber:=TDXTimer.Create(Zeitgeber);
Zeitgeber.OnTimer:=DXTimerTimer; Zeitgeber.Interval:=0;
// Zeitgeber.TimerRun;
end;
constructor TGame.Create(F:TForm);
begin
Create_Component(f);
// erstellt die standart classen
end;
procedure TGame.DXTimerTimer(Sender: TObject; LagCount: Integer);
begin
// Showmessage('TEST');
// if Draw.CanDraw = True then begin
Draw.Surface.Fill(clYellow);
Draw.Flip;
// end;
end;
end.
///////////////////////////////die form unit//////////////////////////////////////////
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DXDraws, DXClass,gameunit;
type
TForm1 =
class(TForm)
Panel1: TPanel;
procedure FormActivate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Game:TGame;
implementation
{$R *.dfm}
procedure TForm1.FormActivate(Sender: TObject);
begin
Game:=TGame.Create(form1);
end;
end.