diff --git a/internal/graphics/opengl/context_desktop.go b/internal/graphics/opengl/context_desktop.go index 07d1cb4f3..570d9fc22 100644 --- a/internal/graphics/opengl/context_desktop.go +++ b/internal/graphics/opengl/context_desktop.go @@ -432,7 +432,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati return attrib } -func (c *Context) VertexAttribPointer(p Program, location string, normalize bool, stride int, size int, offset int) { +func (c *Context) VertexAttribPointer(p Program, location string, size int, normalize bool, stride int, offset int) { _ = c.runOnContextThread(func() error { l := c.locationCache.GetAttribLocation(c, p, location) gl.VertexAttribPointer(uint32(l), int32(size), gl.SHORT, normalize, int32(stride), gl.PtrOffset(offset)) diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index 97189c5ec..d3633df6c 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -354,7 +354,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati return attribLocation(gl.GetAttribLocation(p.Object, location)) } -func (c *Context) VertexAttribPointer(p Program, location string, normalize bool, stride int, size int, offset int) { +func (c *Context) VertexAttribPointer(p Program, location string, size int, normalize bool, stride int, offset int) { gl := c.gl l := c.locationCache.GetAttribLocation(c, p, location) gl.VertexAttribPointer(int(l), size, gl.SHORT, normalize, stride, offset) diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index 4bcb7aa0c..99fd11180 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -336,7 +336,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati return a } -func (c *Context) VertexAttribPointer(p Program, location string, normalize bool, stride int, size int, offset int) { +func (c *Context) VertexAttribPointer(p Program, location string, size int, normalize bool, stride int, offset int) { gl := c.gl l := c.locationCache.GetAttribLocation(c, p, location) gl.VertexAttribPointer(mgl.Attrib(l), size, mgl.SHORT, normalize, stride, offset) diff --git a/internal/graphics/program.go b/internal/graphics/program.go index 5513a28c1..1fa6ecbc7 100644 --- a/internal/graphics/program.go +++ b/internal/graphics/program.go @@ -49,10 +49,9 @@ func (a *arrayBufferLayout) enable(c *opengl.Context, program opengl.Program) { } offset := 0 for _, p := range a.parts { - b := p.unit * p.num - // TODO: Argument order doesn't match with glVertexAttribPointer: Fix them. - c.VertexAttribPointer(program, p.name, p.normalize, total, b, offset) - offset += b + size := p.unit * p.num + c.VertexAttribPointer(program, p.name, size, p.normalize, total, offset) + offset += size } }