graphicsdriver/opengl: Use glTexSubImage2D instead of glTexImage2D

This commit is contained in:
Hajime Hoshi 2019-11-24 18:07:21 +09:00
parent 9f483ddc60
commit 3d3a1be1c4

View File

@ -540,7 +540,7 @@ func (c *context) mapPixelBuffer(buffer buffer, t textureNative) uintptr {
func (c *context) unmapPixelBuffer(buffer buffer, width, height int) {
_ = c.t.Call(func() error {
gl.UnmapBuffer(gl.PIXEL_UNPACK_BUFFER)
gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, int32(width), int32(height), 0, gl.RGBA, gl.UNSIGNED_BYTE, nil)
gl.TexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, nil)
gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, 0)
return nil
})