mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
opengl: Use uint8 intead of byte
This commit is contained in:
parent
1ceee5c4cb
commit
27acc5efd9
@ -356,20 +356,20 @@ func (c *Context) DisableVertexAttribArray(p Program, location string) {
|
|||||||
gl.DisableVertexAttribArray(mgl.Attrib(l))
|
gl.DisableVertexAttribArray(mgl.Attrib(l))
|
||||||
}
|
}
|
||||||
|
|
||||||
func uint16ToBytes(v []uint16) []byte {
|
func uint16ToBytes(v []uint16) []uint8 {
|
||||||
b := make([]byte, len(v)*2)
|
b := make([]uint8, len(v)*2)
|
||||||
for i, x := range v {
|
for i, x := range v {
|
||||||
b[2*i] = byte(x)
|
b[2*i] = uint8(x)
|
||||||
b[2*i+1] = byte(x >> 8)
|
b[2*i+1] = uint8(x >> 8)
|
||||||
}
|
}
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func int16ToBytes(v []int16) []byte {
|
func int16ToBytes(v []int16) []uint8 {
|
||||||
b := make([]byte, len(v)*2)
|
b := make([]uint8, len(v)*2)
|
||||||
for i, x := range v {
|
for i, x := range v {
|
||||||
b[2*i] = byte(uint16(x))
|
b[2*i] = uint8(uint16(x))
|
||||||
b[2*i+1] = byte(uint16(x) >> 8)
|
b[2*i+1] = uint8(uint16(x) >> 8)
|
||||||
}
|
}
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user