mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
graphicsdriver/opengl: Remove glGetError calls
As glGetError doesn't tell where the error happens, this is not useful. Fixes #815
This commit is contained in:
parent
fc329bd215
commit
7ff99d3965
@ -171,10 +171,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
|
|||||||
if err := mainthread.Run(func() error {
|
if err := mainthread.Run(func() error {
|
||||||
pixels = make([]byte, 4*width*height)
|
pixels = make([]byte, 4*width*height)
|
||||||
gl.ReadPixels(0, 0, int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(pixels))
|
gl.ReadPixels(0, 0, int32(width), int32(height), gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(pixels))
|
||||||
if e := gl.GetError(); e != gl.NO_ERROR {
|
|
||||||
pixels = nil
|
|
||||||
return fmt.Errorf("opengl: glReadPixels: %d", e)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -193,10 +193,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
|
|||||||
p := js.TypedArrayOf(pixels)
|
p := js.TypedArrayOf(pixels)
|
||||||
gl.Call("readPixels", 0, 0, width, height, rgba, unsignedByte, p)
|
gl.Call("readPixels", 0, 0, width, height, rgba, unsignedByte, p)
|
||||||
p.Release()
|
p.Release()
|
||||||
|
|
||||||
if e := gl.Call("getError"); e.Int() != noError.Int() {
|
|
||||||
return nil, errors.New(fmt.Sprintf("opengl: error: %d", e))
|
|
||||||
}
|
|
||||||
return pixels, nil
|
return pixels, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,9 +148,6 @@ func (c *context) framebufferPixels(f *framebuffer, width, height int) ([]byte,
|
|||||||
|
|
||||||
pixels := make([]byte, 4*width*height)
|
pixels := make([]byte, 4*width*height)
|
||||||
gl.ReadPixels(pixels, 0, 0, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE)
|
gl.ReadPixels(pixels, 0, 0, width, height, mgl.RGBA, mgl.UNSIGNED_BYTE)
|
||||||
if e := gl.GetError(); e != mgl.NO_ERROR {
|
|
||||||
return nil, fmt.Errorf("opengl: glReadPixels: %d", e)
|
|
||||||
}
|
|
||||||
return pixels, nil
|
return pixels, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user