mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
opengl: Refactoring
This commit is contained in:
parent
4d3d407205
commit
6a34b87a6c
@ -169,12 +169,10 @@ func (c *Context) bindFramebufferImpl(f Framebuffer) {
|
|||||||
|
|
||||||
func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]byte, error) {
|
func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]byte, error) {
|
||||||
var pixels []byte
|
var pixels []byte
|
||||||
if err := c.runOnContextThread(func() error {
|
_ = c.runOnContextThread(func() error {
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
})
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
c.bindFramebuffer(f)
|
c.bindFramebuffer(f)
|
||||||
if err := c.runOnContextThread(func() error {
|
if err := c.runOnContextThread(func() error {
|
||||||
pixels = make([]byte, 4*width*height)
|
pixels = make([]byte, 4*width*height)
|
||||||
|
Loading…
Reference in New Issue
Block a user