mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
graphics: Remove texture's width/height
This commit is contained in:
parent
93f7fdd349
commit
7903fe2108
@ -158,7 +158,7 @@ func (c *replacePixelsCommand) Exec(context *opengl.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
context.BindTexture(c.dst.texture.native)
|
context.BindTexture(c.dst.texture.native)
|
||||||
context.TexSubImage2D(c.pixels, c.dst.texture.width, c.dst.texture.height)
|
context.TexSubImage2D(c.pixels, c.dst.width, c.dst.height)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +220,6 @@ func (c *newImageFromImageCommand) Exec(context *opengl.Context) error {
|
|||||||
}
|
}
|
||||||
c.result.texture = &texture{
|
c.result.texture = &texture{
|
||||||
native: native,
|
native: native,
|
||||||
width: origSize.X,
|
|
||||||
height: origSize.Y,
|
|
||||||
}
|
}
|
||||||
c.result.framebuffer, err = newFramebufferFromTexture(context, c.result.texture)
|
c.result.framebuffer, err = newFramebufferFromTexture(context, c.result.texture)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -252,8 +250,6 @@ func (c *newImageCommand) Exec(context *opengl.Context) error {
|
|||||||
}
|
}
|
||||||
c.result.texture = &texture{
|
c.result.texture = &texture{
|
||||||
native: native,
|
native: native,
|
||||||
width: c.width,
|
|
||||||
height: c.height,
|
|
||||||
}
|
}
|
||||||
c.result.framebuffer, err = newFramebufferFromTexture(context, c.result.texture)
|
c.result.framebuffer, err = newFramebufferFromTexture(context, c.result.texture)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -20,6 +20,4 @@ import (
|
|||||||
|
|
||||||
type texture struct {
|
type texture struct {
|
||||||
native opengl.Texture
|
native opengl.Texture
|
||||||
width int
|
|
||||||
height int
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user