Beispiel #1
0
// TODO incorporate into Update, see FloatBuffer and UintBuffer
func (tex Texture) Sub(ctx gl.Context, lvl int, width int, height int, data []byte) {
	ctx.TexSubImage2D(gl.TEXTURE_2D, lvl, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data)
	if lvl > 0 {
		ctx.GenerateMipmap(gl.TEXTURE_2D)
	}
}