graphics: Remove texture's width/height

This commit is contained in:
Hajime Hoshi 2016-07-05 00:31:02 +09:00
parent 93f7fdd349
commit 7903fe2108
2 changed files with 1 additions and 7 deletions

View File

@ -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 {

View File

@ -20,6 +20,4 @@ import (
type texture struct { type texture struct {
native opengl.Texture native opengl.Texture
width int
height int
} }