Skip to content

Commit

Permalink
Merge pull request #733 from gucio321/add-nodes
Browse files Browse the repository at this point in the history
reenable imnodes
  • Loading branch information
gucio321 authored Feb 17, 2024
2 parents b906c79 + 1bff321 commit 67bf4a3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions FontAtlasProsessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
} else {
fontConfig.SetFontDataOwnedByAtlas(false)
fonts.AddFontFromMemoryTTFV(
unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte)), //nolint:gosec // we need this here
uintptr(unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte))), //nolint:gosec // we need this here
int32(len(fontInfo.fontByte)),
fontInfo.size,
fontConfig,
Expand Down Expand Up @@ -327,7 +327,7 @@ func (a *FontAtlas) rebuildFontAtlas() {
fontConfig := imgui.NewFontConfig()
fontConfig.SetFontDataOwnedByAtlas(false)
f = fonts.AddFontFromMemoryTTFV(
unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte)), //nolint:gosec // we need this here
uintptr(unsafe.Pointer(imgui.SliceToPtr(fontInfo.fontByte))), //nolint:gosec // we need this here
int32(len(fontInfo.fontByte)),
fontInfo.size,
fontConfig,
Expand Down
4 changes: 2 additions & 2 deletions MasterWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type MasterWindow struct {
func NewMasterWindow(title string, width, height int, flags MasterWindowFlags) *MasterWindow {
imGuiContext := imgui.CreateContext()
imgui.PlotCreateContext()
// imgui.ImNodesCreateContext() // TODO after implementing ImNodes in cimgui
imgui.ImNodesCreateContext()

io := imgui.CurrentIO()

Expand Down Expand Up @@ -207,7 +207,7 @@ func (w *MasterWindow) afterRender() {

func (w *MasterWindow) beforeDestroy() {
imgui.PlotDestroyContext()
// imgui.ImNodesDestroyContext() // TODO: after adding ImNodes (https://github.com/AllenDang/cimgui-go/issues/137)
imgui.ImNodesDestroyContext()
}

func (w *MasterWindow) render() {
Expand Down
2 changes: 1 addition & 1 deletion Texture.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (t *Texture) ID() imgui.TextureID {
return t.tex.ID()
}

return nil
return imgui.TextureID{}
}
4 changes: 2 additions & 2 deletions examples/dragdrop/dragdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func loop() {
data := 9
imgui.SetDragDropPayload(
"DND_DEMO",
unsafe.Pointer(&data),
uintptr(unsafe.Pointer(&data)),
0,
)
g.Label("9").Build()
Expand All @@ -32,7 +32,7 @@ func loop() {
data := 10
imgui.SetDragDropPayload(
"DND_DEMO",
unsafe.Pointer(&data),
uintptr(unsafe.Pointer(&data)),
0,
)
g.Label("10").Build()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/AllenDang/giu
go 1.21

require (
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
github.com/mazznoer/csscolorparser v0.1.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643 h1:lhxdXiabL5kqRx5VEHOABr8T25J+IbwxNsbmmSLGrEY=
github.com/AllenDang/cimgui-go v0.0.0-20231219093052-24bd5dc22643/go.mod h1:UH0IZCbsJKA1hAVQQU6AIDfamqTk0/d3VucaN8lp1Gs=
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe h1:hCgPHyxsipQgkSIDoDkFS6/axFK2tDqXgRySwqdYvZc=
github.com/AllenDang/cimgui-go v0.0.0-20240217115856-389161c9afbe/go.mod h1:e6feXR4FrATVY/UrWS3si3KCJOm0wruwbxVI/B85fUM=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 h1:dKZMqib/yUDoCFigmz2agG8geZ/e3iRq304/KJXqKyw=
github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8/go.mod h1:b4uuDd0s6KRIPa84cEEchdQ9ICh7K0OryZHbSzMca9k=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down

0 comments on commit 67bf4a3

Please sign in to comment.