From 27acc5efd9baed30110e8280acc436dcf9c20d07 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 22 Oct 2016 18:45:32 +0900 Subject: [PATCH] opengl: Use uint8 intead of byte --- internal/graphics/opengl/context_mobile.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index 13a1c9c8b..c8d209d5c 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -356,20 +356,20 @@ func (c *Context) DisableVertexAttribArray(p Program, location string) { gl.DisableVertexAttribArray(mgl.Attrib(l)) } -func uint16ToBytes(v []uint16) []byte { - b := make([]byte, len(v)*2) +func uint16ToBytes(v []uint16) []uint8 { + b := make([]uint8, len(v)*2) for i, x := range v { - b[2*i] = byte(x) - b[2*i+1] = byte(x >> 8) + b[2*i] = uint8(x) + b[2*i+1] = uint8(x >> 8) } return b } -func int16ToBytes(v []int16) []byte { - b := make([]byte, len(v)*2) +func int16ToBytes(v []int16) []uint8 { + b := make([]uint8, len(v)*2) for i, x := range v { - b[2*i] = byte(uint16(x)) - b[2*i+1] = byte(uint16(x) >> 8) + b[2*i] = uint8(uint16(x)) + b[2*i+1] = uint8(uint16(x) >> 8) } return b }