From 5c61284c84da3c514d7e6e626487cfb444bbb428 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 18 Feb 2016 03:01:41 +0900 Subject: [PATCH] graphics: Refactoring: Remove an unsed argument 'signed' --- internal/graphics/opengl/context.go | 8 ++------ internal/graphics/opengl/context_js.go | 8 ++------ internal/graphics/program.go | 4 ++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/internal/graphics/opengl/context.go b/internal/graphics/opengl/context.go index 35f9887d9..47be0dafd 100644 --- a/internal/graphics/opengl/context.go +++ b/internal/graphics/opengl/context.go @@ -257,13 +257,9 @@ func (c *Context) GetAttribLocation(p Program, location string) AttribLocation { return a } -func (c *Context) VertexAttribPointer(p Program, location string, signed bool, normalize bool, stride int, size int, v int) { +func (c *Context) VertexAttribPointer(p Program, location string, normalize bool, stride int, size int, v int) { l := GetAttribLocation(c, p, location) - t := gl.SHORT - if !signed { - t = gl.UNSIGNED_SHORT - } - gl.VertexAttribPointer(uint32(l), int32(size), uint32(t), normalize, int32(stride), gl.PtrOffset(v)) + gl.VertexAttribPointer(uint32(l), int32(size), gl.SHORT, normalize, int32(stride), gl.PtrOffset(v)) } func (c *Context) EnableVertexAttribArray(p Program, location string) { diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index dc8c7c48b..1a5c72ee7 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -319,14 +319,10 @@ func (c *Context) GetAttribLocation(p Program, location string) AttribLocation { return AttribLocation(gl.GetAttribLocation(p.Object, location)) } -func (c *Context) VertexAttribPointer(p Program, location string, signed bool, normalize bool, stride int, size int, v int) { +func (c *Context) VertexAttribPointer(p Program, location string, normalize bool, stride int, size int, v int) { gl := c.gl l := GetAttribLocation(c, p, location) - t := gl.SHORT - if !signed { - t = gl.UNSIGNED_SHORT - } - gl.VertexAttribPointer(int(l), size, t, normalize, stride, v) + gl.VertexAttribPointer(int(l), size, gl.SHORT, normalize, stride, v) } func (c *Context) EnableVertexAttribArray(p Program, location string) { diff --git a/internal/graphics/program.go b/internal/graphics/program.go index 3993d4ff4..7a4f88243 100644 --- a/internal/graphics/program.go +++ b/internal/graphics/program.go @@ -181,8 +181,8 @@ func (p *programContext) begin() { c.EnableVertexAttribArray(p.program, "vertex") c.EnableVertexAttribArray(p.program, "tex_coord") - c.VertexAttribPointer(p.program, "vertex", true, false, int16Size*4, 2, int16Size*0) - c.VertexAttribPointer(p.program, "tex_coord", true, true, int16Size*4, 2, int16Size*2) + c.VertexAttribPointer(p.program, "vertex", false, int16Size*4, 2, int16Size*0) + c.VertexAttribPointer(p.program, "tex_coord", true, int16Size*4, 2, int16Size*2) } func (p *programContext) end() {