code: def _get_gl_func(name, restype, argtypes):
      # Based on a function in Pyglet
      if _lib is None:
          raise RuntimeError(
              "Could not load OpenGL library, gl cannot be used"
          )
      try:
          # Try using normal ctypes stuff
          func = getattr(_lib, name)
          func.restype = restype
          func.argtypes = argtypes
          return func
      except AttributeError:
          if sys.platform.startswith("win"):
              # Ask for a pointer to the function, this is the approach
              # for OpenGL extensions on Windows
              fargs = (restype,) + argtypes
              ftype = ctypes.WINFUNCTYPE(*fargs)
              if not _have_get_proc_address:
                  raise RuntimeError(
                      "Function %s not available "
                      "(OpenGL version is %s)."
                      % (name, _get_gl_version(_lib))
                  )
              if not _have_context():
                  raise RuntimeError(
                      "Using %s with no OpenGL context." % name
                  )
              address = wglGetProcAddress(name.encode("utf-8"))
              if address:
                  return ctypes.cast(address, ftype)
          # If not Windows or if we did not return function object on Windows:
          raise RuntimeError(
              "Function %s not present in context "
              "(OpenGL version is %s)." % (name, _get_gl_version(_lib))
          )
  
file_path: vispy/vispy/gloo/gl/gl2.py
imports: import os
  import sys
  import ctypes.util
  from .None import _copy_gl_functions
  from ._constants import *
  from ...util import logger
  from .None import _gl2
label_desc: Use image node_id 3 for calling a global function with example usage: _get_gl_func(name, restype, argtypes) and returns: func, ctypes