OpenGL now depends on the availability of PIL

This commit is contained in:
Skyler Lehmkuhl 2012-03-30 14:33:19 -04:00
parent c3ef57dee3
commit 255b240fd7
1 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import platform
import re
try:
from PIL import Image as PILimage
GLEnablable = True
except ImportError:
GLEnablable = False
@ -44,7 +45,8 @@ FRAMERATE=50
#Width and height are the width and height of the document
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
#Object which has the keyboard focus.
@ -1165,9 +1167,9 @@ class Image(object):
self.name = image.split(sep)[-1]
self.iname = None
self.path = image
self.pilimage = PILimage.open(image)
self.type="Image"
if USING_GL:
self.pilimage = PILimage.open(image)
# This is an OpenGL texture ID.
self.gltexture = self.loadGLImage(file = image)