Now I check whether we are actually using OpenGL

This commit is contained in:
Skyler Lehmkuhl 2012-03-30 14:38:53 -04:00
parent 255b240fd7
commit 9142a4a980
1 changed files with 21 additions and 1 deletions

View File

@ -47,7 +47,11 @@ WIDTH, HEIGHT = 500, 500
#Whether we are using OpenGL for rendering. Currently we need PIL for this.
if GLEnablable:
USING_GL = True
try:
import OpenGL
USING_GL = True
except ImportError:
USING_GL = False
#Object which has the keyboard focus.
FOCUS = None
@ -216,6 +220,14 @@ elif sys.platform=="win32":
from GUI.StdButtons import DefaultButton, CancelButton
from GUI.Files import FileType
from GUI.Geometry import offset_rect, rect_sized
if USING_GL:
from OpenGL.GL import *
from OpenGL.GLU import *
from GUI import GL
try:
from PIL import Image as PILImage
except ImportError as err:
import Image as PILImage
media_path = ""
SYSTEM="osx"
TEMPDIR="C:\\Windows\\Temp"
@ -248,6 +260,14 @@ elif sys.platform=="darwin":
from GUI.StdButtons import DefaultButton, CancelButton
from GUI.Files import FileType
from GUI.Geometry import offset_rect, rect_sized
if USING_GL:
from OpenGL.GL import *
from OpenGL.GLU import *
from GUI import GL
try:
from PIL import Image as PILImage
except ImportError as err:
import Image as PILImage
SYSTEM="osx"
'''
import pyglet # Using Pyglet. Even more experimental. As in doesn't work yet.