Now I check whether we are actually using OpenGL
This commit is contained in:
parent
255b240fd7
commit
9142a4a980
22
svlgui.py
22
svlgui.py
|
|
@ -47,7 +47,11 @@ WIDTH, HEIGHT = 500, 500
|
||||||
|
|
||||||
#Whether we are using OpenGL for rendering. Currently we need PIL for this.
|
#Whether we are using OpenGL for rendering. Currently we need PIL for this.
|
||||||
if GLEnablable:
|
if GLEnablable:
|
||||||
USING_GL = True
|
try:
|
||||||
|
import OpenGL
|
||||||
|
USING_GL = True
|
||||||
|
except ImportError:
|
||||||
|
USING_GL = False
|
||||||
|
|
||||||
#Object which has the keyboard focus.
|
#Object which has the keyboard focus.
|
||||||
FOCUS = None
|
FOCUS = None
|
||||||
|
|
@ -216,6 +220,14 @@ elif sys.platform=="win32":
|
||||||
from GUI.StdButtons import DefaultButton, CancelButton
|
from GUI.StdButtons import DefaultButton, CancelButton
|
||||||
from GUI.Files import FileType
|
from GUI.Files import FileType
|
||||||
from GUI.Geometry import offset_rect, rect_sized
|
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 = ""
|
media_path = ""
|
||||||
SYSTEM="osx"
|
SYSTEM="osx"
|
||||||
TEMPDIR="C:\\Windows\\Temp"
|
TEMPDIR="C:\\Windows\\Temp"
|
||||||
|
|
@ -248,6 +260,14 @@ elif sys.platform=="darwin":
|
||||||
from GUI.StdButtons import DefaultButton, CancelButton
|
from GUI.StdButtons import DefaultButton, CancelButton
|
||||||
from GUI.Files import FileType
|
from GUI.Files import FileType
|
||||||
from GUI.Geometry import offset_rect, rect_sized
|
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"
|
SYSTEM="osx"
|
||||||
'''
|
'''
|
||||||
import pyglet # Using Pyglet. Even more experimental. As in doesn't work yet.
|
import pyglet # Using Pyglet. Even more experimental. As in doesn't work yet.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue