diff --git a/ebiten.go b/ebiten.go index ad61d8e47..91fd47bc2 100644 --- a/ebiten.go +++ b/ebiten.go @@ -9,7 +9,7 @@ import ( type Game interface { Init(tf graphics.TextureFactory) Update() - Draw(g graphics.GraphicsContext, offscreen graphics.TextureID) + Draw(g graphics.GraphicsContext, offscreen graphics.Texture) } type UI interface { @@ -23,7 +23,7 @@ func OpenGLRun(game Game, ui UI) { ch := make(chan bool, 1) device := opengl.NewDevice( ui.ScreenWidth(), ui.ScreenHeight(), ui.ScreenScale(), - func(g graphics.GraphicsContext, offscreen graphics.TextureID) { + func(g graphics.GraphicsContext, offscreen graphics.Texture) { ticket := <-ch game.Draw(g, offscreen) ch <- ticket diff --git a/examples/glut/main.go b/examples/glut/main.go index 451616dfc..ee76c4eb9 100644 --- a/examples/glut/main.go +++ b/examples/glut/main.go @@ -115,7 +115,7 @@ func (game *DemoGame) Update() { game.x++ } -func (game *DemoGame) Draw(g graphics.GraphicsContext, offscreen graphics.TextureID) { +func (game *DemoGame) Draw(g graphics.GraphicsContext, offscreen graphics.Texture) { g.Fill(&color.RGBA{R: 128, G: 128, B: 255, A: 255}) geometryMatrix := matrix.IdentityGeometry() diff --git a/graphics/opengl/device.go b/graphics/opengl/device.go index a3d7aaf92..701b3628d 100644 --- a/graphics/opengl/device.go +++ b/graphics/opengl/device.go @@ -16,11 +16,11 @@ type Device struct { screenScale int graphicsContext *GraphicsContext offscreenTexture graphics.Texture - drawFunc func(graphics.GraphicsContext, graphics.TextureID) + drawFunc func(graphics.GraphicsContext, graphics.Texture) } func NewDevice(screenWidth, screenHeight, screenScale int, - drawFunc func(graphics.GraphicsContext, graphics.TextureID)) *Device { + drawFunc func(graphics.GraphicsContext, graphics.Texture)) *Device { device := &Device{ screenWidth: screenWidth, screenHeight: screenHeight, @@ -40,7 +40,7 @@ func (device *Device) Update() { C.glTexParameteri(C.GL_TEXTURE_2D, C.GL_TEXTURE_MAG_FILTER, C.GL_NEAREST) g.SetOffscreen(device.offscreenTexture.ID) g.Clear() - device.drawFunc(g, device.offscreenTexture.ID) + device.drawFunc(g, device.offscreenTexture) g.flush() C.glTexParameteri(C.GL_TEXTURE_2D, C.GL_TEXTURE_MIN_FILTER, C.GL_LINEAR)