graphicsdriver/opengl: Add assertion at ReplacePixels

This commit is contained in:
Hajime Hoshi 2018-11-18 02:09:44 +09:00
parent 31f15bc5ad
commit 62210c89f3

View File

@ -86,6 +86,11 @@ func (i *Image) ensureFramebuffer() error {
} }
func (i *Image) ReplacePixels(p []byte, x, y, width, height int) { func (i *Image) ReplacePixels(p []byte, x, y, width, height int) {
if i.screen {
// The screen image doesn't have a texture to replace pixels.
panic("not reached")
}
// glFlush is necessary on Android. // glFlush is necessary on Android.
// glTexSubImage2D didn't work without this hack at least on Nexus 5x and NuAns NEO [Reloaded] (#211). // glTexSubImage2D didn't work without this hack at least on Nexus 5x and NuAns NEO [Reloaded] (#211).
i.driver.context.flush() i.driver.context.flush()