diff -Nru pyopengl-3.0.0~c1/debian/changelog pyopengl-3.0.0/debian/changelog --- pyopengl-3.0.0~c1/debian/changelog 2009-05-07 10:45:22.000000000 +1000 +++ pyopengl-3.0.0/debian/changelog 2009-05-07 10:45:23.000000000 +1000 @@ -1,3 +1,9 @@ +pyopengl (3.0.0-1) unstable; urgency=low + + * New upstream release + + -- Robert Ancell Thu, 07 May 2009 10:01:58 +1000 + pyopengl (3.0.0~c1-1) unstable; urgency=low * New upstream release (Closes: #498403) diff -Nru pyopengl-3.0.0~c1/debian/python-opengl-doc.doc-base pyopengl-3.0.0/debian/python-opengl-doc.doc-base --- pyopengl-3.0.0~c1/debian/python-opengl-doc.doc-base 2009-05-07 10:45:22.000000000 +1000 +++ pyopengl-3.0.0/debian/python-opengl-doc.doc-base 1970-01-01 10:00:00.000000000 +1000 @@ -1,13 +0,0 @@ -Document: pyopengl -Title: PyOpenGL API Documentation -Author: Micheal C. Fletcher -Abstract: A ctypes-based OpenGL wrapper for Python - This is the PyOpenGL 3.0.0 tree, it attempts to provide - a largely compatible API for code written with the - PyOpenGL 2.x series using the ctypes foreign function - interface system. -Section: Programming/Python - -Format: HTML -Index: /usr/share/doc/python-opengl-doc/documentation/pydoc/OpenGL.html -Files: /usr/share/doc/python-opengl-doc/documentation/pydoc/*.html diff -Nru pyopengl-3.0.0~c1/debian/python-opengl-doc.docs pyopengl-3.0.0/debian/python-opengl-doc.docs --- pyopengl-3.0.0~c1/debian/python-opengl-doc.docs 2009-05-07 10:45:22.000000000 +1000 +++ pyopengl-3.0.0/debian/python-opengl-doc.docs 1970-01-01 10:00:00.000000000 +1000 @@ -1 +0,0 @@ -documentation/ diff -Nru pyopengl-3.0.0~c1/OpenGL/arrays/formathandler.py pyopengl-3.0.0/OpenGL/arrays/formathandler.py --- pyopengl-3.0.0~c1/OpenGL/arrays/formathandler.py 2008-12-21 03:01:54.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/arrays/formathandler.py 2009-04-01 01:54:49.000000000 +1100 @@ -13,7 +13,13 @@ def __init__( self, match ): self.match = match def __call__( self, value ): - typ = value.__class__ + try: + typ = value.__class__ + except AttributeError, err: + # Bug report that at least one type of array can + # be passed in without __class__ available, likely + # on an older Python or with old Numeric. + typ = type(value) handler = self.get( typ ) if handler is None: if hasattr( typ, '__mro__' ): diff -Nru pyopengl-3.0.0~c1/OpenGL/arrays/strings.py pyopengl-3.0.0/OpenGL/arrays/strings.py --- pyopengl-3.0.0~c1/OpenGL/arrays/strings.py 2008-12-21 03:01:54.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/arrays/strings.py 2009-03-31 03:28:04.000000000 +1100 @@ -1,17 +1,27 @@ """String-array-handling code for PyOpenGL """ -from OpenGL.arrays._strings import dataPointer +#from OpenGL.arrays._strings import dataPointer as old from OpenGL import constants from OpenGL.arrays import formathandler import ctypes +psas = ctypes.pythonapi.PyString_AsString +# it's a c_char_p, but if we use that then the code will +# attempt to use null-terminated versus arbitrarily sized +psas.restype = ctypes.c_size_t +#psas.restype = ctypes.c_char_p + +def dataPointer( value, typeCode=None ): + new = psas( ctypes.py_object(value) ) + return new + class StringHandler( formathandler.FormatHandler ): """String-specific data-type handler for OpenGL""" HANDLED_TYPES = (str, ) - @classmethod - def from_param( cls, value, typeCode=None ): - return dataPointer( value ) - dataPointer = staticmethod( dataPointer ) +# @classmethod +# def from_param( cls, value, typeCode=None ): +# return dataPointer( value ) + dataPointer = from_param = staticmethod( dataPointer ) def zeros( self, dims, typeCode=None ): """Currently don't allow strings as output types!""" raise NotImplemented( """Don't currently support strings as output arrays""" ) diff -Nru pyopengl-3.0.0~c1/OpenGL/extensions.py pyopengl-3.0.0/OpenGL/extensions.py --- pyopengl-3.0.0~c1/OpenGL/extensions.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/extensions.py 2009-03-04 18:27:32.000000000 +1100 @@ -50,12 +50,14 @@ def __nonzero__( self ): for alternate in self._alternatives: if alternate: + self.__class__.implementation = alternate return True return False 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__.implementation = alternate self.__class__.__call__ = alternate.__call__ return self( *args, **named ) from OpenGL import error diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/ARB/shader_objects.py pyopengl-3.0.0/OpenGL/GL/ARB/shader_objects.py --- pyopengl-3.0.0~c1/OpenGL/GL/ARB/shader_objects.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/ARB/shader_objects.py 2009-03-14 08:58:22.000000000 +1100 @@ -50,7 +50,7 @@ name = 'glUniform%(size)s%(format)svARB'%globals() globals()[name] = arrays.setInputArraySizeType( globals()[name], - size, + None, # don't want to enforce size... arrayType, 'value', ) diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/ARB/vertex_program.py pyopengl-3.0.0/OpenGL/GL/ARB/vertex_program.py --- pyopengl-3.0.0~c1/OpenGL/GL/ARB/vertex_program.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/ARB/vertex_program.py 2009-03-09 11:59:39.000000000 +1100 @@ -10,6 +10,10 @@ import ctypes from OpenGL.raw.GL.ARB.vertex_program import * ### END AUTOGENERATED SECTION +from OpenGL.lazywrapper import lazy + +from OpenGL import converters, error, contextdata +from OpenGL.arrays.arraydatatype import ArrayDatatype # Note: sizes here are == the only documented sizes I could find, # may need a lookup table some day... glGetProgramivARB = wrapper.wrapper(glGetProgramivARB).setOutput( @@ -50,3 +54,37 @@ ## pointer = arrays.GLdoubleArray.voidDataPointer( output ) ## _base_glGetVertexAttribPointervARB( index, pname, pointer ) ## return output + +@lazy( glVertexAttribPointerARB ) +def glVertexAttribPointerARB( + baseOperation, index, size, type, + normalized, stride, pointer, +): + """Set an attribute pointer for a given shader (index) + + index -- the index of the generic vertex to bind, see + glGetAttribLocation for retrieval of the value, + note that index is a global variable, not per-shader + size -- number of basic elements per record, 1,2,3, or 4 + type -- enum constant for data-type + normalized -- whether to perform int to float + normalization on integer-type values + stride -- stride in machine units (bytes) between + consecutive records, normally used to create + "interleaved" arrays + pointer -- data-pointer which provides the data-values, + normally a vertex-buffer-object or offset into the + same. + + This implementation stores a copy of the data-pointer + in the contextdata structure in order to prevent null- + reference errors in the renderer. + """ + array = ArrayDatatype.asArray( pointer ) + key = ('vertex-attrib',index) + contextdata.setValue( key, array ) + return baseOperation( + index, size, type, + normalized, stride, + ArrayDatatype.voidDataPointer( array ) + ) diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/ARB/vertex_shader.py pyopengl-3.0.0/OpenGL/GL/ARB/vertex_shader.py --- pyopengl-3.0.0~c1/OpenGL/GL/ARB/vertex_shader.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/ARB/vertex_shader.py 2009-03-09 11:59:38.000000000 +1100 @@ -10,7 +10,7 @@ import ctypes from OpenGL.raw.GL.ARB.vertex_shader import * ### END AUTOGENERATED SECTION - +from OpenGL.lazywrapper import lazy from shader_objects import glGetObjectParameterivARB base_glGetActiveAttribARB = glGetActiveAttribARB @@ -26,3 +26,13 @@ return name.value, size[0], gl_type[0] raise IndexError, 'index out of range from zero to %i' % (max_index - 1, ) glGetActiveAttribARB.wrappedOperation = base_glGetActiveAttribARB + +@lazy( glGetAttribLocationARB ) +def glGetAttribLocationARB( baseOperation, program, name ): + """Check that name is a string with a null byte at the end of it""" + if not name: + raise ValueError( """Non-null name required""" ) + elif name[-1] != '\000': + name = name + '\000' + return baseOperation( program, name ) + diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/EXT/multi_draw_arrays.py pyopengl-3.0.0/OpenGL/GL/EXT/multi_draw_arrays.py --- pyopengl-3.0.0~c1/OpenGL/GL/EXT/multi_draw_arrays.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/EXT/multi_draw_arrays.py 2009-03-04 18:40:24.000000000 +1100 @@ -14,14 +14,20 @@ from OpenGL.GL.pointers import glDrawElements @lazy( glMultiDrawElementsEXT ) -def glMultiDrawElementsEXT(baseOperation, primtype, counts, typ, indices, primcount): +def glMultiDrawElementsEXT(baseOperation, primtype, counts, typ, indices, primcount=None): """Currently glMultiDrawElementsEXT is not working in the wrapper We are replacing the code with a sequence of glDrawElements calls - as per the spec for the function... + as per the spec for the function. Basically we'd spend more effort + making an array of array pointers than we would creating a simple + iteration in Python. """ - for i in xrange( primcount ): - glDrawElements( primtype, counts[i], typ, indices[i] ) + if primcount is not None: + for i in xrange( primcount ): + glDrawElements( primtype, counts[i], typ, indices[i] ) + else: + for c,i in zip( counts, indices ): + glDrawElements( primtype, c, typ, i ) #def convertIndices( arg, wrappedOperation, args ): # """Convert indices to an array of arrays""" diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/images.py pyopengl-3.0.0/OpenGL/GL/images.py --- pyopengl-3.0.0~c1/OpenGL/GL/images.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/images.py 2009-03-30 07:43:25.000000000 +1100 @@ -524,6 +524,8 @@ def typedImageFunction( suffix, arrayConstant, baseFunction ): """Produce a typed version of the given image function""" + functionName = baseFunction.__name__ + functionName = '%(functionName)s%(suffix)s'%locals() if baseFunction: arrayType = arrays.GL_CONSTANT_TO_ARRAY_TYPE[ arrayConstant ] function = setDimensionsAsInts( @@ -533,11 +535,9 @@ typeName = arrayConstant, ) ) - functionName = baseFunction.__name__ - functionName = '%(functionName)s%(suffix)s'%locals() return functionName, function else: - return baseFunction.__name__, baseFunction + return functionName, baseFunction def _setDataSize( baseFunction, argument='imageSize' ): """Set the data-size value to come from the data field""" diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/VERSION/GL_1_4.py pyopengl-3.0.0/OpenGL/GL/VERSION/GL_1_4.py --- pyopengl-3.0.0~c1/OpenGL/GL/VERSION/GL_1_4.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/VERSION/GL_1_4.py 2009-03-04 18:41:29.000000000 +1100 @@ -23,11 +23,17 @@ #) @lazy( glMultiDrawElements ) -def glMultiDrawElements(baseOperation, primtype, counts, typ, indices, primcount): +def glMultiDrawElements(baseOperation, primtype, counts, typ, indices, primcount=None): """Currently glMultiDrawElements is not working in the wrapper We are replacing the code with a sequence of glDrawElements calls - as per the spec for the function... + as per the spec for the function. Basically we'd spend more effort + making an array of array pointers than we would creating a simple + iteration in Python. """ - for i in xrange( primcount ): - glDrawElements( primtype, counts[i], typ, indices[i] ) + if primcount is not None: + for i in xrange( primcount ): + glDrawElements( primtype, counts[i], typ, indices[i] ) + else: + for c,i in zip( counts, indices ): + glDrawElements( primtype, c, typ, i ) diff -Nru pyopengl-3.0.0~c1/OpenGL/GL/VERSION/GL_2_0.py pyopengl-3.0.0/OpenGL/GL/VERSION/GL_2_0.py --- pyopengl-3.0.0~c1/OpenGL/GL/VERSION/GL_2_0.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/GL/VERSION/GL_2_0.py 2009-03-29 09:20:26.000000000 +1100 @@ -16,7 +16,8 @@ from OpenGL.GL.ARB.shader_objects import glGetInfoLogARB as glGetInfoLog from OpenGL.lazywrapper import lazy -from OpenGL import converters, error +from OpenGL import converters, error, contextdata +from OpenGL.arrays.arraydatatype import ArrayDatatype GL_INFO_LOG_LENGTH = constant.Constant( 'GL_INFO_LOG_LENGTH', 0x8B84 ) glShaderSource = platform.createBaseFunction( @@ -52,7 +53,7 @@ name = 'glUniform%(size)s%(format)sv'%globals() globals()[name] = arrays.setInputArraySizeType( globals()[name], - size, + None, # don't want to enforce size... arrayType, 'value', ) @@ -187,4 +188,46 @@ elif name[-1] != '\000': name = name + '\000' return baseOperation( program, name ) +@lazy( glGetAttribLocation ) +def glGetAttribLocation( baseOperation, program, name ): + """Check that name is a string with a null byte at the end of it""" + if not name: + raise ValueError( """Non-null name required""" ) + elif name[-1] != '\000': + name = name + '\000' + return baseOperation( program, name ) +@lazy( glVertexAttribPointer ) +def glVertexAttribPointer( + baseOperation, index, size, type, + normalized, stride, pointer, +): + """Set an attribute pointer for a given shader (index) + + index -- the index of the generic vertex to bind, see + glGetAttribLocation for retrieval of the value, + note that index is a global variable, not per-shader + size -- number of basic elements per record, 1,2,3, or 4 + type -- enum constant for data-type + normalized -- whether to perform int to float + normalization on integer-type values + stride -- stride in machine units (bytes) between + consecutive records, normally used to create + "interleaved" arrays + pointer -- data-pointer which provides the data-values, + normally a vertex-buffer-object or offset into the + same. + + This implementation stores a copy of the data-pointer + in the contextdata structure in order to prevent null- + reference errors in the renderer. + """ + array = ArrayDatatype.asArray( pointer ) + key = ('vertex-attrib',index) + contextdata.setValue( key, array ) + return baseOperation( + index, size, type, + normalized, stride, + ArrayDatatype.voidDataPointer( array ) + ) + diff -Nru pyopengl-3.0.0~c1/OpenGL/__init__.py pyopengl-3.0.0/OpenGL/__init__.py --- pyopengl-3.0.0~c1/OpenGL/__init__.py 2008-12-08 15:16:32.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/__init__.py 2009-03-30 01:30:08.000000000 +1100 @@ -92,6 +92,11 @@ UNSIGNED_BYTE_IMAGES_AS_STRING -- if True, we will return GL_UNSIGNED_BYTE image-data as strings, istead of arrays for glReadPixels and glGetTexImage + + FORWARD_COMPATIBLE_ONLY -- only include OpenGL 3.1 compatible + entry points. Note that this will generally break most + PyOpenGL code that hasn't been explicitly made "legacy free" + via a significant rewrite. """ from OpenGL.version import __version__ @@ -99,6 +104,7 @@ ERROR_LOGGING = False ERROR_ON_COPY = False WARN_ON_FORMAT_UNAVAILABLE = False +FORWARD_COMPATIBLE_ONLY = False FULL_LOGGING = False ALLOW_NUMPY_SCALARS = False diff -Nru pyopengl-3.0.0~c1/OpenGL/platform/baseplatform.py pyopengl-3.0.0/OpenGL/platform/baseplatform.py --- pyopengl-3.0.0~c1/OpenGL/platform/baseplatform.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/platform/baseplatform.py 2009-03-30 01:09:51.000000000 +1100 @@ -6,6 +6,10 @@ import OpenGL as top_level_module from OpenGL import logs +if top_level_module.FORWARD_COMPATIBLE_ONLY: + from OpenGL.platform import entrypoint31 + + class BasePlatform( object ): """Base class for per-platform implementations @@ -91,7 +95,7 @@ pointer ) else: - AttributeError( """Extension %r available, but no pointer for function %r"""%(extension,functionName)) + raise AttributeError( """Extension %r available, but no pointer for function %r"""%(extension,functionName)) else: raise AttributeError( """No extension %r"""%(extension,)) else: @@ -127,6 +131,16 @@ """ from OpenGL import wrapper try: + if top_level_module.FORWARD_COMPATIBLE_ONLY and dll is self.GL: + if entrypoint31.deprecated( functionName ): + return self.nullFunction( + functionName, dll=dll, + resultType=resultType, + argTypes=argTypes, + doc = doc, argNames = argNames, + extension = extension, + deprecated = True, + ) return self.constructFunction( functionName, dll, resultType=resultType, argTypes=argTypes, @@ -198,9 +212,14 @@ argTypes=(), doc = None, argNames = (), extension = None, + deprecated = False, ): """Construct a "null" function pointer""" - cls = type( functionName, (_NullFunctionPointer,), { + if deprecated: + base = _DeprecatedFunctionPointer + else: + base = _NullFunctionPointer + cls = type( functionName, (base,), { '__doc__': doc, } ) return cls( @@ -280,3 +299,12 @@ self.__name__, self.__name__, ) ) + +class _DeprecatedFunctionPointer( _NullFunctionPointer ): + 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 True to use legacy entry points"""%( + self.__name__, + ) + ) diff -Nru pyopengl-3.0.0~c1/OpenGL/version.py pyopengl-3.0.0/OpenGL/version.py --- pyopengl-3.0.0~c1/OpenGL/version.py 2009-02-15 10:17:52.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/version.py 2009-04-01 02:01:17.000000000 +1100 @@ -1,2 +1,2 @@ """Declares the current version for use in setuptools and the like""" -__version__ = '3.0.0c1' +__version__ = '3.0.0' diff -Nru pyopengl-3.0.0~c1/OpenGL/wrapper.py pyopengl-3.0.0/OpenGL/wrapper.py --- pyopengl-3.0.0~c1/OpenGL/wrapper.py 2009-01-04 06:38:54.000000000 +1100 +++ pyopengl-3.0.0/OpenGL/wrapper.py 2009-03-27 01:43:56.000000000 +1100 @@ -61,6 +61,7 @@ 'cResolvers', 'storeValues', 'returnValues', + '_finalCall', ) def __init__( self, wrappedOperation ): """Initialise the wrapper, storing wrappedOperation""" @@ -281,8 +282,15 @@ if not callFunction: raise RuntimeError( """Missing finalised call type for %s"""%( self, )) else: - self.__class__.__call__ = callFunction - return self + #self.__class__.finalize = lambda *args: callFunction + #self.__call__ = callFunction + #self.__class__.__call__ = callFunction + #self.__class__.set_call( callFunction ) + #self.__class__.__dict__[ '__call__' ] = callFunction + #print 'setting class call', callFunction + self._finalCall = callFunction + return callFunction + #return self def finaliseCall( self ): """Produce specialised versions of call for finalised wrapper object @@ -374,21 +382,21 @@ else: calculate_cArguments = None if cWrapper: - return staticmethod(cWrapper( + return cWrapper( wrappedOperation, calculate_pyArgs=calculate_pyArgs, calculate_cArgs=calculate_cArgs, calculate_cArguments=calculate_cArguments, storeValues=storeValues, returnValues=returnValues, - )) + ) if pyConverters: if cConverters: # create a map of index,converter, callable if cResolvers: if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -417,7 +425,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -442,7 +450,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -464,7 +472,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -484,7 +492,7 @@ # null cResolvers if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -513,7 +521,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -538,7 +546,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -560,7 +568,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = tuple(calculate_cArgs( pyArgs )) @@ -581,7 +589,7 @@ if cResolvers: if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = pyArgs @@ -610,7 +618,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = pyArgs @@ -635,7 +643,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = pyArgs @@ -657,7 +665,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArgs = pyArgs @@ -677,7 +685,7 @@ # null cResolvers if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = tuple( calculate_pyArgs( args )) cArguments = pyArgs @@ -705,7 +713,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = tuple( calculate_pyArgs( args )) cArguments = pyArgs @@ -729,7 +737,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArguments = pyArgs @@ -750,7 +758,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = tuple( calculate_pyArgs( args )) cArguments = pyArgs @@ -771,7 +779,7 @@ if cResolvers: if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = args cArgs = [] @@ -788,7 +796,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = tuple(calculate_cArguments( cArgs )) @@ -816,7 +824,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = args cArgs = [] @@ -833,7 +841,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = tuple(calculate_cArguments( cArgs )) @@ -857,7 +865,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = args cArgs = [] @@ -874,7 +882,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = tuple(calculate_cArguments( cArgs )) @@ -895,7 +903,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = args cArgs = [] @@ -912,7 +920,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = tuple(calculate_cArguments( cArgs )) @@ -931,7 +939,7 @@ # null cResolvers if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" pyArgs = args cArgs = [] @@ -948,7 +956,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = cArgs @@ -976,7 +984,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" pyArgs = args cArgs = [] @@ -993,7 +1001,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = cArgs @@ -1017,7 +1025,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" pyArgs = args cArgs = [] @@ -1034,7 +1042,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = cArgs @@ -1055,7 +1063,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" pyArgs = args cArgs = [] @@ -1072,7 +1080,7 @@ if hasattr( err, 'args' ): err.args += ( """Failure in cConverter %r"""%(converter), - pyArgs, index, self, + pyArgs, index, ) raise cArguments = cArgs @@ -1092,7 +1100,7 @@ if cResolvers: if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" cArgs = args cArguments = tuple(calculate_cArguments( cArgs )) @@ -1120,7 +1128,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" cArgs = args cArguments = tuple(calculate_cArguments( cArgs )) @@ -1144,7 +1152,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" cArgs = args cArguments = tuple(calculate_cArguments( cArgs )) @@ -1165,7 +1173,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" cArgs = args cArguments = tuple(calculate_cArguments( cArgs )) @@ -1184,7 +1192,7 @@ # null cResolvers if storeValues: if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all possible operations""" cArguments = args try: @@ -1211,7 +1219,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues""" cArguments = args try: @@ -1234,7 +1242,7 @@ return wrapperCall else: # null storeValues if returnValues: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save storeValues""" cArguments = args try: @@ -1254,7 +1262,7 @@ ) return wrapperCall else: - def wrapperCall( self, *args ): + def wrapperCall( *args ): """Wrapper with all save returnValues and storeValues""" cArguments = args try: @@ -1270,7 +1278,10 @@ return wrapperCall def __call__( self, *args, **named ): """Finalise the wrapper before calling it""" - return self.finalise()( *args, **named ) + try: + return self._finalCall( *args, **named ) + except AttributeError, err: + return self.finalise()( *args, **named ) def _unspecialised__call__( self, *args ): """Expand arguments, call the function, store values and check errors""" diff -Nru pyopengl-3.0.0~c1/PKG-INFO pyopengl-3.0.0/PKG-INFO --- pyopengl-3.0.0~c1/PKG-INFO 2009-02-15 12:43:13.000000000 +1100 +++ pyopengl-3.0.0/PKG-INFO 2009-04-01 06:39:18.000000000 +1100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PyOpenGL -Version: 3.0.0c1 +Version: 3.0.0 Summary: Standard OpenGL bindings for Python Home-page: http://pyopengl.sourceforge.net Author: Mike C. Fletcher diff -Nru pyopengl-3.0.0~c1/src/numpy_formathandler.c pyopengl-3.0.0/src/numpy_formathandler.c --- pyopengl-3.0.0~c1/src/numpy_formathandler.c 2009-01-04 08:13:23.000000000 +1100 +++ pyopengl-3.0.0/src/numpy_formathandler.c 2009-03-24 10:02:10.000000000 +1100 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.14 on Sat Jan 3 16:13:23 2009 */ +/* Generated by Cython 0.9.6.14 on Mon Mar 23 19:02:09 2009 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff -Nru pyopengl-3.0.0~c1/src/wrapper.c pyopengl-3.0.0/src/wrapper.c --- pyopengl-3.0.0~c1/src/wrapper.c 2009-01-04 06:52:56.000000000 +1100 +++ pyopengl-3.0.0/src/wrapper.c 2009-03-24 10:02:07.000000000 +1100 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.14 on Sat Jan 3 14:52:56 2009 */ +/* Generated by Cython 0.9.6.14 on Mon Mar 23 19:02:07 2009 */ #define PY_SSIZE_T_CLEAN #include "Python.h" diff -Nru pyopengl-3.0.0~c1/tests/test_crash_on_glutinit.py pyopengl-3.0.0/tests/test_crash_on_glutinit.py --- pyopengl-3.0.0~c1/tests/test_crash_on_glutinit.py 2008-12-08 14:25:35.000000000 +1100 +++ pyopengl-3.0.0/tests/test_crash_on_glutinit.py 2009-02-17 14:23:01.000000000 +1100 @@ -1,6 +1,9 @@ if __name__ == "__main__": - from OpenGL.GLUT import * + from OpenGL.GLUT import * + from OpenGL.GL import * glutInit( ' ' ) - glutInitDisplayMode( GLUT_SINGLE ) + glutInitDisplayMode( GLUT_SINGLE ) + window = glutCreateWindow("hello") + glutDisplayFunc( lambda *args: 1 ) glutMainLoop() diff -Nru pyopengl-3.0.0~c1/tests/test_genframebuffers_twice.py pyopengl-3.0.0/tests/test_genframebuffers_twice.py --- pyopengl-3.0.0~c1/tests/test_genframebuffers_twice.py 2009-02-15 10:03:46.000000000 +1100 +++ pyopengl-3.0.0/tests/test_genframebuffers_twice.py 2009-02-17 06:50:21.000000000 +1100 @@ -6,14 +6,15 @@ # adapted from http://www.pygame.org/wiki/GLSLExample from OpenGL.GL.EXT.framebuffer_object import * def main(): - glutInit(0) - glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPTH) - glutCreateWindow('test') - framebuffer = glGenFramebuffersEXT(1) - print framebuffer - cow = glGenFramebuffersEXT(1) - print cow + glutInit(0) + glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPTH) + glutCreateWindow('test') + framebuffer = glGenFramebuffersEXT(1) + print type(framebuffer) + cow = glGenFramebuffersEXT(1) + print cow + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer) if __name__ == "__main__": - main() - + main() + diff -Nru pyopengl-3.0.0~c1/tests/tests.py pyopengl-3.0.0/tests/tests.py --- pyopengl-3.0.0~c1/tests/tests.py 2009-01-04 09:12:18.000000000 +1100 +++ pyopengl-3.0.0/tests/tests.py 2009-03-04 18:42:39.000000000 +1100 @@ -1,9 +1,16 @@ #! /usr/bin/env python import unittest, pygame, pygame.display, time, traceback + try: + raise ImportError( ) from numpy import * except ImportError, err: - from Numeric import * + try: + raise ImportError( ) + from Numeric import * + except ImportError, err: + array = None + pygame.display.init() from OpenGL.GL import * from OpenGL import constants, error @@ -113,76 +120,77 @@ 4, 4, GL_MAP2_VERTEX_3 ) GLU.gluEndSurface(theNurb) - def test_nurbs_raw_arrays( self ): - """Test nurbs rendering using raw API calls with arrays""" - from OpenGL.raw import GLU - import numpy - knots = numpy.array( ( 0,0,0,0,1,1,1,1 ), 'f' ) - ctlpoints = numpy.array( [[[-3., -3., -3.], - [-3., -1., -3.], - [-3., 1., -3.], - [-3., 3., -3.]], - - [[-1., -3., -3.], - [-1., -1., 3.], - [-1., 1., 3.], - [-1., 3., -3.]], - - [[ 1., -3., -3.], - [ 1., -1., 3.], - [ 1., 1., 3.], - [ 1., 3., -3.]], - - [[ 3., -3., -3.], - [ 3., -1., -3.], - [ 3., 1., -3.], - [ 3., 3., -3.]]], 'f' ) - theNurb = GLU.gluNewNurbsRenderer() - GLU.gluBeginSurface(theNurb) - GLU.gluNurbsSurface( - theNurb, - 8, knots, 8, knots, - 4 * 3, 3, ctlpoints , - 4, 4, GL_MAP2_VERTEX_3 - ) - GLU.gluEndSurface(theNurb) - def test_nurbs( self ): - """Test nurbs rendering""" - from OpenGL.raw import GLU - def buildControlPoints( ): - ctlpoints = zeros( (4,4,3), 'd') - for u in range( 4 ): - for v in range( 4): - ctlpoints[u][v][0] = 2.0*(u - 1.5) - ctlpoints[u][v][1] = 2.0*(v - 1.5); - if (u == 1 or u ==2) and (v == 1 or v == 2): - ctlpoints[u][v][2] = 3.0; - else: - ctlpoints[u][v][2] = -3.0; - return ctlpoints - controlPoints = buildControlPoints() - theNurb = GLU.gluNewNurbsRenderer()[0] - #theNurb = gluNewNurbsRenderer(); - gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); - gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); - knots= array ([0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], "d") - glPushMatrix(); - try: - glRotatef(330.0, 1.,0.,0.); - glScalef (0.5, 0.5, 0.5); - - gluBeginSurface(theNurb); + if array: + def test_nurbs_raw_arrays( self ): + """Test nurbs rendering using raw API calls with arrays""" + from OpenGL.raw import GLU + import numpy + knots = numpy.array( ( 0,0,0,0,1,1,1,1 ), 'f' ) + ctlpoints = numpy.array( [[[-3., -3., -3.], + [-3., -1., -3.], + [-3., 1., -3.], + [-3., 3., -3.]], + + [[-1., -3., -3.], + [-1., -1., 3.], + [-1., 1., 3.], + [-1., 3., -3.]], + + [[ 1., -3., -3.], + [ 1., -1., 3.], + [ 1., 1., 3.], + [ 1., 3., -3.]], + + [[ 3., -3., -3.], + [ 3., -1., -3.], + [ 3., 1., -3.], + [ 3., 3., -3.]]], 'f' ) + theNurb = GLU.gluNewNurbsRenderer() + GLU.gluBeginSurface(theNurb) + GLU.gluNurbsSurface( + theNurb, + 8, knots, 8, knots, + 4 * 3, 3, ctlpoints , + 4, 4, GL_MAP2_VERTEX_3 + ) + GLU.gluEndSurface(theNurb) + def test_nurbs( self ): + """Test nurbs rendering""" + from OpenGL.raw import GLU + def buildControlPoints( ): + ctlpoints = zeros( (4,4,3), 'd') + for u in range( 4 ): + for v in range( 4): + ctlpoints[u][v][0] = 2.0*(u - 1.5) + ctlpoints[u][v][1] = 2.0*(v - 1.5); + if (u == 1 or u ==2) and (v == 1 or v == 2): + ctlpoints[u][v][2] = 3.0; + else: + ctlpoints[u][v][2] = -3.0; + return ctlpoints + controlPoints = buildControlPoints() + theNurb = GLU.gluNewNurbsRenderer()[0] + #theNurb = gluNewNurbsRenderer(); + gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); + gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); + knots= array ([0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0], "d") + glPushMatrix(); try: - gluNurbsSurface( - theNurb, - knots, knots, - controlPoints, - GL_MAP2_VERTEX_3 - ); + glRotatef(330.0, 1.,0.,0.); + glScalef (0.5, 0.5, 0.5); + + gluBeginSurface(theNurb); + try: + gluNurbsSurface( + theNurb, + knots, knots, + controlPoints, + GL_MAP2_VERTEX_3 + ); + finally: + gluEndSurface(theNurb); finally: - gluEndSurface(theNurb); - finally: - glPopMatrix(); + glPopMatrix(); def test_errors( self ): """Test for error catching/checking""" try: @@ -378,16 +386,17 @@ ) finally: glEnd() - def test_numpyConversion( self ): - """Test that we can run a numpy conversion from double to float for glColorArray""" - import numpy - a = numpy.arange( 0,1.2, .1, 'd' ).reshape( (-1,3 )) - glEnableClientState(GL_VERTEX_ARRAY) - try: - glColorPointerf( a ) - glColorPointerd( a ) - finally: - glDisableClientState( GL_VERTEX_ARRAY ) + if array: + def test_numpyConversion( self ): + """Test that we can run a numpy conversion from double to float for glColorArray""" + import numpy + a = numpy.arange( 0,1.2, .1, 'd' ).reshape( (-1,3 )) + glEnableClientState(GL_VERTEX_ARRAY) + try: + glColorPointerf( a ) + glColorPointerd( a ) + finally: + glDisableClientState( GL_VERTEX_ARRAY ) def test_constantPickle( self ): """Test that our constants can be pickled/unpickled properly""" import pickle, cPickle @@ -479,22 +488,23 @@ """Test ALLOW_NUMPY_SCALARS to allow numpy scalars to be passed in""" textures = glGenTextures(2) glBindTexture( GL_TEXTURE_2D, textures[0] ) - def test_arrayTranspose( self ): - import numpy - m = glGetFloatv( GL_MODELVIEW_MATRIX ) - glMatrixMode( GL_MODELVIEW ) - glLoadIdentity() + if array: + def test_arrayTranspose( self ): + import numpy + m = glGetFloatv( GL_MODELVIEW_MATRIX ) + glMatrixMode( GL_MODELVIEW ) + glLoadIdentity() - t = eye(4) - t[3,0] = 20.0 + t = eye(4) + t[3,0] = 20.0 - # the following glMultMatrixf call ignored this transpose - t = t.T + # the following glMultMatrixf call ignored this transpose + t = t.T - glMultMatrixf( t ) + glMultMatrixf( t ) - m = glGetFloatv( GL_MODELVIEW_MATRIX ) - assert numpy.allclose( m[-1], [0,0,0,1] ), m + m = glGetFloatv( GL_MODELVIEW_MATRIX ) + assert numpy.allclose( m[-1], [0,0,0,1] ), m def test_glreadpixelsf( self ): """Issue #1979002 crash due to mis-calculation of resulting array size""" width,height = self.width, self.height @@ -508,64 +518,66 @@ readback_image1 = glReadPixels(0,0,width,height,GL_RGB, GL_BYTE) assert not isinstance( readback_image1, str ), type(readback_image2) - def test_mmap_data( self ): - """Test that we can use mmap data array - - If we had a reasonable lib that dumped raw image data to a shared-mem file - we might be able to use this for movie display :) - """ - fh = open( 'mmap-test-data.dat', 'w+' ) - fh.write( '\000'*(32*32*3+1)) - fh.flush() - fh.close() - # using numpy.memmap here... - data = memmap( 'mmap-test-data.dat' ) - for i in range( 0,255,2 ): - glDrawPixels( 32,32, GL_RGB, GL_UNSIGNED_BYTE, data, ) - glFlush() - pygame.display.flip() - data[::2] = i - time.sleep( 0.001 ) - - def test_vbo( self ): - """Test utility vbo wrapper""" - import numpy - from OpenGL.arrays import vbo - assert vbo.get_implementation() - dt = arraydatatype.GLdoubleArray - array = numpy.array( [ - [0,0,0], - [0,1,0], - [1,.5,0], - [1,0,0], - [1.5,.5,0], - [1.5,0,0], - ], dtype='d') - indices = numpy.array( - range(len(array)), - 'i', - ) - d = vbo.VBO(array) - glDisable( GL_CULL_FACE ) - glNormal3f( 0,0,1 ) - glColor3f( 1,1,1 ) - glEnableClientState(GL_VERTEX_ARRAY) - try: - for x in range( 1, 255, 10 ): - d.bind() - try: - glVertexPointerd( d ) - glDrawElements( GL_LINE_LOOP, len(indices), GL_UNSIGNED_INT, indices ) - finally: - d.unbind() - lastPoint = numpy.array( [[1.5,(1/255.) * float(x),0]] ) - d[-2:-1] = lastPoint + if array: + def test_mmap_data( self ): + """Test that we can use mmap data array + + If we had a reasonable lib that dumped raw image data to a shared-mem file + we might be able to use this for movie display :) + """ + fh = open( 'mmap-test-data.dat', 'w+' ) + fh.write( '\000'*(32*32*3+1)) + fh.flush() + fh.close() + # using numpy.memmap here... + data = memmap( 'mmap-test-data.dat' ) + for i in range( 0,255,2 ): + glDrawPixels( 32,32, GL_RGB, GL_UNSIGNED_BYTE, data, ) glFlush() pygame.display.flip() - glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT ) + data[::2] = i time.sleep( 0.001 ) - finally: - glDisableClientState( GL_VERTEX_ARRAY ) + + if array: + def test_vbo( self ): + """Test utility vbo wrapper""" + import numpy + from OpenGL.arrays import vbo + assert vbo.get_implementation() + dt = arraydatatype.GLdoubleArray + array = numpy.array( [ + [0,0,0], + [0,1,0], + [1,.5,0], + [1,0,0], + [1.5,.5,0], + [1.5,0,0], + ], dtype='d') + indices = numpy.array( + range(len(array)), + 'i', + ) + d = vbo.VBO(array) + glDisable( GL_CULL_FACE ) + glNormal3f( 0,0,1 ) + glColor3f( 1,1,1 ) + glEnableClientState(GL_VERTEX_ARRAY) + try: + for x in range( 1, 255, 10 ): + d.bind() + try: + glVertexPointerd( d ) + glDrawElements( GL_LINE_LOOP, len(indices), GL_UNSIGNED_INT, indices ) + finally: + d.unbind() + lastPoint = numpy.array( [[1.5,(1/255.) * float(x),0]] ) + d[-2:-1] = lastPoint + glFlush() + pygame.display.flip() + glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT ) + time.sleep( 0.001 ) + finally: + glDisableClientState( GL_VERTEX_ARRAY ) def test_fbo( self ): """Test that we support framebuffer objects @@ -639,7 +651,7 @@ glBlendColor( .3, .4, 1.0, .3 ) print 'OpenGL 1.2 support' def test_glmultidraw( self ): - """Test that glMultiDrawElements works, if supported on the hardware""" + """Test that glMultiDrawElements works, uses glDrawElements""" if glMultiDrawElements: points = [ (i,0,0) for i in range( 8 ) @@ -658,8 +670,6 @@ glVertexPointerd( points ) glDisable( GL_LIGHTING ) try: -# for i in range( 2 ): -# glDrawElements( GL_QUAD_STRIP, counts[i], GL_UNSIGNED_BYTE, indices[i] ) glMultiDrawElements(GL_QUAD_STRIP, counts, GL_UNSIGNED_BYTE, indices, 2) finally: glEnable( GL_LIGHTING ) @@ -676,7 +686,41 @@ try: glDrawBuffers( 2, args ) except GLError, err: - assert err.err == 1282, err + assert err.err == GL_INVALID_OPERATION, err + def test_glDrawBuffers_list_valid( self ): + """Test that glDrawBuffers with list argument where value is set""" + fbo = glGenFramebuffersEXT(1) + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo) + try: + img1,img2 = glGenTextures(2) + for img in img1,img2: + glBindTexture( GL_TEXTURE_2D, img ) + glTexImage2D( + GL_TEXTURE_2D, 0, GL_RGB8, + 300, 300, 0, GL_RGB, + GL_INT, + None # no data transferred + ) + + + glFramebufferTexture2DEXT( + GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, img1, 0 + ) + glFramebufferTexture2DEXT( + GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT1_EXT, + GL_TEXTURE_2D, img2, 0 + ) + drawingBuffers = [ + GL_COLOR_ATTACHMENT0_EXT, + GL_COLOR_ATTACHMENT1_EXT, + ] + glDrawBuffers(2, drawingBuffers ) + finally: + glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ) + def test_enable_histogram( self ): if glInitImagingARB(): glHistogram(GL_HISTOGRAM, 256, GL_LUMINANCE, GL_FALSE)