mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
internal/graphicsdriver/opengl: Refactoring: Remove unused arguments from texSubImage2D
This commit is contained in:
parent
fa8e271f2a
commit
7f60cd41eb
@ -452,7 +452,7 @@ func (c *context) canUsePBO() bool {
|
|||||||
return isPBOAvailable()
|
return isPBOAvailable()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) {
|
func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
|
||||||
c.bindTexture(t)
|
c.bindTexture(t)
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
gl.TexSubImage2D(gl.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(a.Pixels))
|
gl.TexSubImage2D(gl.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(a.Pixels))
|
||||||
|
@ -533,7 +533,7 @@ func (c *context) canUsePBO() bool {
|
|||||||
return isWebGL2Available
|
return isWebGL2Available
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) {
|
func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
|
||||||
c.bindTexture(t)
|
c.bindTexture(t)
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
|
@ -419,7 +419,7 @@ func (c *context) canUsePBO() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) texSubImage2D(t textureNative, width, height int, args []*driver.ReplacePixelsArgs) {
|
func (c *context) texSubImage2D(t textureNative, args []*driver.ReplacePixelsArgs) {
|
||||||
c.bindTexture(t)
|
c.bindTexture(t)
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
c.ctx.TexSubImage2D(gles.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gles.RGBA, gles.UNSIGNED_BYTE, a.Pixels)
|
c.ctx.TexSubImage2D(gles.TEXTURE_2D, 0, int32(a.X), int32(a.Y), int32(a.Width), int32(a.Height), gles.RGBA, gles.UNSIGNED_BYTE, a.Pixels)
|
||||||
|
@ -120,12 +120,12 @@ func (i *Image) ReplacePixels(args []*driver.ReplacePixelsArgs) {
|
|||||||
}
|
}
|
||||||
i.graphics.drawCalled = false
|
i.graphics.drawCalled = false
|
||||||
|
|
||||||
w, h := i.width, i.height
|
|
||||||
if !i.graphics.context.canUsePBO() {
|
if !i.graphics.context.canUsePBO() {
|
||||||
i.graphics.context.texSubImage2D(i.textureNative, w, h, args)
|
i.graphics.context.texSubImage2D(i.textureNative, args)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w, h := i.width, i.height
|
||||||
if i.pbo.equal(*new(buffer)) {
|
if i.pbo.equal(*new(buffer)) {
|
||||||
i.pbo = i.graphics.context.newPixelBufferObject(w, h)
|
i.pbo = i.graphics.context.newPixelBufferObject(w, h)
|
||||||
if i.pbo.equal(*new(buffer)) {
|
if i.pbo.equal(*new(buffer)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user