// Elysion Frameworks
// Basic Game unit
// Abstract layer for games 
//
// (C) 2009, Johannes Stein
// Freeze.Dev - http://www.freeze-dev.de
//

unit BasicGame;

interface

uses ElysionLegacy;

type
TBasicGame = Class(TelObject)
  private
    function GetWidth: Integer;
    function GetHeight: Integer;
  public
    // Creates TBasicGame with no strings attached
    // A window needs to be created manually if not done yet
    constructor Create(); Overload;
    
    // Creates TBasicGame and creates a window
    constructor Create(Width, Height, BPP: Integer; Fullscreen: Boolean); Overload;

    destructor Destroy(); Override;
    procedure Free;
  
    procedure Initialize(); virtual; abstract;
    
    procedure Render(); virtual; abstract;
    procedure Update(); virtual; abstract;
  published
    property Width: Integer read GetWidth;
    property Height: Integer read GetHeight;
end;

implementation

constructor TBasicGame.Create();
begin

end;

constructor TBasicGame.Create(Width, Height, BPP: Integer; Fullscreen: Boolean);
begin
  Application.Initialize(Width, Height, BPP, Fullscreen);
end;

destructor TBasicGame.Destroy();
begin

end;

procedure TBasicGame.Free;
begin

end;

function TBasicGame.GetWidth: Integer;
begin
  if ActiveSurface <> nil then Result := ActiveSurface.Width;
end;

function TBasicGame.GetHeight: Integer;
begin
  if ActiveSurface <> nil then Result := ActiveSurface.Height;
end;

end.