Skip to content
Snippets Groups Projects
Commit 3c2663f7 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Handle OpenGL versions which do not have "Major.Minor" format.

parent 44ad40d5
No related branches found
No related tags found
No related merge requests found
...@@ -285,11 +285,11 @@ def bootstrap(glVersion=None): ...@@ -285,11 +285,11 @@ def bootstrap(glVersion=None):
thismod = sys.modules[__name__] thismod = sys.modules[__name__]
if hasattr(thismod, '_bootstrapped'): if hasattr(thismod, '_bootstrapped'):
return return
if glVersion is None: if glVersion is None:
glVer = gl.glGetString(gl.GL_VERSION).split()[0] glVer = gl.glGetString(gl.GL_VERSION).split()[0]
major, minor = map(int, glVer.split('.')) major, minor = map(int, glVer.split('.'))[:2]
else: else:
major, minor = glVersion major, minor = glVersion
......
...@@ -21,6 +21,9 @@ See the :mod:`~fsl.fsleyes` package documentation for more details on ...@@ -21,6 +21,9 @@ See the :mod:`~fsl.fsleyes` package documentation for more details on
""" """
from __future__ import print_function
import sys
import logging import logging
import textwrap import textwrap
import argparse import argparse
...@@ -128,8 +131,14 @@ def context(args, splash): ...@@ -128,8 +131,14 @@ def context(args, splash):
# force the creation of a wx.glcanvas.GLContext object, # force the creation of a wx.glcanvas.GLContext object,
# and initialise OpenGL version-specific module loads. # and initialise OpenGL version-specific module loads.
fslgl.getWXGLContext(splash) try:
fslgl.bootstrap(args.glversion) fslgl.getWXGLContext(splash)
fslgl.bootstrap(args.glversion)
except:
log.error('Unable to initialise OpenGL!', exc_info=True)
splash.Destroy()
sys.exit(1)
# Redirect status updates # Redirect status updates
# to the splash frame # to the splash frame
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment