mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
internal/ui: better panic message at ReadPixels before RunGame
Closes #2979
This commit is contained in:
parent
35e29a29e7
commit
903ab6727b
@ -126,6 +126,10 @@ func newUserInterface() (*UserInterface, error) {
|
||||
}
|
||||
|
||||
func (u *UserInterface) readPixels(mipmap *mipmap.Mipmap, pixels []byte, region image.Rectangle) error {
|
||||
if !u.running.Load() {
|
||||
panic("ui: ReadPixels cannot be called before the game starts")
|
||||
}
|
||||
|
||||
ok, err := mipmap.ReadPixels(u.graphicsDriver, pixels, region)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user