mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
opengl: Fix argument order of VertexAttribPointer
This commit is contained in:
parent
80e3a3497c
commit
e5e9b178ae
@ -432,7 +432,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati
|
|||||||
return attrib
|
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 {
|
_ = c.runOnContextThread(func() error {
|
||||||
l := c.locationCache.GetAttribLocation(c, p, location)
|
l := c.locationCache.GetAttribLocation(c, p, location)
|
||||||
gl.VertexAttribPointer(uint32(l), int32(size), gl.SHORT, normalize, int32(stride), gl.PtrOffset(offset))
|
gl.VertexAttribPointer(uint32(l), int32(size), gl.SHORT, normalize, int32(stride), gl.PtrOffset(offset))
|
||||||
|
@ -354,7 +354,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati
|
|||||||
return attribLocation(gl.GetAttribLocation(p.Object, location))
|
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
|
gl := c.gl
|
||||||
l := c.locationCache.GetAttribLocation(c, p, location)
|
l := c.locationCache.GetAttribLocation(c, p, location)
|
||||||
gl.VertexAttribPointer(int(l), size, gl.SHORT, normalize, stride, offset)
|
gl.VertexAttribPointer(int(l), size, gl.SHORT, normalize, stride, offset)
|
||||||
|
@ -336,7 +336,7 @@ func (c *Context) getAttribLocationImpl(p Program, location string) attribLocati
|
|||||||
return a
|
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
|
gl := c.gl
|
||||||
l := c.locationCache.GetAttribLocation(c, p, location)
|
l := c.locationCache.GetAttribLocation(c, p, location)
|
||||||
gl.VertexAttribPointer(mgl.Attrib(l), size, mgl.SHORT, normalize, stride, offset)
|
gl.VertexAttribPointer(mgl.Attrib(l), size, mgl.SHORT, normalize, stride, offset)
|
||||||
|
@ -49,10 +49,9 @@ func (a *arrayBufferLayout) enable(c *opengl.Context, program opengl.Program) {
|
|||||||
}
|
}
|
||||||
offset := 0
|
offset := 0
|
||||||
for _, p := range a.parts {
|
for _, p := range a.parts {
|
||||||
b := p.unit * p.num
|
size := p.unit * p.num
|
||||||
// TODO: Argument order doesn't match with glVertexAttribPointer: Fix them.
|
c.VertexAttribPointer(program, p.name, size, p.normalize, total, offset)
|
||||||
c.VertexAttribPointer(program, p.name, p.normalize, total, b, offset)
|
offset += size
|
||||||
offset += b
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user