mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
Rename innerRenderTarget.texture -> .image
This commit is contained in:
parent
146c1db44a
commit
480289cd5d
@ -48,8 +48,7 @@ type graphicsContext struct {
|
|||||||
func (c *graphicsContext) dispose() {
|
func (c *graphicsContext) dispose() {
|
||||||
// NOTE: Now this method is not used anywhere.
|
// NOTE: Now this method is not used anywhere.
|
||||||
glRenderTarget := c.screen.glRenderTarget
|
glRenderTarget := c.screen.glRenderTarget
|
||||||
texture := c.screen.texture
|
glTexture := c.screen.image.glTexture
|
||||||
glTexture := texture.glTexture
|
|
||||||
|
|
||||||
glRenderTarget.Dispose()
|
glRenderTarget.Dispose()
|
||||||
glTexture.Dispose()
|
glTexture.Dispose()
|
||||||
@ -65,11 +64,11 @@ func (c *graphicsContext) postUpdate() error {
|
|||||||
scale := float64(c.screenScale)
|
scale := float64(c.screenScale)
|
||||||
geo := ScaleGeometry(scale, scale)
|
geo := ScaleGeometry(scale, scale)
|
||||||
clr := ColorMatrixI()
|
clr := ColorMatrixI()
|
||||||
w, h := c.screen.texture.Size()
|
w, h := c.screen.image.Size()
|
||||||
parts := []ImagePart{
|
parts := []ImagePart{
|
||||||
{Rect{0, 0, float64(w), float64(h)}, Rect{0, 0, float64(w), float64(h)}},
|
{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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
type innerRenderTarget struct {
|
type innerRenderTarget struct {
|
||||||
glRenderTarget *opengl.RenderTarget
|
glRenderTarget *opengl.RenderTarget
|
||||||
texture *Texture
|
image *Texture
|
||||||
}
|
}
|
||||||
|
|
||||||
func newInnerRenderTarget(width, height int, filter int) (*innerRenderTarget, error) {
|
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()
|
w, h := glTexture.Size()
|
||||||
quads := textureQuads(parts, w, h)
|
quads := textureQuads(parts, w, h)
|
||||||
targetNativeTexture := gl.Texture(0)
|
targetNativeTexture := gl.Texture(0)
|
||||||
if r.texture != nil {
|
if r.image != nil {
|
||||||
targetNativeTexture = r.texture.glTexture.Native()
|
targetNativeTexture = r.image.glTexture.Native()
|
||||||
}
|
}
|
||||||
w2, h2 := r.size()
|
w2, h2 := r.size()
|
||||||
projectionMatrix := r.glRenderTarget.ProjectionMatrix()
|
projectionMatrix := r.glRenderTarget.ProjectionMatrix()
|
||||||
@ -120,7 +120,7 @@ type RenderTarget struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *RenderTarget) Image() *Texture {
|
func (r *RenderTarget) Image() *Texture {
|
||||||
return r.inner.texture
|
return r.inner.image
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RenderTarget) Size() (width, height int) {
|
func (r *RenderTarget) Size() (width, height int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user