Skip to content

Commit

Permalink
canvas: implement ImageQuad
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Oct 24, 2023
1 parent 89122c3 commit 6769c74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func (c *Canvas) AddImage(texture *Texture, pMin, pMax image.Point) {
c.DrawList.AddImage(texture.ID(), ToVec2(pMin), ToVec2(pMax))
}

func (c *Canvas) AddImageQuad(texture *Texture, p1, p2, p3, p4, uv1, uv2, uv3, uv4 image.Point, col color.Color) {
c.DrawList.AddImageQuadV(texture.tex.ID(), ToVec2(p1), ToVec2(p2), ToVec2(p3), ToVec2(p4), ToVec2(uv1), ToVec2(uv2), ToVec2(uv3), ToVec2(uv4), ColorToUint(col))
}

func (c *Canvas) AddImageV(texture *Texture, pMin, pMax, uvMin, uvMax image.Point, col color.Color) {
c.DrawList.AddImageV(texture.tex.ID(), ToVec2(pMin), ToVec2(pMax), ToVec2(uvMin), ToVec2(uvMax), ColorToUint(col))
}

0 comments on commit 6769c74

Please sign in to comment.