def _load( ):
    """Load the os.name plugin for the platform functionality"""
    key = (os.environ.get( 'PYOPENGL_PLATFORM'), sys.platform,os.name)
    plugin  = PlatformPlugin.match( key )
    plugin_class = plugin.load()
    plugin.loaded = True
    # create instance of this platform implementation
    plugin = plugin_class()

    # install into the platform module's namespace now
    plugin.install(globals())
    return plugin
Beispiel #2
0
def _load( ):
    """Load the os.name plugin for the platform functionality"""
    key = (os.environ.get( 'PYOPENGL_PLATFORM'), sys.platform,os.name)
    plugin  = PlatformPlugin.match( key )
    plugin_class = plugin.load()
    plugin.loaded = True
    # create instance of this platform implementation
    plugin = plugin_class()

    # install into the platform module's namespace now
    plugin.install(globals())
    return plugin
Beispiel #3
0
WARN_ON_FORMAT_UNAVAILABLE = False
FORWARD_COMPATIBLE_ONLY = False
SIZE_1_ARRAY_UNPACK = True
USE_ACCELERATE = environ_key('USE_ACCELERATE', True)
CONTEXT_CHECKING = environ_key('CONTEXT_CHECKING', False)

FULL_LOGGING = environ_key('FULL_LOGGING', False)
ALLOW_NUMPY_SCALARS = environ_key('ALLOW_NUMPY_SCALARS', False)
UNSIGNED_BYTE_IMAGES_AS_STRING = environ_key('UNSIGNED_BYTE_IMAGES_AS_STRING',
                                             True)
MODULE_ANNOTATIONS = False

# Declarations of plugins provided by PyOpenGL itself
from OpenGL.plugins import PlatformPlugin, FormatHandler

PlatformPlugin('nt', 'OpenGL.platform.win32.Win32Platform')
PlatformPlugin('linux2', 'OpenGL.platform.glx.GLXPlatform')
PlatformPlugin('darwin', 'OpenGL.platform.darwin.DarwinPlatform')
PlatformPlugin('posix', 'OpenGL.platform.glx.GLXPlatform')
PlatformPlugin('osmesa', 'OpenGL.platform.osmesa.OSMesaPlatform')
PlatformPlugin('egl', 'OpenGL.platform.egl.EGLPlatform')

import sys
if sys.version_info[0] < 3:
    # Python 3.x renames the built-in module
    _bi = '__builtin__'
else:
    _bi = 'builtins'

FormatHandler('none',
              'OpenGL.arrays.nones.NoneHandler', [_bi + '.NoneType'],
ERROR_ON_COPY = False
ARRAY_SIZE_CHECKING = True
STORE_POINTERS = True
WARN_ON_FORMAT_UNAVAILABLE = False
FORWARD_COMPATIBLE_ONLY = False
SIZE_1_ARRAY_UNPACK = True
USE_ACCELERATE = True
CONTEXT_CHECKING = False

FULL_LOGGING = False
ALLOW_NUMPY_SCALARS = False
UNSIGNED_BYTE_IMAGES_AS_STRING = True

# Declarations of plugins provided by PyOpenGL itself
from OpenGL.plugins import PlatformPlugin, FormatHandler
PlatformPlugin('nt', 'OpenGL.platform.win32.Win32Platform')
PlatformPlugin('linux2', 'OpenGL.platform.glx.GLXPlatform')
PlatformPlugin('darwin', 'OpenGL.platform.darwin.DarwinPlatform')
PlatformPlugin('posix', 'OpenGL.platform.glx.GLXPlatform')

FormatHandler('none', 'OpenGL.arrays.nones.NoneHandler')
FormatHandler('str', 'OpenGL.arrays.strings.StringHandler')
FormatHandler('list', 'OpenGL.arrays.lists.ListHandler',
              ['__builtin__.list', '__builtin__.tuple'])
FormatHandler('numbers', 'OpenGL.arrays.numbers.NumberHandler')
FormatHandler(
    'ctypesarray',
    'OpenGL.arrays.ctypesarrays.CtypesArrayHandler',
    [
        '_ctypes.ArrayType',
    ],
Beispiel #5
0
STORE_POINTERS = environ_key("STORE_POINTERS", True)
WARN_ON_FORMAT_UNAVAILABLE = False
FORWARD_COMPATIBLE_ONLY = False
SIZE_1_ARRAY_UNPACK = True
USE_ACCELERATE = environ_key("USE_ACCELERATE", True)
CONTEXT_CHECKING = environ_key("CONTEXT_CHECKING", False)

FULL_LOGGING = environ_key("FULL_LOGGING", False)
ALLOW_NUMPY_SCALARS = environ_key("ALLOW_NUMPY_SCALARS", False)
UNSIGNED_BYTE_IMAGES_AS_STRING = environ_key("UNSIGNED_BYTE_IMAGES_AS_STRING", True)
MODULE_ANNOTATIONS = False
TYPE_ANNOTATIONS = False


# Declarations of plugins provided by PyOpenGL itself
PlatformPlugin("nt", "OpenGL.platform.win32.Win32Platform")
PlatformPlugin("linux2", "OpenGL.platform.glx.GLXPlatform")
PlatformPlugin("darwin", "OpenGL.platform.darwin.DarwinPlatform")
PlatformPlugin("posix", "OpenGL.platform.glx.GLXPlatform")
PlatformPlugin("osmesa", "OpenGL.platform.osmesa.OSMesaPlatform")
PlatformPlugin("egl", "OpenGL.platform.egl.EGLPlatform")


FormatHandler("none", "OpenGL.arrays.nones.NoneHandler",
              ["__builtin__.NoneType"], isOutput=False)

FormatHandler("str", "OpenGL.arrays.strings.StringHandler",
              ["__builtin__.str"], isOutput=False)

FormatHandler("unicode", "OpenGL.arrays.strings.UnicodeHandler",
              ["__builtin__.unicode"], isOutput=False)