program Test;
{$APPTYPE CONSOLE}

uses
  windows, zglHeader, uMeForm, uScene, uMap, uGame, uGlobal, uMeSprite,
  uLiveObj, uHero, uMap4Way, uFGame, ufgame_m3, uParticles, uSiluet;
var
  SceneManager : tSceneMng;
  Game : TGame;

procedure Init;
begin
  LoadTextures;
  SceneManager := tSceneMng.Create;
  SceneManager.WinW:= WinW;
  SceneManager.WinH:= WinH;

  Game := TGame.Create(SceneManager);

  Game.SetParam(0);
  Game.SetAsScene;

end;

procedure Draw;
begin
  SceneManager.Draw;


end;

procedure Exit;
begin

end;

procedure Update;
begin
  SceneManager.Update;
  key_ClearState();
  mouse_ClearState();
end;



{$R *.res}

begin
  Randomize;

  if not zglLoad( libZenGL ) then exit;

  zgl_Reg( SYS_LOAD, @Init);
  zgl_Reg( SYS_DRAW, @Draw);
  zgl_Reg( SYS_EXIT, @Exit);

  timer_Add( @Update, 18);

  scr_SetOptions( WinW, WinH, REFRESH_MAXIMUM, False, True);
  wnd_ShowCursor( True );

  wnd_SetCaption( 'cdmlex 2017' );
  zgl_Init;
end.
