opengl: Reduce CheckFramebufferState call for speed

This commit is contained in:
Hajime Hoshi 2016-06-01 03:53:55 +09:00
parent 91491e58f4
commit 16ef82fa23
2 changed files with 0 additions and 12 deletions

View File

@ -231,12 +231,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
return c.RunOnContextThread(func() error {
c.bindFramebuffer(f)
if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE {
if e := gl.GetError(); e != 0 {
return fmt.Errorf("opengl: glBindFramebuffer failed: %d", e)
}
return errors.New("opengl: glBindFramebuffer failed: the context is different?")
}
gl.Viewport(0, 0, int32(width), int32(height))
return nil
})

View File

@ -186,12 +186,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
gl := c.gl
c.bindFramebuffer(f)
if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE {
if e := gl.GetError(); e != 0 {
return fmt.Errorf("opengl: glBindFramebuffer failed: %d", e)
}
return errors.New("opengl: glBindFramebuffer failed: the context is different?")
}
gl.Viewport(0, 0, width, height)
return nil
}