opengl: Remove FillFramebuffer

Fixes #536
This commit is contained in:
Hajime Hoshi 2018-03-08 12:01:24 +09:00
parent a60976f260
commit 2dc4f3fdf0
4 changed files with 0 additions and 46 deletions

View File

@ -23,20 +23,6 @@ var (
oneMinus = math.Nextafter32(1, 0)
)
// adjustForClearColor adjust the value x for glClearColor function.
//
// On some machines like MacBook Pro, exact 0 and exact 1 might cause problems
// at glClearColor() (#452).
func adjustForClearColor(x float32) float32 {
if x <= 0 {
return zeroPlus
}
if x >= 1 {
return oneMinus
}
return x
}
var (
VertexShader ShaderType
FragmentShader ShaderType

View File

@ -270,17 +270,6 @@ func (c *Context) setViewportImpl(width, height int) {
})
}
func (c *Context) FillFramebuffer(r, g, b, a float32) error {
return c.runOnContextThread(func() error {
gl.ClearColor(adjustForClearColor(r),
adjustForClearColor(g),
adjustForClearColor(b),
adjustForClearColor(a))
gl.Clear(gl.COLOR_BUFFER_BIT)
return nil
})
}
func (c *Context) DeleteFramebuffer(f Framebuffer) {
_ = c.runOnContextThread(func() error {
ff := uint32(f)

View File

@ -218,17 +218,6 @@ func (c *Context) setViewportImpl(width, height int) {
gl.Viewport(0, 0, width, height)
}
func (c *Context) FillFramebuffer(r, g, b, a float32) error {
// TODO: Use f?
gl := c.gl
gl.ClearColor(adjustForClearColor(r),
adjustForClearColor(g),
adjustForClearColor(b),
adjustForClearColor(a))
gl.Clear(gl.COLOR_BUFFER_BIT)
return nil
}
func (c *Context) DeleteFramebuffer(f Framebuffer) {
gl := c.gl
if !gl.IsFramebuffer(f.(*js.Object)) {

View File

@ -211,16 +211,6 @@ func (c *Context) setViewportImpl(width, height int) {
gl.Viewport(0, 0, width, height)
}
func (c *Context) FillFramebuffer(r, g, b, a float32) error {
gl := c.gl
gl.ClearColor(adjustForClearColor(r),
adjustForClearColor(g),
adjustForClearColor(b),
adjustForClearColor(a))
gl.Clear(mgl.COLOR_BUFFER_BIT)
return nil
}
func (c *Context) DeleteFramebuffer(f Framebuffer) {
gl := c.gl
if !gl.IsFramebuffer(mgl.Framebuffer(f)) {