graphics: Refactoring: Remove an unsed argument 'signed'

This commit is contained in:
Hajime Hoshi 2016-02-18 03:01:41 +09:00
parent fc9f537445
commit 5c61284c84
3 changed files with 6 additions and 14 deletions

View File

@ -257,13 +257,9 @@ func (c *Context) GetAttribLocation(p Program, location string) AttribLocation {
return a 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) l := GetAttribLocation(c, p, location)
t := gl.SHORT gl.VertexAttribPointer(uint32(l), int32(size), gl.SHORT, normalize, int32(stride), gl.PtrOffset(v))
if !signed {
t = gl.UNSIGNED_SHORT
}
gl.VertexAttribPointer(uint32(l), int32(size), uint32(t), normalize, int32(stride), gl.PtrOffset(v))
} }
func (c *Context) EnableVertexAttribArray(p Program, location string) { func (c *Context) EnableVertexAttribArray(p Program, location string) {

View File

@ -319,14 +319,10 @@ func (c *Context) GetAttribLocation(p Program, location string) AttribLocation {
return AttribLocation(gl.GetAttribLocation(p.Object, location)) 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 gl := c.gl
l := GetAttribLocation(c, p, location) l := GetAttribLocation(c, p, location)
t := gl.SHORT gl.VertexAttribPointer(int(l), size, gl.SHORT, normalize, stride, v)
if !signed {
t = gl.UNSIGNED_SHORT
}
gl.VertexAttribPointer(int(l), size, t, normalize, stride, v)
} }
func (c *Context) EnableVertexAttribArray(p Program, location string) { func (c *Context) EnableVertexAttribArray(p Program, location string) {

View File

@ -181,8 +181,8 @@ func (p *programContext) begin() {
c.EnableVertexAttribArray(p.program, "vertex") c.EnableVertexAttribArray(p.program, "vertex")
c.EnableVertexAttribArray(p.program, "tex_coord") c.EnableVertexAttribArray(p.program, "tex_coord")
c.VertexAttribPointer(p.program, "vertex", true, false, int16Size*4, 2, int16Size*0) c.VertexAttribPointer(p.program, "vertex", false, int16Size*4, 2, int16Size*0)
c.VertexAttribPointer(p.program, "tex_coord", true, true, int16Size*4, 2, int16Size*2) c.VertexAttribPointer(p.program, "tex_coord", true, int16Size*4, 2, int16Size*2)
} }
func (p *programContext) end() { func (p *programContext) end() {