Giter Club home page Giter Club logo

Comments (3)

kondratev avatar kondratev commented on July 30, 2024

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)

from nuklear.

swathinsankaran avatar swathinsankaran commented on July 30, 2024

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

from nuklear.

xlab avatar xlab commented on July 30, 2024

@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

from nuklear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.