mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
graphicsdriver: Rename TexSubImage2D -> ReplacePixels
This commit is contained in:
parent
61ca48225c
commit
2f692d98c7
@ -237,11 +237,6 @@ func (c *drawImageCommand) Exec(indexOffsetInBytes int) error {
|
||||
return err
|
||||
}
|
||||
driver().DrawElements(c.nindices, indexOffsetInBytes)
|
||||
|
||||
// glFlush() might be necessary at least on MacBook Pro (a smilar problem at #419),
|
||||
// but basically this pass the tests (esp. TestImageTooManyFill).
|
||||
// As glFlush() causes performance problems, this should be avoided as much as possible.
|
||||
// Let's wait and see, and file a new issue when this problem is newly found.
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -298,10 +293,7 @@ func (c *replacePixelsCommand) String() string {
|
||||
|
||||
// Exec executes the replacePixelsCommand.
|
||||
func (c *replacePixelsCommand) Exec(indexOffsetInBytes int) error {
|
||||
// glFlush is necessary on Android.
|
||||
// glTexSubImage2D didn't work without this hack at least on Nexus 5x and NuAns NEO [Reloaded] (#211).
|
||||
driver().Flush()
|
||||
c.dst.image.TexSubImage2D(c.pixels, c.x, c.y, c.width, c.height)
|
||||
c.dst.image.ReplacePixels(c.pixels, c.x, c.y, c.width, c.height)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -36,5 +36,5 @@ type Image interface {
|
||||
Pixels() ([]byte, error)
|
||||
SetAsDestination()
|
||||
SetAsSource()
|
||||
TexSubImage2D(p []byte, x, y, width, height int)
|
||||
ReplacePixels(pixels []byte, x, y, width, height int)
|
||||
}
|
||||
|
@ -77,6 +77,10 @@ func (d *Driver) UseProgram(mode graphics.CompositeMode, colorM *affine.ColorM,
|
||||
|
||||
func (d *Driver) DrawElements(len int, offsetInBytes int) {
|
||||
theContext.drawElements(len, offsetInBytes)
|
||||
// glFlush() might be necessary at least on MacBook Pro (a smilar problem at #419),
|
||||
// but basically this pass the tests (esp. TestImageTooManyFill).
|
||||
// As glFlush() causes performance problems, this should be avoided as much as possible.
|
||||
// Let's wait and see, and file a new issue when this problem is newly found.
|
||||
}
|
||||
|
||||
func (d *Driver) Flush() {
|
||||
|
@ -100,7 +100,10 @@ func (i *Image) ensureFramebuffer() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *Image) TexSubImage2D(p []byte, x, y, width, height int) {
|
||||
func (i *Image) ReplacePixels(p []byte, x, y, width, height int) {
|
||||
// glFlush is necessary on Android.
|
||||
// glTexSubImage2D didn't work without this hack at least on Nexus 5x and NuAns NEO [Reloaded] (#211).
|
||||
theContext.flush()
|
||||
theContext.texSubImage2D(i.textureNative, p, x, y, width, height)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user