| """FreeGLUT extensions to the GLUT API |
| |
| This module will provide the FreeGLUT extensions if they are available |
| from the GLUT module. Note that any other implementation that also provides |
| these entry points will also retrieve the entry points with this module. |
| """ |
| |
| from OpenGL import platform, arrays |
| from OpenGL import constant |
| FUNCTION_TYPE = platform.PLATFORM.functionTypeFor( platform.PLATFORM.GLUT ) |
| from OpenGL.GLUT import special |
| from OpenGL import wrapper as _wrapper |
| from OpenGL.raw.GL._types import * |
|
|
| import ctypes |
| c_int = ctypes.c_int |
| c_char_p = ctypes.c_char_p |
| c_ubyte = ctypes.c_ubyte |
| c_void_p = ctypes.c_void_p |
|
|
| GLUT_DEBUG = constant.Constant( 'GLUT_DEBUG', 0x0001 ) |
| GLUT_FORWARD_COMPATIBLE = constant.Constant( 'GLUT_FORWARD_COMPATIBLE', 0x0002) |
|
|
| GLUT_ACTION_EXIT = constant.Constant( 'GLUT_ACTION_EXIT', 0 ) |
| GLUT_ACTION_GLUTMAINLOOP_RETURNS = constant.Constant( 'GLUT_ACTION_GLUTMAINLOOP_RETURNS', 1 ) |
| GLUT_ACTION_CONTINUE_EXECUTION = constant.Constant( 'GLUT_ACTION_CONTINUE_EXECUTION', 2 ) |
|
|
| GLUT_INIT_MAJOR_VERSION = constant.Constant( 'GLUT_INIT_MAJOR_VERSION', 0x0200 ) |
| GLUT_INIT_MINOR_VERSION = constant.Constant( 'GLUT_INIT_MINOR_VERSION', 0x0201 ) |
| GLUT_INIT_FLAGS = constant.Constant( 'GLUT_INIT_FLAGS', 0x0202 ) |
|
|
| GLUT_CREATE_NEW_CONTEXT = constant.Constant( 'GLUT_CREATE_NEW_CONTEXT', 0 ) |
| GLUT_USE_CURRENT_CONTEXT = constant.Constant( 'GLUT_USE_CURRENT_CONTEXT', 1 ) |
|
|
| GLUT_ACTION_ON_WINDOW_CLOSE = constant.Constant( 'GLUT_ACTION_ON_WINDOW_CLOSE', 0x01F9 ) |
| GLUT_WINDOW_BORDER_WIDTH = constant.Constant( 'GLUT_WINDOW_BORDER_WIDTH', 0x01FA ) |
| GLUT_WINDOW_HEADER_HEIGHT = constant.Constant( 'GLUT_USE_CURRENT_CONTEXT', 0x01FB ) |
| |
| GLUT_RENDERING_CONTEXT = constant.Constant( 'GLUT_RENDERING_CONTEXT', 0x01FD ) |
|
|
| GLUT_ALLOW_DIRECT_CONTEXT=1 |
| GLUT_AUX=0x1000 |
| GLUT_AUX1=0x1000 |
| GLUT_AUX2=0x2000 |
| GLUT_AUX3=0x4000 |
| GLUT_AUX4=0x8000 |
| GLUT_BORDERLESS=0x0800 |
| GLUT_CAPTIONLESS=0x0400 |
| GLUT_COMPATIBILITY_PROFILE=0x0002 |
| GLUT_CORE_PROFILE=0x0001 |
| GLUT_DIRECT_RENDERING=0x01 |
| GLUT_FORCE_DIRECT_CONTEXT=3 |
| GLUT_FORCE_INDIRECT_CONTEXT=0 |
| GLUT_FULL_SCREEN=0x01 |
| GLUT_INIT_PROFILE=0x0203 |
| GLUT_KEY_BEGIN=0x006 |
| GLUT_KEY_DELETE=0x006 |
| GLUT_KEY_NUM_LOCK=0x006 |
| GLUT_SRGB=0x1000 |
| GLUT_TRY_DIRECT_CONTEXT=2 |
|
|
| |
| glutMainLoopEvent = platform.createBaseFunction( |
| 'glutMainLoopEvent', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[], |
| doc='glutMainLoopEvent( ) -> None', |
| argNames=(), |
| ) |
| |
| glutLeaveMainLoop = platform.createBaseFunction( |
| 'glutLeaveMainLoop', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[], |
| doc='glutLeaveMainLoop( ) -> None', |
| argNames=(), |
| ) |
|
|
| |
| |
| |
| |
| |
| |
| |
| glutMouseWheelFunc = special.GLUTCallback( |
| 'MouseWheel', (c_int, c_int, c_int, c_int,), ('wheel','direction','x','y'), |
| ) |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| glutCloseFunc = special.GLUTCallback( |
| 'Close', (), (), |
| ) |
|
|
| |
| |
| |
| |
| |
| |
| |
| glutWMCloseFunc = special.GLUTCallback( |
| 'WMClose', (), (), |
| ) |
|
|
| |
| |
| |
| |
| |
| |
| |
| glutMenuDestroyFunc = special.GLUTCallback( |
| 'MenuDestroy', (), (), |
| ) |
|
|
| |
| glutSetOption = platform.createBaseFunction( |
| 'glutSetOption', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLenum, c_int], |
| doc='glutSetOption( GLenum(option_flag), c_int(value) ) -> None', |
| argNames=('option_flag', 'value'), |
| ) |
|
|
| |
| glutGetWindowData = platform.createBaseFunction( |
| 'glutGetWindowData', dll=platform.PLATFORM.GLUT, resultType=c_void_p, |
| argTypes=[], |
| doc='glutGetWindowData( ) -> c_void_p', |
| argNames=(), |
| ) |
|
|
| |
| glutSetWindowData = platform.createBaseFunction( |
| 'glutSetWindowData', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_void_p], |
| doc='glutSetWindowData( c_void_p(data) ) -> None', |
| argNames=('data',), |
| ) |
|
|
| |
| glutGetMenuData = platform.createBaseFunction( |
| 'glutGetMenuData', dll=platform.PLATFORM.GLUT, resultType=c_void_p, |
| argTypes=[], |
| doc='glutGetMenuData( ) -> c_void_p', |
| argNames=(), |
| ) |
|
|
| |
| glutSetMenuData = platform.createBaseFunction( |
| 'glutSetMenuData', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_void_p], |
| doc='glutSetMenuData( c_void_p(data) ) -> None', |
| argNames=('data',), |
| ) |
|
|
| |
| glutBitmapHeight = platform.createBaseFunction( |
| 'glutBitmapHeight', dll=platform.PLATFORM.GLUT, resultType=c_int, |
| argTypes=[c_void_p], |
| doc='glutBitmapHeight( c_void_p(font) ) -> c_int', |
| argNames=('font',), |
| ) |
|
|
| |
| glutStrokeHeight = platform.createBaseFunction( |
| 'glutStrokeHeight', dll=platform.PLATFORM.GLUT, resultType=GLfloat, |
| argTypes=[c_void_p], |
| doc='glutStrokeHeight( c_void_p(font) ) -> GLfloat', |
| argNames=('font',), |
| ) |
|
|
| |
| glutBitmapString = platform.createBaseFunction( |
| 'glutBitmapString', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_void_p, c_char_p], |
| doc='glutBitmapString( c_void_p(font), POINTER(c_ubyte)(string) ) -> None', |
| argNames=('font', 'string'), |
| ) |
|
|
| |
| glutStrokeString = platform.createBaseFunction( |
| 'glutStrokeString', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_void_p, c_char_p], |
| doc='glutStrokeString( c_void_p(font), POINTER(c_ubyte)(string) ) -> None', |
| argNames=('font', 'string'), |
| ) |
|
|
| |
| glutWireRhombicDodecahedron = platform.createBaseFunction( |
| 'glutWireRhombicDodecahedron', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[], |
| doc='glutWireRhombicDodecahedron( ) -> None', |
| argNames=(), |
| ) |
|
|
| |
| glutSolidRhombicDodecahedron = platform.createBaseFunction( |
| 'glutSolidRhombicDodecahedron', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[], |
| doc='glutSolidRhombicDodecahedron( ) -> None', |
| argNames=(), |
| ) |
|
|
| |
| glutWireSierpinskiSponge = platform.createBaseFunction( |
| 'glutWireSierpinskiSponge', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_int, arrays.GLdoubleArray, GLdouble], |
| doc='glutWireSierpinskiSponge( c_int(num_levels), arrays.GLdoubleArray(offset), GLdouble(scale) ) -> None', |
| argNames=('num_levels', 'offset', 'scale'), |
| ) |
|
|
| glutWireSierpinskiSponge = _wrapper.wrapper( glutWireSierpinskiSponge ).setInputArraySize( |
| 'offset', |
| ) |
|
|
| |
| glutSolidSierpinskiSponge = platform.createBaseFunction( |
| 'glutSolidSierpinskiSponge', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[c_int, arrays.GLdoubleArray, GLdouble], |
| doc='glutSolidSierpinskiSponge( c_int(num_levels), arrays.GLdoubleArray(offset), GLdouble(scale) ) -> None', |
| argNames=('num_levels', 'offset', 'scale'), |
| ) |
|
|
| glutSolidSierpinskiSponge = _wrapper.wrapper( glutSolidSierpinskiSponge ).setInputArraySize( |
| 'offset', |
| ) |
|
|
| |
| glutWireCylinder = platform.createBaseFunction( |
| 'glutWireCylinder', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLdouble, GLdouble, GLint, GLint], |
| doc='glutWireCylinder( GLdouble(radius), GLdouble(height), GLint(slices), GLint(stacks) ) -> None', |
| argNames=('radius', 'height', 'slices', 'stacks'), |
| ) |
|
|
| |
| glutSolidCylinder = platform.createBaseFunction( |
| 'glutSolidCylinder', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLdouble, GLdouble, GLint, GLint], |
| doc='glutSolidCylinder( GLdouble(radius), GLdouble(height), GLint(slices), GLint(stacks) ) -> None', |
| argNames=('radius', 'height', 'slices', 'stacks'), |
| ) |
|
|
| |
| glutGetProcAddress = platform.createBaseFunction( |
| 'glutGetProcAddress', dll=platform.PLATFORM.GLUT, resultType=c_void_p, |
| argTypes=[c_char_p], |
| doc='glutGetProcAddress( STRING(procName) ) -> c_void_p', |
| argNames=('procName',), |
| ) |
|
|
| glutInitContextFlags = platform.createBaseFunction( |
| 'glutInitContextFlags', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLint], |
| doc='glutInitContextFlags( GLint(flags) ) -> None', |
| argNames = ('flags',), |
| ) |
| glutInitContextProfile = platform.createBaseFunction( |
| 'glutInitContextProfile', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLint], |
| doc='glutInitContextProfile( GLint(profile) ) -> None', |
| argNames = ('profile',), |
| ) |
| glutInitContextVersion = platform.createBaseFunction( |
| 'glutInitContextVersion', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[GLint,GLint], |
| doc='glutInitContextVersion( GLint(majorVersion), GLint(minorVersion) ) -> None', |
| argNames = ('majorVersion','minorVersion'), |
| ) |
| glutFullScreenToggle = platform.createBaseFunction( |
| 'glutFullScreenToggle', dll=platform.PLATFORM.GLUT, resultType=None, |
| argTypes=[], |
| doc='glutFullScreenToggle( ) -> None', |
| argNames = (), |
| ) |
|
|
| |
| |
| glutGetModeValues = platform.createBaseFunction( |
| 'glutGetModeValues', dll=platform.PLATFORM.GLUT, resultType=ctypes.POINTER(GLint), |
| argTypes=[GLint,ctypes.POINTER(GLint)], |
| doc='glutInitContextVersion( GLenum(mode), POINTER(GLint)(size) ) -> POINTER(GLint)', |
| argNames = ('mode','size'), |
| ) |
|
|
| fgDeinitialize = platform.createBaseFunction( |
| 'fgDeinitialize', dll=platform.PLATFORM.GLUT, resultType = None, |
| argTypes=[GLint], |
| doc ='''fgDeinitialize () -> None |
| |
| Exposed to allow client code to work around an AMD/FGLRX bug on |
| GLX platforms. FGLRX and FreeGLUT both register cleanup functions |
| that unless registered in the correct order, will cause seg-faults. |
| |
| To work around this, call fgDeinitialize(False) before doing a |
| sys.exit() or similar call that terminates your GLUT mainloop. |
| ''', |
| ) |
|
|