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

Errors in examples/glh/textureatlas #17

Closed
DalaiLlama opened this issue Dec 15, 2012 · 2 comments
Closed

Errors in examples/glh/textureatlas #17

DalaiLlama opened this issue Dec 15, 2012 · 2 comments

Comments

@DalaiLlama
Copy link

When running "$ go run main.go" in examples/glh/textureatlas, you get the following errors:

command-line-arguments

./main.go:49: not enough arguments in call to atlas.Bind
./main.go:60: not enough arguments in call to atlas.Unbind
./main.go:112: not enough arguments in call to a.Commit

It can be fixed with the following patch:

From 84adce516b2c5108dcc4c422509e0ac41771fea6 Mon Sep 17 00:00:00 2001
From: Andrew Appleby <andy.appleby83@gmail.com>
Date: Sat, 15 Dec 2012 17:18:51 +0100
Subject: [PATCH] Fixes textureatlas example

---
 glh/textureatlas/main.go |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/glh/textureatlas/main.go b/glh/textureatlas/main.go
index 68d4df4..a0f4e7a 100644
--- a/glh/textureatlas/main.go
+++ b/glh/textureatlas/main.go
@@ -46,7 +46,7 @@ func main() {
        gl.Clear(gl.COLOR_BUFFER_BIT)

        // Bind the atlas texture and render a quad with it.
-       atlas.Bind()
+       atlas.Bind(gl.TEXTURE_2D)
        gl.Begin(gl.QUADS)
        gl.TexCoord2f(0, 0)
        gl.Vertex2f(0, 0)
@@ -57,7 +57,7 @@ func main() {
        gl.TexCoord2f(0, 1)
        gl.Vertex2f(0, AtlasSize)
        gl.End()
-       atlas.Unbind()
+       atlas.Unbind(gl.TEXTURE_2D)

        glfw.SwapBuffers()
    }
@@ -109,7 +109,7 @@ func fillAtlas(a *glh.TextureAtlas) {
    //atlas.Save("atlas.png")

    // This creates the texture from the atlas pixel data.
-   a.Commit()
+   a.Commit(gl.TEXTURE_2D)
 }

 // initGL initializes GLFW and OpenGL.
-- 
1.7.9.5
@ghost
Copy link

ghost commented Dec 15, 2012

Oops. It seems the examples have not been updated since a recent change,

@ghost
Copy link

ghost commented Dec 16, 2012

All done.

@ghost ghost closed this as completed Dec 16, 2012
This issue was closed.
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

1 participant