From 3d3a1be1c42712498f8770ec32da755bdc8ded44 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 24 Nov 2019 18:07:21 +0900 Subject: [PATCH] graphicsdriver/opengl: Use glTexSubImage2D instead of glTexImage2D --- internal/graphicsdriver/opengl/context_desktop.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/graphicsdriver/opengl/context_desktop.go b/internal/graphicsdriver/opengl/context_desktop.go index 9259f1471..3d7e7fb16 100644 --- a/internal/graphicsdriver/opengl/context_desktop.go +++ b/internal/graphicsdriver/opengl/context_desktop.go @@ -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 })