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 {
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)
if err != nil {
return err
@ -83,6 +77,11 @@ func (c *graphicsContext) setSize(screenWidth, screenHeight, screenScale int) er
width: w,
height: h,
}
f, err := graphics.NewZeroFramebuffer(glContext, screenWidth*screenScale, screenHeight*screenScale)
if err != nil {
return err
}
w, h = f.Size()
c.defaultRenderTarget = &Image{
framebuffer: f,