mirror of https://github.com/kivy/kivy.git
Merge pull request #2329 from matham/screenshot
Import glReadPixels from the correct place. Fixes #2032.
This commit is contained in:
commit
6cb9c34ef5
|
@ -243,7 +243,8 @@ class WindowPygame(WindowBase):
|
|||
if filename is None:
|
||||
return None
|
||||
if glReadPixels is None:
|
||||
from kivy.core.gl import glReadPixels, GL_RGBA, GL_UNSIGNED_BYTE
|
||||
from kivy.graphics.opengl import (glReadPixels, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE)
|
||||
width, height = self.system_size
|
||||
data = glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE)
|
||||
data = str(buffer(data))
|
||||
|
|
|
@ -99,7 +99,7 @@ class WindowSDL(WindowBase):
|
|||
filename = super(WindowPygame, self).screenshot(*largs, **kwargs)
|
||||
if filename is None:
|
||||
return None
|
||||
from kivy.core.gl import glReadPixels, GL_RGB, GL_UNSIGNED_BYTE
|
||||
from kivy.graphics.opengl import glReadPixels, GL_RGB, GL_UNSIGNED_BYTE
|
||||
width, height = self.size
|
||||
data = glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE)
|
||||
data = str(buffer(data))
|
||||
|
|
Loading…
Reference in New Issue