graphics: Refactoring

This commit is contained in:
Hajime Hoshi 2016-05-11 00:48:30 +09:00
parent c07f16d9a4
commit c291e2abad

View File

@ -62,12 +62,6 @@ func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) er
if c.screen != nil { if c.screen != nil {
c.screen.Dispose() c.screen.Dispose()
} }
f, err := graphics.NewZeroFramebuffer(glContext, screenWidth*screenScale, screenHeight*screenScale)
if err != nil {
return err
}
texture, err := graphics.NewTexture(glContext, screenWidth, screenHeight, glContext.Nearest) texture, err := graphics.NewTexture(glContext, screenWidth, screenHeight, glContext.Nearest)
if err != nil { if err != nil {
return err return err
@ -83,6 +77,11 @@ func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) er
width: w, width: w,
height: h, height: h,
} }
f, err := graphics.NewZeroFramebuffer(glContext, screenWidth*screenScale, screenHeight*screenScale)
if err != nil {
return err
}
w, h = f.Size() w, h = f.Size()
c.defaultRenderTarget = &Image{ c.defaultRenderTarget = &Image{
framebuffer: f, framebuffer: f,