Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #185 from VityaSchel/main
Browse files Browse the repository at this point in the history
AddImageQuad
  • Loading branch information
dertseha authored Sep 22, 2022
2 parents b51a58d + 1a6e4b7 commit ea251c1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DrawList.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,18 @@ func (list DrawList) AddImageV(textureID TextureID, posMin Vec2, posMax Vec2, uv
C.iggAddImage(list.handle(), C.IggTextureID(textureID), posMinArg, posMaxArg, uvMinArg, uvMaxArg, C.IggPackedColor(tintCol))
}

func (list DrawList) AddImageQuad(textureID TextureID, p1 Vec2, p2 Vec2, p3 Vec2, p4 Vec2, uv1 Vec2, uv2 Vec2, uv3 Vec2, uv4 Vec2, tintCol PackedColor) {
p1Arg, _ := p1.wrapped()
p2Arg, _ := p2.wrapped()
p3Arg, _ := p3.wrapped()
p4Arg, _ := p4.wrapped()
uv1Arg, _ := uv1.wrapped()
uv2Arg, _ := uv2.wrapped()
uv3Arg, _ := uv3.wrapped()
uv4Arg, _ := uv4.wrapped()
C.iggAddImageQuad(list.handle(), C.IggTextureID(textureID), p1Arg, p2Arg, p3Arg, p4Arg, uv1Arg, uv2Arg, uv3Arg, uv4Arg, C.IggPackedColor(tintCol))
}

// PushClipRect performs render-level scissoring.
// It calls PushClipRectV(min, max, false).
func (list DrawList) PushClipRect(min, max Vec2) {
Expand Down
14 changes: 14 additions & 0 deletions wrapper/DrawList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ void iggAddImage(IggDrawList handle, IggTextureID textureID, IggVec2* pMin, IggV
list->AddImage(reinterpret_cast<ImTextureID>(textureID), *pMinArg, *pMaxArg, *uvMinArg, *uvMaxArg, col);
}

void iggAddImageQuad(IggDrawList handle, IggTextureID textureID, IggVec2* p1, IggVec2* p2, IggVec2* p3, IggVec2* p4, IggVec2* uv1, IggVec2* uv2, IggVec2* uv3, IggVec2* uv4, IggPackedColor col) {
Vec2Wrapper p1Arg(p1);
Vec2Wrapper p2Arg(p2);
Vec2Wrapper p3Arg(p3);
Vec2Wrapper p4Arg(p4);
Vec2Wrapper uv1Arg(uv1);
Vec2Wrapper uv2Arg(uv2);
Vec2Wrapper uv3Arg(uv3);
Vec2Wrapper uv4Arg(uv4);

ImDrawList* list = reinterpret_cast<ImDrawList *>(handle);
list->AddImageQuad(reinterpret_cast<ImTextureID>(textureID), p1Arg*, p2Arg*, p3Arg*, p4Arg*, uv1Arg*, uv2Arg*, uv3Arg*, uv4Arg*, col);
}

void iggPushClipRect(IggDrawList handle, IggVec2 const *min, IggVec2 const *max, IggBool intersectWithCurrentClipRect)
{
ImDrawList *list = reinterpret_cast<ImDrawList *>(handle);
Expand Down

0 comments on commit ea251c1

Please sign in to comment.