The Buffer object is simply a block of memory that is delineated and initialized by the user. Many OpenGL functions return data to a C-style pointer, however, because this is not possible in python the Buffer object can be used to this end. Wherever pointer notation is used in the OpenGL functions the Buffer object can be used in it's BGL wrapper. In some instances the Buffer object will need to be initialized with the template parameter, while in other instances the user will want to create just a blank buffer which will be zeroed by default. Example with Buffer:: import Blender from Blender import BGL myByteBuffer = BGL.Buffer(BGL.GL_BYTE, [32,32]) BGL.glGetPolygonStipple(myByteBuffer) print myByteBuffer.dimensions print myByteBuffer.list sliceBuffer = myByteBuffer[0:16] print sliceBuffer @ivar list: The contents of the Buffer. @ivar dimensions: The size of the Buffer.
Public Member Functions