mirror of https://github.com/kivy/kivy.git
Adding enforcement of the wanted graphics system GL/GLES
- GRAPHICS=GL/GLES
This commit is contained in:
parent
2e66b17bfc
commit
6adae180a6
36
setup.py
36
setup.py
|
@ -74,6 +74,15 @@ c_options['use_x11'] = False
|
|||
c_options['use_gstreamer'] = False
|
||||
c_options['use_avfoundation'] = platform == 'darwin'
|
||||
|
||||
if environ.get('GRAPHICS') is not None:
|
||||
print('\nForcing to use this graphics system: %s' %repr(environ.get('GRAPHICS')))
|
||||
if environ.get('GRAPHICS') == "GL":
|
||||
c_options['use_opengl_es2'] = False
|
||||
elif environ.get('GRAPHICS') == "GLES":
|
||||
c_options['use_opengl_es2'] = True
|
||||
else:
|
||||
print("WARNING: Unknown graphics system choosen - using defaults!")
|
||||
|
||||
# now check if environ is changing the default values
|
||||
for key in list(c_options.keys()):
|
||||
ukey = key.upper()
|
||||
|
@ -177,19 +186,20 @@ elif platform == 'win32':
|
|||
print('Windows platform detected, force GLEW usage.')
|
||||
c_options['use_glew'] = True
|
||||
else:
|
||||
# searching GLES headers
|
||||
default_header_dirs = ['/usr/include', '/usr/local/include']
|
||||
found = False
|
||||
for hdir in default_header_dirs:
|
||||
filename = join(hdir, 'GLES2', 'gl2.h')
|
||||
if exists(filename):
|
||||
found = True
|
||||
print('Found GLES 2.0 headers at {0}'.format(filename))
|
||||
break
|
||||
if not found:
|
||||
print('WARNING: GLES 2.0 headers are not found')
|
||||
print('Fallback to Desktop opengl headers.')
|
||||
c_options['use_opengl_es2'] = False
|
||||
if environ.get('GRAPHICS') is None:
|
||||
# searching GLES headers
|
||||
default_header_dirs = ['/usr/include', '/usr/local/include']
|
||||
found = False
|
||||
for hdir in default_header_dirs:
|
||||
filename = join(hdir, 'GLES2', 'gl2.h')
|
||||
if exists(filename):
|
||||
found = True
|
||||
print('Found GLES 2.0 headers at {0}'.format(filename))
|
||||
break
|
||||
if not found:
|
||||
print('WARNING: GLES 2.0 headers are not found')
|
||||
print('Fallback to Desktop opengl headers.')
|
||||
c_options['use_opengl_es2'] = False
|
||||
|
||||
# check if we are in a kivy-ios build
|
||||
if platform == 'ios':
|
||||
|
|
Loading…
Reference in New Issue