diff --git a/image.go b/image.go index fa06c1fcf..e4b5ef50d 100644 --- a/image.go +++ b/image.go @@ -67,9 +67,6 @@ func (i *images) restorePixels(context *opengl.Context) error { // If framebuffers/textures are not disposed here, a newly created framebuffer/texture // number can be a same number as existing one. for img := range i.images { - if img.screen { - continue - } if img.isDisposed() { continue } @@ -206,7 +203,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) { if err != nil { return nil, err } - if err := img.image.Fill(color.Transparent); err != nil { + if err := img.Fill(color.Transparent); err != nil { return nil, err } eimg, err := theImages.add(img) @@ -260,10 +257,5 @@ func newImageWithScreenFramebuffer(width, height int) (*Image, error) { if err != nil { return nil, err } - img.screen = true - eimg, err := theImages.add(img) - if err != nil { - return nil, err - } - return eimg, nil + return &Image{img}, nil } diff --git a/imageimpl.go b/imageimpl.go index ca371773e..d25ce5a8b 100644 --- a/imageimpl.go +++ b/imageimpl.go @@ -30,7 +30,6 @@ import ( type imageImpl struct { image *graphics.Image - screen bool disposed bool width int height int @@ -147,9 +146,6 @@ func (i *imageImpl) savePixels(context *opengl.Context) error { func (i *imageImpl) restorePixels() error { i.m.Lock() defer i.m.Unlock() - if i.screen { - return nil - } if i.disposed { return nil }