mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphics: Refactoring: Remove an unsed argument 'signed'
This commit is contained in:
parent
fc9f537445
commit
5c61284c84
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user