mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
graphicsdriver/opengl: Use glTexSubImage2D instead of glTexImage2D
This commit is contained in:
parent
9f483ddc60
commit
3d3a1be1c4
@ -540,7 +540,7 @@ func (c *context) mapPixelBuffer(buffer buffer, t textureNative) uintptr {
|
|||||||
func (c *context) unmapPixelBuffer(buffer buffer, width, height int) {
|
func (c *context) unmapPixelBuffer(buffer buffer, width, height int) {
|
||||||
_ = c.t.Call(func() error {
|
_ = c.t.Call(func() error {
|
||||||
gl.UnmapBuffer(gl.PIXEL_UNPACK_BUFFER)
|
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)
|
gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, 0)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user