driver: Remove Graphics.SetWindow

Fixes #1026
This commit is contained in:
Hajime Hoshi 2020-01-03 18:53:37 +09:00
parent fa95275a02
commit 9be3495077
3 changed files with 6 additions and 10 deletions

View File

@ -15,8 +15,6 @@
package driver package driver
import ( import (
"unsafe"
"github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/thread" "github.com/hajimehoshi/ebiten/internal/thread"
) )
@ -25,7 +23,6 @@ type Graphics interface {
SetThread(thread *thread.Thread) SetThread(thread *thread.Thread)
Begin() Begin()
End() End()
SetWindow(window unsafe.Pointer)
SetTransparent(transparent bool) SetTransparent(transparent bool)
SetVertices(vertices []float32, indices []uint16) SetVertices(vertices []float32, indices []uint16)
NewImage(width, height int) (Image, error) NewImage(width, height int) (Image, error)

View File

@ -16,7 +16,6 @@ package opengl
import ( import (
"fmt" "fmt"
"unsafe"
"github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/affine"
"github.com/hajimehoshi/ebiten/internal/driver" "github.com/hajimehoshi/ebiten/internal/driver"
@ -52,10 +51,6 @@ func (d *Driver) End() {
d.context.flush() d.context.flush()
} }
func (d *Driver) SetWindow(window unsafe.Pointer) {
// Do nothing.
}
func (d *Driver) SetTransparent(transparent bool) { func (d *Driver) SetTransparent(transparent bool) {
// Do nothings. // Do nothings.
} }

View File

@ -650,7 +650,9 @@ func (u *UserInterface) run(context driver.UIContext) error {
w = u.nativeWindow() w = u.nativeWindow()
return nil return nil
}) })
u.Graphics().SetWindow(w) if g, ok := u.Graphics().(interface{ SetWindow(unsafe.Pointer) }); ok {
g.SetWindow(w)
}
return u.loop(context) return u.loop(context)
} }
@ -948,7 +950,9 @@ func (u *UserInterface) setWindowSize(width, height int, fullscreen bool, vsync
}) })
if windowRecreated { if windowRecreated {
u.Graphics().SetWindow(u.nativeWindow()) if g, ok := u.Graphics().(interface{ SetWindow(unsafe.Pointer) }); ok {
g.SetWindow(u.nativeWindow())
}
} }
} }