mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Bug fix: Make sure current framebuffers rendered (#158)
This commit is contained in:
parent
18a798f85c
commit
9e161864f6
@ -156,6 +156,10 @@ func (c *Context) TexSubImage2D(p []uint8, width, height int) {
|
||||
gl.TexSubImage2D(mgl.TEXTURE_2D, 0, 0, 0, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE, p)
|
||||
}
|
||||
|
||||
func (c *Context) BindZeroFramebuffer() {
|
||||
gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(ZeroFramebuffer))
|
||||
}
|
||||
|
||||
func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
|
||||
f := gl.CreateFramebuffer()
|
||||
gl.BindFramebuffer(mgl.FRAMEBUFFER, f)
|
||||
|
@ -157,6 +157,11 @@ func (u *userInterface) setScreenSize(width, height, scale int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// To make sure the current existing framebuffers are rendered,
|
||||
// swap buffers here.
|
||||
u.context.BindZeroFramebuffer()
|
||||
u.swapBuffers()
|
||||
|
||||
ch := make(chan struct{})
|
||||
window := u.window
|
||||
window.SetFramebufferSizeCallback(func(w *glfw.Window, width, height int) {
|
||||
|
Loading…
Reference in New Issue
Block a user