Closed kondratev closed 4 years ago
this fix a sdl build
diff --git a/cmd/nk-example-sdl2/main.go b/cmd/nk-example-sdl2/main.go
index 4c0243b..011e675 100644
--- a/cmd/nk-example-sdl2/main.go
+++ b/cmd/nk-example-sdl2/main.go
@@ -128,7 +128,9 @@ func gfxMain(win *sdl.Window, ctx *nk.Context, state *State) {
size := nk.NkVec2(nk.NkWidgetWidth(ctx), 400)
if nk.NkComboBeginColor(ctx, state.bgColor, size) > 0 {
nk.NkLayoutRowDynamic(ctx, 120, 1)
- state.bgColor = nk.NkColorPicker(ctx, state.bgColor, nk.ColorFormatRGBA)
+ cf := nk.NkColorCf(state.bgColor)
+ cf = nk.NkColorPicker(ctx, cf, nk.ColorFormatRGBA)
+ state.bgColor = nk.NkRgbCf(cf)
nk.NkLayoutRowDynamic(ctx, 25, 1)
r, g, b, a := state.bgColor.RGBAi()
r = nk.NkPropertyi(ctx, "#R:", 0, r, 255, 1, 1)
Hi,
I am getting the same error. Is there any workaround for this?
Error: ./main.go:112:37: undefined: flag ./main.go:115:37: undefined: flag
Regards, Swathin
@kondratev @swathins079 you should not build main.go
only, the package has other files as well, including util.go
Build the binary:
go build -tags sdl2 github.com/golang-ui/nuklear/cmd/nk-example-sdl2
or install:
go install -tags sdl2 github.com/golang-ui/nuklear/cmd/nk-example-sdl2
Environment: $ env | grep GO111MODULE
$ go version
$ git log --pretty=oneline | head -n1
$ git branch
Build: $ cd cmd/nk-example-sdl2/ $ go build -tags sdl2 main.go