mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
opengl: Remove (*Image).Size
This commit is contained in:
parent
beae772287
commit
293857d3a3
@ -72,10 +72,6 @@ func NewScreenFramebufferImage(width, height int) *Image {
|
|||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) Size() (int, int) {
|
|
||||||
return i.width, i.height
|
|
||||||
}
|
|
||||||
|
|
||||||
func (i *Image) IsInvalidated() bool {
|
func (i *Image) IsInvalidated() bool {
|
||||||
return !theContext.isTexture(i.textureNative)
|
return !theContext.isTexture(i.textureNative)
|
||||||
}
|
}
|
||||||
@ -101,8 +97,7 @@ func (i *Image) Pixels() ([]byte, error) {
|
|||||||
if err := i.ensureFramebuffer(); err != nil {
|
if err := i.ensureFramebuffer(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
w, h := i.Size()
|
p, err := theContext.framebufferPixels(i.Framebuffer, i.width, i.height)
|
||||||
p, err := theContext.framebufferPixels(i.Framebuffer, w, h)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -120,7 +115,7 @@ func (i *Image) ensureFramebuffer() error {
|
|||||||
if i.Framebuffer != nil {
|
if i.Framebuffer != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
w, h := i.Size()
|
w, h := i.width, i.height
|
||||||
f, err := newFramebufferFromTexture(i.textureNative, math.NextPowerOf2Int(w), math.NextPowerOf2Int(h))
|
f, err := newFramebufferFromTexture(i.textureNative, math.NextPowerOf2Int(w), math.NextPowerOf2Int(h))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user