Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reenable imnodes #733

Merged
merged 8 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading