graphics: Rename defaultR -> defaultRenderTarget

This commit is contained in:
Hajime Hoshi 2015-02-19 00:08:21 +09:00
parent eb0431f117
commit af09da1665

View File

@ -35,9 +35,9 @@ func newGraphicsContext(screenWidth, screenHeight, screenScale int) (*graphicsCo
} }
type graphicsContext struct { type graphicsContext struct {
screen *Image screen *Image
defaultR *Image defaultRenderTarget *Image
screenScale int screenScale int
} }
func (c *graphicsContext) preUpdate() error { func (c *graphicsContext) preUpdate() error {
@ -45,22 +45,22 @@ func (c *graphicsContext) preUpdate() error {
} }
func (c *graphicsContext) postUpdate() error { func (c *graphicsContext) postUpdate() error {
if err := c.defaultR.Clear(); err != nil { if err := c.defaultRenderTarget.Clear(); err != nil {
return err return err
} }
scale := float64(c.screenScale) scale := float64(c.screenScale)
options := &DrawImageOptions{} options := &DrawImageOptions{}
options.GeoM.Scale(scale, scale) options.GeoM.Scale(scale, scale)
if err := c.defaultR.DrawImage(c.screen, options); err != nil { if err := c.defaultRenderTarget.DrawImage(c.screen, options); err != nil {
return err return err
} }
return nil return nil
} }
func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) error { func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) error {
if c.defaultR != nil { if c.defaultRenderTarget != nil {
c.defaultR.dispose() c.defaultRenderTarget.dispose()
} }
if c.screen != nil { if c.screen != nil {
c.screen.dispose() c.screen.dispose()
@ -82,7 +82,7 @@ func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) er
return return
} }
screen := &Image{framebuffer: screenF, texture: texture} screen := &Image{framebuffer: screenF, texture: texture}
c.defaultR = &Image{framebuffer: f, texture: nil} c.defaultRenderTarget = &Image{framebuffer: f, texture: nil}
c.screen = screen c.screen = screen
c.screenScale = screenScale c.screenScale = screenScale
}) })