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) {
|
||||
var pixels []byte
|
||||
if err := c.runOnContextThread(func() error {
|
||||
_ = c.runOnContextThread(func() error {
|
||||
gl.Flush()
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
})
|
||||
c.bindFramebuffer(f)
|
||||
if err := c.runOnContextThread(func() error {
|
||||
pixels = make([]byte, 4*width*height)
|
||||
|
Loading…
Reference in New Issue
Block a user