unit _Resources;

interface

uses
  QuadEngine;

type
TResources = class
private
  const CAR_SIZE = 128;
  const TILE_SIZE = 64;
  const PATH = 'Data/';
public
  CarTexture : IQuadTexture;
  TileTexture: IQuadTexture;
  Font: IQuadFont;
  BlurShader: IQuadShader;
  constructor Load(Quad: IQuadRender); 
  destructor Destroy;
end;

var
  Resources:TResources;

implementation

//TResources
constructor TResources.Load(Quad: IQuadRender);
begin
  CarTexture:= Quad.CreateAndLoadTexture(0, PATH+'Tiles/Cars.png', CAR_SIZE, CAR_SIZE);
  TileTexture:= Quad.CreateAndLoadTexture(0, PATH+'Tiles/Tiles.png', TILE_SIZE, TILE_SIZE);



  Font:= Quad.CreateAndLoadFont(PATH + 'Font/Font.png', PATH + 'Font/Font.qef');

  BlurShader       := Quad.CreateShader;
  BlurShader.LoadPixelShader( PATH + 'Shaders/ps_temp.bin' );
  Font.SetIsSmartColoring(True);
end;

destructor TResources.Destroy;
begin
  CarTexture:= nil;
  TileTexture:= nil;
  Font:= nil;
  BlurShader:= nil;
  inherited;
end;

end.
