Exemple #1
0
 def failFunction( *args, **named ):
     from OpenGL import error
     raise error.NullFunctionError(
         """Undefined GLUT callback function %s, check for bool(%s) before calling"""%(
             typeName, 'glut%sFunc'%(typeName),
         )
     )
Exemple #2
0
 def __call__( self, *args, **named ):
     from OpenGL import error
     raise error.NullFunctionError(
         """Attempt to call a deprecated function %s while OpenGL in FORWARD_COMPATIBLE_ONLY mode.  Set OpenGL.FORWARD_COMPATIBLE_ONLY to False to use legacy entry points"""%(
             self.__name__,
         )
     )
Exemple #3
0
 def __call__( self, *args, **named ):
     if self.load():
         return self( *args, **named )
     else:
         from OpenGL import error
         raise error.NullFunctionError(
             """Attempt to call an undefined function %s, check for bool(%s) before calling"""%(
                 self.__name__, self.__name__,
             )
         )
Exemple #4
0
	def __call__( self, *args, **named ):
		"""Call, doing a late lookup and bind to find an implementation"""
		for alternate in self._alternatives:
			if alternate:
				self.__class__.__call__ = alternate.__call__
				return self( *args, **named )
		from OpenGL import error
		raise error.NullFunctionError(
			"""Attempt to call an undefined alterate function (%s), check for bool(%s) before calling"""%(
				', '.join([x.__name__ for x in self._alternatives]),
				self.__name__,
			)
		)
Exemple #5
0
 def __call__(self, *args, **named):
     if self.load():
         return self(*args, **named)
     else:
         try:
             from OpenGL import error
         except ImportError:
             # Python interpreter is shutting down...
             pass  # ^ it is? is it?
         else:
             raise error.NullFunctionError(
                 f"Attempt to call an undefined function {self.__name__}, "
                 f"check for bool({self.__name__}) before calling")
Exemple #6
0
 def finalise(self):
     """Call, doing a late lookup and bind to find an implementation"""
     for alternate in self._alternatives:
         if alternate:
             log.info("""Chose alternate: %s from %s""", alternate.__name__,
                      ", ".join([x.__name__ for x in self._alternatives]))
             return alternate
     from OpenGL import error
     raise error.NullFunctionError(
         """Attempt to call an undefined alternate function (%s), check for bool(%s) before calling"""
         % (
             ', '.join([x.__name__ for x in self._alternatives]),
             self.__name__,
         ))
Exemple #7
0
 def __call__(self, *args, **named):
     if self.load():
         return self(*args, **named)
     else:
         try:
             from OpenGL import error
         except ImportError as err:
             # Python interpreter is shutting down...
             pass
         else:
             raise error.NullFunctionError(
                 """Attempt to call an undefined function %s, check for bool(%s) before calling"""
                 % (
                     self.__name__,
                     self.__name__,
                 ))
Exemple #8
0
 def __call__(self, *args, **named):
     from OpenGL import error
     raise error.NullFunctionError(
         f"Attempt to call a deprecated function {self.name} while OpenGL in "
         "FORWARD_COMPATIBLE_ONLY mode.  Set OpenGL.FORWARD_COMPATIBLE_ONLY to False "
         "to use legacy entry points")