unit ant_renderer;

//
//  World renderer.
//

{$MODE FPC}
{$MODESWITCH DEFAULTPARAMETERS}
{$MODESWITCH OUT}
{$MODESWITCH RESULT}

interface

uses
  ant_world,
  ant_camera,
  ant_resources,
  ant_mesh;

type
PRenderer = ^TRenderer;
TRenderer = object
private
  FWorld: PWorld;
  FCamera: TCamera;

public
  procedure Init(World: PWorld);
  procedure Done;
  procedure Update;

  procedure Render(Camera: PCamera; FrameFactor: Single);
  // The FrameFactor is between 0..1 and specifies factor between previous
  // and last frame for interpolation.
end;

implementation

procedure TRenderer.Init(World: PWorld);
begin
  FWorld := World;
  FCamera.Init;
end;

procedure TRenderer.Done;
begin
  FCamera.Done;
end;

procedure TRenderer.Update;
begin
end;

procedure TRenderer.Render(Camera: PCamera; FrameFactor: Single);
begin
  Camera^.Setup(FrameFactor);
  Res.Shaders.Diffuse.Use;
  Res.Shaders.Diffuse.Unuse;
end;

end.
