program KTRYM;

//{$APPTYPE CONSOLE}

uses
  SysUtils,
  zglHeader in 'src\zglHeader.pas',
  uConst in 'uConst.pas',
  uMaterials in 'uMaterials.pas',
  uObj in 'src\uObj.pas',
  uWorld in 'src\uWorld.pas',
  uLiveObj in 'src\uLiveObj.pas',
  uBox in 'src\uBox.pas',
  uHero in 'src\uHero.pas',
  uEnemy in 'src\uEnemy.pas',
  uMyApp in 'src\uMyApp.pas',
  uGame in 'src\uGame.pas',
  uScene in 'src\uScene.pas',
  uMainMenu in 'src\uMainMenu.pas',
  uMenu in 'src\uMenu.pas',
  uPage in 'src\uPage.pas',
  uBomb in 'src\ubomb.pas',
  uLevelEnd in 'src\ulevelend.pas',
  uParticle in 'src\uParticle.pas',
  uMenuI in 'src\uMenuI.pas';

var
  MyApp : TMyApp;

procedure Init;
begin
  LoadMaterials;
  MyApp := TMyApp.Create;
end;

procedure Draw;
begin
  pr2d_Rect(0,0, WinW, WinH, $CFCFCF, $F0, PR2D_FILL);
  MyApp.Draw;
end;

procedure Exit;
begin

end;

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

begin
  Randomize;
   {
  writeln(sin(1));
  writeln(sin(2));
  writeln(sin(3));
  writeln(sin(3.14));
   }

  zglLoad( libZenGL );
  zgl_Reg( SYS_LOAD, @Init);
  zgl_Reg( SYS_DRAW, @Draw);
  zgl_Reg( SYS_EXIT, @Exit);
  timer_Add( @Update, Interval);

  wnd_SetCaption( 'KTRYM' );

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

  zgl_Init;
end.
end.

