mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
Add opengl.Framebuffer.Fill
This commit is contained in:
parent
fbcd04cda8
commit
a4a4c91eb1
@ -15,6 +15,7 @@
|
||||
package graphics
|
||||
|
||||
import (
|
||||
// TODO: Remove this
|
||||
"github.com/go-gl/gl"
|
||||
"github.com/hajimehoshi/ebiten/internal"
|
||||
"github.com/hajimehoshi/ebiten/internal/graphics/internal/shader"
|
||||
@ -103,9 +104,7 @@ func (f *Framebuffer) Fill(r, g, b, a float64) error {
|
||||
if err := f.setAsViewport(); err != nil {
|
||||
return err
|
||||
}
|
||||
gl.ClearColor(gl.GLclampf(r), gl.GLclampf(g), gl.GLclampf(b), gl.GLclampf(a))
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT)
|
||||
return nil
|
||||
return f.framebuffer.Fill(r, g, b, a)
|
||||
}
|
||||
|
||||
func (f *Framebuffer) DrawTexture(t *Texture, quads TextureQuads, geo, clr Matrix) error {
|
||||
|
@ -66,6 +66,12 @@ func (f Framebuffer) SetAsViewport(width, height int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f Framebuffer) Fill(r, g, b, a float64) error {
|
||||
gl.ClearColor(gl.GLclampf(r), gl.GLclampf(g), gl.GLclampf(b), gl.GLclampf(a))
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f Framebuffer) Delete() {
|
||||
gl.Framebuffer(f).Delete()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user