code: def get_gl_configuration():
      """Read the current gl configuration
  
      This function uses constants that are not in the OpenGL ES 2.1
      namespace, so only use this on desktop systems.
  
      Returns
      -------
      config : dict
          The currently active OpenGL configuration.
      """
      # XXX eventually maybe we can ask `gl` whether or not we can access these
      gl.check_error("pre-config check")
      config = dict()
      canvas = get_current_canvas()
      fbo = (
          0
          if canvas is None
          else canvas._backend._vispy_get_fb_bind_location()
      )
      gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, fbo)
      fb_param = gl.glGetFramebufferAttachmentParameter
      # copied since they aren't in ES:
      GL_FRONT_LEFT = 1024
      GL_DEPTH = 6145
      GL_STENCIL = 6146
      GL_SRGB = 35904
      GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296
      GL_STEREO = 3123
      GL_DOUBLEBUFFER = 3122
      sizes = dict(
          red=(GL_FRONT_LEFT, 33298),
          green=(GL_FRONT_LEFT, 33299),
          blue=(GL_FRONT_LEFT, 33300),
          alpha=(GL_FRONT_LEFT, 33301),
          depth=(GL_DEPTH, 33302),
          stencil=(GL_STENCIL, 33303),
      )
      for key, val in sizes.items():
          try:
              param = fb_param(gl.GL_FRAMEBUFFER, val[0], val[1])
              gl.check_error("post-config check")
          except RuntimeError as exp:
              logger.warning("Failed to get size %s: %s" % (key, exp))
          else:
              config[key + "_size"] = param
  
      try:
          val = fb_param(
              gl.GL_FRAMEBUFFER,
              GL_FRONT_LEFT,
              GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING,
          )
          gl.check_error("post-config check")
      except RuntimeError as exp:
          logger.warning("Failed to get sRGB: %s" % (exp,))
      else:
          if val not in (gl.GL_LINEAR, GL_SRGB):
              logger.warning("unknown value for SRGB: %s" % val)
          else:
              config["srgb"] = val == GL_SRGB
  
      for key, enum in (
          ("stereo", GL_STEREO),
          ("double_buffer", GL_DOUBLEBUFFER),
      ):
          val = gl.glGetParameter(enum)
          try:
              gl.check_error("post-config check")
          except RuntimeError as exp:
              logger.warning("Failed to get %s: %s" % (key, exp))
          else:
              config[key] = bool(val)
      config["samples"] = gl.glGetParameter(gl.GL_SAMPLES)
      gl.check_error("post-config check")
      return config
  
imports: import numpy
  from copy import deepcopy
  from .None import gl
  from ..color import Color
  from ..util import logger
label_desc: Use image node_id 6 for calling a global function with example usage: get_gl_configuration() and returns: config