pixel buffer offset with glDrawPixels

Josh Blum <[email protected]> Thu, 31 Jul 2008 16:32:27 -0700
Newsgroups gmane.comp.python.opengl.devel
Message-ID <[email protected]>
I am using glDrawPixels to draw from a pixel buffer object:

----------------------------
#draw bottom portion
glPixelZoom(x_zoom, -y_zoom)
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, self._waterfall_buffer_bottom)
glDrawPixels(self._fft_size, self._frame_ptr, GL_RGBA, GL_UNSIGNED_BYTE, 
None)
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0) #unbind
-----------------------------

Currently, the data is set to None and the pixel buffer is drawn with a 
zero byte offset. According to the glDrawPixels docs:

"""If a non-zero named buffer object is bound to the 
GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer) while a block of pixels 
is specified, data is treated as a byte offset into the buffer object's 
data store."""

How can I specify an offset into my pixel buffer in python?

-Josh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net