| |
- object
-
- BasePlatform
- _NullFunctionPointer
class BasePlatform(object) |
|
Base class for per-platform implementations
Attributes of note:
EXPORTED_NAMES -- set of names exported via the platform
module's namespace...
GL, GLU, GLUT, GLE, OpenGL -- ctypes libraries
DEFAULT_FUNCTION_TYPE -- used as the default function
type for functions unless overridden on a per-DLL
basis with a "FunctionType" member
GLUT_GUARD_CALLBACKS -- if True, the GLUT wrappers
will provide guarding wrappers to prevent GLUT
errors with uninitialised GLUT.
EXTENSIONS_USE_BASE_FUNCTIONS -- if True, uses regular
dll attribute-based lookup to retrieve extension
function pointers. |
|
Methods defined here:
- CurrentContextIsValid(self)
- Return boolean of whether current context is valid
- GetCurrentContext(self)
- Retrieve opaque pointer for the current context
- copyBaseFunction(self, original)
- Create a new base function based on an already-created function
This is normally used to provide type-specific convenience versions of
a definition created by the automated generator.
- createBaseFunction(self, functionName, dll, resultType=<class 'ctypes.c_long'>, argTypes=(), doc=None, argNames=())
- Create a base function for given name
Normally you can just use the dll.name hook to get the object,
but we want to be able to create different bindings for the
same function, so we do the work manually here to produce a
base function from a DLL.
- createExtensionFunction(self, functionName, dll, resultType=<class 'ctypes.c_long'>, argTypes=(), doc=None, argNames=())
- Create an extension function for the given name
Uses the platform's getExtensionProcedure function to retrieve
a c_void_p to the function, then wraps in a platform FunctionType
instance with all the funky code we've come to love.
- errorChecking(self, func)
- Add error checking to the function if appropriate
- functionTypeFor(self, dll)
- Given a DLL, determine appropriate function type...
- getGLUTFontPointer(self, constant)
- Retrieve a GLUT font pointer for this platform
- install(self, namespace)
- Install this platform instance into the platform module
- nullFunction(self, functionName, dll, resultType=<class 'ctypes.c_long'>, argTypes=(), doc=None, argNames=(), extension=True)
- Construct a "null" function pointer
- safeGetError(self)
- Safety-checked version of glError() call (checks for valid context first)
- wrapLogging(self, func)
- Wrap function with logging operations if appropriate
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- DEFAULT_FUNCTION_TYPE = None
- EXPORTED_NAMES = ['GetCurrentContext', 'CurrentContextIsValid', 'safeGetError', 'createBaseFunction', 'createExtensionFunction', 'copyBaseFunction', 'GL', 'GLU', 'GLUT', 'GLE', 'OpenGL', 'getGLUTFontPointer', 'GLUT_GUARD_CALLBACKS']
- EXTENSIONS_USE_BASE_FUNCTIONS = False
- GLUT_GUARD_CALLBACKS = False
|
class _NullFunctionPointer(object) |
|
Function-pointer-like object for undefined functions |
|
Methods defined here:
- __call__(self, *args, **named)
- __init__(self, name, dll, resultType, argTypes, argNames, extension=True)
- __nonzero__(self)
- Make this object appear to be NULL
- load(self)
- Attempt to load the function again, presumably with a context this time
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- resolved = False
| |