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

examples/gopher/gopher.go couldn't load PNG #36

Closed
tleyden opened this issue Feb 9, 2014 · 1 comment
Closed

examples/gopher/gopher.go couldn't load PNG #36

tleyden opened this issue Feb 9, 2014 · 1 comment

Comments

@tleyden
Copy link

tleyden commented Feb 9, 2014

Before fix:

func initScene() (err error) {

    texture, err = createTextureFromBytes(gopher_png[:])
    return
}

Gives compile error:

hornet: gopher$ go run gopher.go
# command-line-arguments
./gopher.go:119: undefined: gopher_png

After fix:

func initScene() (err error) {

    gopher_png, err := ioutil.ReadFile("gopher.png")
    if err != nil {
        panic("Could not load png")
    }

    texture, err = createTextureFromBytes(gopher_png)
    return
}
tleyden pushed a commit to tleyden/gogl that referenced this issue Feb 9, 2014
@chsc
Copy link
Owner

chsc commented Feb 11, 2014

No, the PNG image is embedded in gopher.png.go.
Please compile/run the full source code with "go build" or "go run gopher.go gopher.png.go".

@chsc chsc closed this as completed Feb 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants