diff --git a/internal/driver/graphics.go b/internal/driver/graphics.go index 41afbedf3..0ba8fcb38 100644 --- a/internal/driver/graphics.go +++ b/internal/driver/graphics.go @@ -15,8 +15,6 @@ package driver import ( - "unsafe" - "github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/thread" ) @@ -25,7 +23,6 @@ type Graphics interface { SetThread(thread *thread.Thread) Begin() End() - SetWindow(window unsafe.Pointer) SetTransparent(transparent bool) SetVertices(vertices []float32, indices []uint16) NewImage(width, height int) (Image, error) diff --git a/internal/graphicsdriver/opengl/driver.go b/internal/graphicsdriver/opengl/driver.go index 76bfa3576..12c1fe114 100644 --- a/internal/graphicsdriver/opengl/driver.go +++ b/internal/graphicsdriver/opengl/driver.go @@ -16,7 +16,6 @@ package opengl import ( "fmt" - "unsafe" "github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/driver" @@ -52,10 +51,6 @@ func (d *Driver) End() { d.context.flush() } -func (d *Driver) SetWindow(window unsafe.Pointer) { - // Do nothing. -} - func (d *Driver) SetTransparent(transparent bool) { // Do nothings. } diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index f59fb34ba..ede4c5185 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -650,7 +650,9 @@ func (u *UserInterface) run(context driver.UIContext) error { w = u.nativeWindow() return nil }) - u.Graphics().SetWindow(w) + if g, ok := u.Graphics().(interface{ SetWindow(unsafe.Pointer) }); ok { + g.SetWindow(w) + } return u.loop(context) } @@ -948,7 +950,9 @@ func (u *UserInterface) setWindowSize(width, height int, fullscreen bool, vsync }) if windowRecreated { - u.Graphics().SetWindow(u.nativeWindow()) + if g, ok := u.Graphics().(interface{ SetWindow(unsafe.Pointer) }); ok { + g.SetWindow(u.nativeWindow()) + } } }