Merge pull request #2329 from matham/screenshot

Import glReadPixels from the correct place. Fixes #2032.
This commit is contained in:
Alexander Taylor 2014-07-13 00:50:43 +01:00
commit 6cb9c34ef5
2 changed files with 3 additions and 2 deletions

View File

@ -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))

View File

@ -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))