OpenGL now depends on the availability of PIL
This commit is contained in:
@@ -12,6 +12,7 @@ import platform
|
|||||||
import re
|
import re
|
||||||
try:
|
try:
|
||||||
from PIL import Image as PILimage
|
from PIL import Image as PILimage
|
||||||
|
GLEnablable = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
GLEnablable = False
|
GLEnablable = False
|
||||||
|
|
||||||
@@ -44,7 +45,8 @@ FRAMERATE=50
|
|||||||
#Width and height are the width and height of the document
|
#Width and height are the width and height of the document
|
||||||
WIDTH, HEIGHT = 500, 500
|
WIDTH, HEIGHT = 500, 500
|
||||||
|
|
||||||
#Whether we are using OpenGL for rendering.
|
#Whether we are using OpenGL for rendering. Currently we need PIL for this.
|
||||||
|
if GLEnablable:
|
||||||
USING_GL = True
|
USING_GL = True
|
||||||
|
|
||||||
#Object which has the keyboard focus.
|
#Object which has the keyboard focus.
|
||||||
@@ -1165,9 +1167,9 @@ class Image(object):
|
|||||||
self.name = image.split(sep)[-1]
|
self.name = image.split(sep)[-1]
|
||||||
self.iname = None
|
self.iname = None
|
||||||
self.path = image
|
self.path = image
|
||||||
self.pilimage = PILimage.open(image)
|
|
||||||
self.type="Image"
|
self.type="Image"
|
||||||
if USING_GL:
|
if USING_GL:
|
||||||
|
self.pilimage = PILimage.open(image)
|
||||||
# This is an OpenGL texture ID.
|
# This is an OpenGL texture ID.
|
||||||
self.gltexture = self.loadGLImage(file = image)
|
self.gltexture = self.loadGLImage(file = image)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user