mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +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 {
|
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)
|
ok, err := mipmap.ReadPixels(u.graphicsDriver, pixels, region)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user