Rename innerRenderTarget.texture -> .image

This commit is contained in:
Hajime Hoshi 2014-12-21 02:47:53 +09:00
parent 146c1db44a
commit 480289cd5d
2 changed files with 7 additions and 8 deletions

View File

@ -48,8 +48,7 @@ type graphicsContext struct {
func (c *graphicsContext) dispose() {
// NOTE: Now this method is not used anywhere.
glRenderTarget := c.screen.glRenderTarget
texture := c.screen.texture
glTexture := texture.glTexture
glTexture := c.screen.image.glTexture
glRenderTarget.Dispose()
glTexture.Dispose()
@ -65,11 +64,11 @@ func (c *graphicsContext) postUpdate() error {
scale := float64(c.screenScale)
geo := ScaleGeometry(scale, scale)
clr := ColorMatrixI()
w, h := c.screen.texture.Size()
w, h := c.screen.image.Size()
parts := []ImagePart{
{Rect{0, 0, float64(w), float64(h)}, Rect{0, 0, float64(w), float64(h)}},
}
if err := c.defaultR.DrawImage(c.screen.texture, parts, geo, clr); err != nil {
if err := c.defaultR.DrawImage(c.screen.image, parts, geo, clr); err != nil {
return err
}

View File

@ -27,7 +27,7 @@ import (
type innerRenderTarget struct {
glRenderTarget *opengl.RenderTarget
texture *Texture
image *Texture
}
func newInnerRenderTarget(width, height int, filter int) (*innerRenderTarget, error) {
@ -76,8 +76,8 @@ func (r *innerRenderTarget) DrawImage(texture *Texture, parts []ImagePart, geo G
w, h := glTexture.Size()
quads := textureQuads(parts, w, h)
targetNativeTexture := gl.Texture(0)
if r.texture != nil {
targetNativeTexture = r.texture.glTexture.Native()
if r.image != nil {
targetNativeTexture = r.image.glTexture.Native()
}
w2, h2 := r.size()
projectionMatrix := r.glRenderTarget.ProjectionMatrix()
@ -120,7 +120,7 @@ type RenderTarget struct {
}
func (r *RenderTarget) Image() *Texture {
return r.inner.texture
return r.inner.image
}
func (r *RenderTarget) Size() (width, height int) {