diff --git a/platform/imgui/imgui.go b/platform/imgui/imgui.go index a0c4a0c..8658545 100644 --- a/platform/imgui/imgui.go +++ b/platform/imgui/imgui.go @@ -4,6 +4,7 @@ package imgui // #include "native.h" import "C" import ( + "fmt" "unsafe" "github.com/FooSoft/lazarus/graphics" @@ -54,7 +55,8 @@ func SliderInt(label string, value *int, min, max int) bool { return result } -func Text(label string) { +func Text(format string, args ...interface{}) { + label := fmt.Sprintf(format, args...) labelStartC := C.CString(label) labelEndC := (*C.char)(unsafe.Pointer(uintptr(unsafe.Pointer(labelStartC)) + uintptr(len(label)))) defer C.free(unsafe.Pointer(labelStartC)) diff --git a/tools/viewer/viewer.go b/tools/viewer/viewer.go index 772eba4..7400e06 100644 --- a/tools/viewer/viewer.go +++ b/tools/viewer/viewer.go @@ -77,11 +77,11 @@ func (s *scene) Advance() error { imgui.Columns(2) imgui.Text("Size") imgui.NextColumn() - imgui.Text(fmt.Sprintf("%+v", frame.Size)) + imgui.Text("%+v", frame.Size) imgui.NextColumn() imgui.Text("Offset") imgui.NextColumn() - imgui.Text(fmt.Sprintf("%+v", frame.Offset)) + imgui.Text("%+v", frame.Offset) imgui.Columns(1) if imgui.Button("Exit") { platform.WindowSetScene(nil)