mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
opengl: Remove glFlush to improve performance
This commit is contained in:
parent
a95edaceba
commit
5638bb93f5
@ -226,7 +226,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
|
|||||||
|
|
||||||
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
||||||
return c.RunOnContextThread(func() error {
|
return c.RunOnContextThread(func() error {
|
||||||
gl.Flush()
|
|
||||||
gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(f))
|
gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(f))
|
||||||
if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE {
|
if st := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); st != gl.FRAMEBUFFER_COMPLETE {
|
||||||
if e := gl.GetError(); e != 0 {
|
if e := gl.GetError(); e != 0 {
|
||||||
|
@ -168,7 +168,6 @@ func (c *Context) bindFramebuffer(f Framebuffer) {
|
|||||||
|
|
||||||
func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]uint8, error) {
|
func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]uint8, error) {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.Flush()
|
|
||||||
|
|
||||||
c.bindFramebuffer(f)
|
c.bindFramebuffer(f)
|
||||||
|
|
||||||
|
@ -181,7 +181,6 @@ func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error) {
|
|||||||
|
|
||||||
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
func (c *Context) SetViewport(f Framebuffer, width, height int) error {
|
||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.Flush()
|
|
||||||
gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f))
|
gl.BindFramebuffer(mgl.FRAMEBUFFER, mgl.Framebuffer(f))
|
||||||
if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE {
|
if err := gl.CheckFramebufferStatus(mgl.FRAMEBUFFER); err != mgl.FRAMEBUFFER_COMPLETE {
|
||||||
if e := gl.GetError(); e != 0 {
|
if e := gl.GetError(); e != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user