{$IFDEF ANDROID}
procedure TDraw.glOrtho(Left, Right, Bottom, Top, NearVal, FarVal: Double);
begin
  Log('TODO TDraw.glOrtho');
end;
{$ENDIF}

constructor TDraw.Init(WinApi: PWinApi);
begin
  FWinApi := WinApi;
end;

procedure TDraw.OnInit;
begin
  FWidth := 1;
end;

function TDraw.IsOpenGL: Boolean;
begin
  Exit(False);
end;

function TDraw.IsVulkan: Boolean;
begin
  Exit(True);
end;

procedure TDraw.BeginRender;
begin
  Log('TODO TDraw.BeginRender');
end;

procedure TDraw.Start2D;
begin
  Log('TODO TDraw.Start2D');
end;

procedure TDraw.Start2D(const Pos, Size: TVec2i);
begin
  Log('TODO TDraw.Start2D');
end;

procedure TDraw.Start2D(const Pos: TVec2i; Coeff: Single);
begin
  Log('TODO TDraw.Start2D');
end;

procedure TDraw.End2D;
begin
  Log('TODO TDraw.End2D');
end;

procedure TDraw.Start3D(FOVYInDegrees: Single = 90;
                  Aspect: Single = 0;
                  ZNear: Single = 0.1;
                  ZFar: Single = 1000.0);
begin
  Log('TODO TDraw.Start3D');
end;

procedure TDraw.End3D;
begin
  Log('TODO TDraw.End3D');
end;

class procedure TDraw.SetColor(const Color: TVec4f);
begin
  Log('TODO TDraw.SetColor');
end;

procedure TDraw.DrawPixel(const P: TVec2i; const Color: TVec4f);
begin
  Log('TODO TDraw.DrawPixel');
end;

procedure TDraw.DrawLine(const P1, P2: TVec2i; const Color: TVec4f);
begin
  Log('TODO TDraw.DrawLine');
end;

procedure TDraw.DrawRect(const P1, P2: TVec2i; const Color: TVec4f);
begin
  Log('TODO TDraw.DrawRect');
end;

procedure TDraw.DrawCircle(const P: TVec2f; R: Single; const Color: TVec4f);
begin
  Log('TODO TDraw.DrawCircle');
end;

function TDraw.ResetMatrix: TDraw;
begin
  Log('TODO TDraw.ResetMatrix');
  Result := Self;
end;

function TDraw.PushMatrix: TDraw;
begin
  Log('TODO TDraw.PushMatrix');
  Result := Self;
end;

function TDraw.PopMatrix: TDraw;
begin
  Log('TODO TDraw.PopMatrix');
  Result := Self;
end;

function TDraw.MultMatrix(const M: TMat4f): TDraw;
begin
  Log('TODO TDraw.MultMatrix');
  Result := Self;
end;

function TDraw.Translate(const V: TVec2f): TDraw;
begin
  Log('TODO TDraw.Translate');
  Result := Self;
end;

function TDraw.Translate(const V: TVec3f): TDraw;
begin
  Log('TODO TDraw.Translate');
  Result := Self;
end;

function TDraw.Rotate(Angle: Single): TDraw;
begin
  Log('TODO TDraw.Rotate');
  Result := Self;
end;

function TDraw.Rotate(const V: TVec3f; Angle: Single): TDraw;
begin
  Log('TODO TDraw.Rotate');
  Result := Self;
end;

function TDraw.Scale(S: Single): TDraw;
begin
  Log('TODO TDraw.Scale');
  Result := Self;
end;

function TDraw.Scale(const V: TVec2f): TDraw;
begin
  Log('TODO TDraw.Scale');
  Result := Self;
end;

procedure TDraw.LookAt(const Eye, Center, Up: TVec3f);
begin
  Log('TODO TDraw.LookAt');
end;


procedure TDraw.DrawBuffer(X, Y, W, H: Integer; Data: Pointer);
begin
  Log('TODO TDraw.DrawBuffer');
end;

procedure TDraw.Pixel(const P: TVec2i; const Color: TVec4f);
begin
  Log('TODO TDraw.Pixel');
end;

procedure TDraw.Pixel(X, Y: LongInt; const Color: Cardinal);
begin
  Log('TODO TDraw.Pixel');
end;

function TDraw.Color(const Value: TVec4f): TDraw;
begin
  Log('TODO TDraw.Color');
  Result := Self;
end;

function TDraw.Color(const Value: Cardinal): TDraw;
begin
  Log('TODO TDraw.Color');
  Result := Self;
end;

function TDraw.RGBA(R, G, B, A: Byte): TDraw;
begin
  Log('TODO TDraw.RGBA');
  Result := Self;
end;

function TDraw.Width(W: Float): TDraw;
begin
  Log('TODO TDraw.Width');
  Result := Self;
end;

function TDraw.From(const Cursor: TVec2i): TDraw;
begin
  Log('TODO TDraw.From');
  Result := Self;
end;

function TDraw.BlendMode(Mode: TBlendMode): TDraw;
begin
  Log('TODO TDraw.BlendMode');
  Result := Self;
end;

procedure TDraw.EnableWireframe;
begin
  Log('TODO TDraw.EnableWireframe');
end;

procedure TDraw.DisableWireframe;
begin
  Log('TODO TDraw.DisableWireframe');
end;

procedure TDraw.EnableCull(Front: Boolean = True);
begin
  Log('TODO TDraw.EnableCull');
end;

procedure TDraw.DisableCull;
begin
  Log('TODO TDraw.DisableCull');
end;

function TDraw.Line(const A, B: TVec2i): TDraw;
begin
  Log('TODO TDraw.Line');
  Result := Self;
end;

function TDraw.Line(const A, B: TVec2f): TDraw;
begin
  Log('TODO TDraw.Line');
  Result := Self;
end;

function TDraw.LineTo(const Cursor: TVec2i): TDraw;
begin
  Log('TODO TDraw.LineTo');
  Result := Self;
end;

function TDraw.Rect(const R: TRect2i): TDraw;
begin
  Log('TODO TDraw.Rect');
  Result := Self;
end;

function TDraw.Rect(const R: TRect2f): TDraw;
begin
  Log('TODO TDraw.Rect');
  Result := Self;
end;

function TDraw.Circle(const P: TVec2f; R: Single): TDraw;
begin
  Log('TODO TDraw.Circle');
  Result := Self;
end;

function TDraw.RectFilled(const R: TRect2i): TDraw;
begin
  Log('TODO TDraw.RectFilled');
  Result := Self;
end;

function TDraw.RectFilled(const R: TRect2f): TDraw;
begin
  Log('TODO TDraw.RectFilled');
  Result := Self;
end;

function TDraw.CircleFilled(const P: TVec2f; R: Single): TDraw;
begin
  Log('TODO TDraw.CircleFilled');
  Result := Self;
end;

function TDraw.Triangle(const X1, Y1, X2, Y2, X3, Y3: Single): TDraw;
begin
  Log('TODO TDraw.Triangle');
  Result := Self;
end;

function TDraw.Triangle(const V1, V2, V3: TVec2f): TDraw;
begin
  Log('TODO TDraw.Triangle');
  Result := Self;
end;

function TDraw.Polygon(P: PPolygon2f): TDraw;
begin
  Log('TODO TDraw.Polygon');
  Result := Self;
end;

function TDraw.FilledPolygon(P: PPolygon2f): TDraw;
begin
  Log('TODO TDraw.FilledPolygon');
  Result := Self;
end;

function TDraw.Line(const A, B: TVec3f): TDraw;
begin
  Log('TODO TDraw.Line');
  Result := Self;
end;

function TDraw.AxisLines(const P: TVec3f; Size: Single = 1): TDraw;
begin
  Log('TODO TDraw.AxisLines');
  Result := Self;
end;

function TDraw.Triangles(var V: array of TVec3f): TDraw;
begin
  Log('TODO TDraw.Trinagles');
  Result := Self;
end;

function TDraw.Triangles(V: PVec2f; Count: SizeUInt): TDraw; overload;
begin
  Log('TODO TDraw.Trinagles');
  Result := Self;
end;

function TDraw.Triangles(var V: array of TVec2f): TDraw;
begin
  Log('TODO TDraw.Trinagles');
  Result := Self;
end;

function TDraw.Triangle(const V1, V2, V3: TVec3f): TDraw;
begin
  Log('TODO TDraw.Trinagles');
  Result := Self;
end;

function TDraw.AxisAlignedBox(const A, B: TVec3f): TDraw;
const
  Indices: array[0 .. 36 - 1] of TIndexBuffer.TIndex = (
    0, 2, 1,
    0, 3, 2,
    0, 1, 5,
    0, 5, 4,
    0, 7, 3,
    0, 4, 7,
    3, 6, 2,
    3, 7, 6,
    1, 6, 5,
    1, 2, 6,
    4, 6, 7,
    4, 5, 6
  );
var
  VB: TVertexBuffer;
  IB: TIndexBuffer;
  Vertices: array[0 .. 8 - 1] of TVec3f;
begin
  Vertices[0] := A;
  Vertices[1] := Vec3f(B.X, A.Y, A.Z);
  Vertices[2] := Vec3f(B.X, B.Y, A.Z);
  Vertices[3] := Vec3f(A.X, B.Y, A.Z);
  Vertices[4] := Vec3f(A.X, A.Y, B.Z);
  Vertices[5] := Vec3f(B.X, A.Y, B.Z);
  Vertices[6] := B;
  Vertices[7] := Vec3f(A.X, B.Y, B.Z);
  VB.Init(Vertices);
  IB.Init(Indices);
  VB.DrawTriangles(IB);
  IB.Done;
  VB.Done;
  Result := Self;
end;

procedure TDraw.Buffer(Data: Pointer; const P, S: TVec2i);
begin
  Log('TODO TDraw.Buffer');
end;

procedure TDraw.EndRender;
begin
  Log('TODO TDraw.EndRender');
end;

procedure TDraw.ClearScreen(const Color: TVec4f);
begin
  Log('TODO TDraw.ClearScreen');
end;

procedure TDraw.ClearScreen(R, G, B, A: Byte);
begin
  Log('TODO TDraw.ClearScreen');
end;

procedure TDraw.ReadScreen(Buf: PByte; W, H: LongInt);
begin
  Log('TODO TDraw.ReadScreen');
end;

procedure TDraw.SetBlendMode(Mode: TBlendMode);
begin
  Log('TODO TDraw.SetBlendMode');
end;
