mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
ui: Remove opengl dependency from ui package (desktop)
This commit is contained in:
parent
02b570a8e1
commit
2c7017534f
@ -198,6 +198,13 @@ func (q *commandQueue) Flush() {
|
||||
q.nindices = 0
|
||||
q.tmpNumIndices = 0
|
||||
q.nextIndex = 0
|
||||
|
||||
// The bound framebuffer must be the original screen framebuffer before swapping buffers.
|
||||
// Note that swapping might not happen after this function. BeforeSwapping should not be
|
||||
// harmful in any cases.
|
||||
//
|
||||
// TODO: Confirm which machine requires this. Probably BungBungame Photon 2?
|
||||
opengl.GetContext().BeforeSwapping()
|
||||
}
|
||||
|
||||
// Error returns an OpenGL error for the last command.
|
||||
|
@ -506,3 +506,7 @@ func (c *Context) RestoreContext() {
|
||||
c.loseContext.Call("restoreContext")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Context) BeforeSwapping() {
|
||||
// Do nothing
|
||||
}
|
||||
|
@ -400,3 +400,7 @@ func (c *Context) Flush() {
|
||||
gl := c.gl
|
||||
gl.Flush()
|
||||
}
|
||||
|
||||
func (c *Context) BeforeSwapping() {
|
||||
// Do nothing
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ import (
|
||||
"github.com/hajimehoshi/ebiten/internal/hooks"
|
||||
"github.com/hajimehoshi/ebiten/internal/input"
|
||||
"github.com/hajimehoshi/ebiten/internal/mainthread"
|
||||
"github.com/hajimehoshi/ebiten/internal/opengl"
|
||||
)
|
||||
|
||||
type userInterface struct {
|
||||
@ -649,10 +648,6 @@ func (u *userInterface) loop(g GraphicsContext) error {
|
||||
vsync := u.vsync
|
||||
u.m.Unlock()
|
||||
|
||||
// The bound framebuffer must be the original screen framebuffer
|
||||
// before swapping buffers.
|
||||
opengl.GetContext().BeforeSwapping()
|
||||
|
||||
_ = mainthread.Run(func() error {
|
||||
if !vsync {
|
||||
u.swapBuffers()
|
||||
|
Loading…
Reference in New Issue
Block a user