diff --git a/internal/graphics/command.go b/internal/graphics/command.go index 010f21759..a5cfb1cd8 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -371,11 +371,9 @@ func (c *newImageCommand) Exec(indexOffsetInBytes int) error { // newScreenFramebufferImageCommand is a command to create a special image for the screen. type newScreenFramebufferImageCommand struct { - result *Image - width int - height int - offsetX float64 - offsetY float64 + result *Image + width int + height int } // Exec executes a newScreenFramebufferImageCommand. @@ -389,6 +387,6 @@ func (c *newScreenFramebufferImageCommand) Exec(indexOffsetInBytes int) error { // The (default) framebuffer size can't be converted to a power of 2. // On browsers, c.width and c.height are used as viewport size and // Edge can't treat a bigger viewport than the drawing area (#71). - c.result.framebuffer = newScreenFramebuffer(c.width, c.height, c.offsetX, c.offsetY) + c.result.framebuffer = newScreenFramebuffer(c.width, c.height) return nil } diff --git a/internal/graphics/framebuffer.go b/internal/graphics/framebuffer.go index a4f941226..f8999c55e 100644 --- a/internal/graphics/framebuffer.go +++ b/internal/graphics/framebuffer.go @@ -43,11 +43,6 @@ type framebuffer struct { proMatrix []float32 width int height int - - // offsetX and offsetY are translation part of the projection matrix. - // offsetX and offsetY are used for the fullscreen mode. - offsetX float64 - offsetY float64 } // newFramebufferFromTexture creates a framebuffer from the given texture. @@ -64,14 +59,12 @@ func newFramebufferFromTexture(texture *texture, width, height int) (*framebuffe } // newScreenFramebuffer creates a framebuffer for the screen. -func newScreenFramebuffer(width, height int, offsetX, offsetY float64) *framebuffer { +func newScreenFramebuffer(width, height int) *framebuffer { return &framebuffer{ - native: opengl.GetContext().ScreenFramebuffer(), - flipY: true, - width: width, - height: height, - offsetX: offsetX, - offsetY: offsetY, + native: opengl.GetContext().ScreenFramebuffer(), + flipY: true, + width: width, + height: height, } } diff --git a/internal/graphics/image.go b/internal/graphics/image.go index c4487ba44..c7d86bb90 100644 --- a/internal/graphics/image.go +++ b/internal/graphics/image.go @@ -60,17 +60,15 @@ func NewImageFromImage(img *image.RGBA, width, height int) *Image { return i } -func NewScreenFramebufferImage(width, height int, offsetX, offsetY float64) *Image { +func NewScreenFramebufferImage(width, height int) *Image { i := &Image{ width: width, height: height, } c := &newScreenFramebufferImageCommand{ - result: i, - width: width, - height: height, - offsetX: offsetX, - offsetY: offsetY, + result: i, + width: width, + height: height, } theCommandQueue.Enqueue(c) return i diff --git a/internal/restorable/image.go b/internal/restorable/image.go index f9cdc2a91..89cd6cb9d 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -119,7 +119,7 @@ func NewImageFromImage(source image.Image) *Image { // NewScreenFramebufferImage creates a special image that framebuffer is one for the screen. func NewScreenFramebufferImage(width, height int, paddingX0, paddingY0, paddingX1, paddingY1 float64) *Image { i := &Image{ - image: graphics.NewScreenFramebufferImage(width, height, paddingX0, paddingY0), + image: graphics.NewScreenFramebufferImage(width, height), volatile: true, screen: true, paddingX0: paddingX0, @@ -322,7 +322,7 @@ func (i *Image) restore() error { if i.screen { // The screen image should also be recreated because framebuffer might // be changed. - i.image = graphics.NewScreenFramebufferImage(w, h, i.paddingX0, i.paddingY0) + i.image = graphics.NewScreenFramebufferImage(w, h) i.basePixels = nil i.drawImageHistory = nil i.stale = false