Re: Help: glReadPixels error on OS X

Ian Mallett <[email protected]> Thu, 23 May 2013 07:15:47 -0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG4NV=t1NHSYUdamPSCazbH8t8XZpVS-04vi2hrSkTJDJUrfOg@mail.gmail.com>
On Wed, May 22, 2013 at 6:38 PM, Hugo H <[email protected]> wrote:

> Hello all,
>
> I am facing an issue with using glReadPixels returning a <c_byte_Array>
> object instead of the expected string.
>
> Is this a bug ? Any idea how to get the pixel's value ?
>
> Thank you in advance !
> Greetz,
>
> Hugo
>
Instead of:
pixel = ord(pixel[0]), ord(pixel[1]), ord(pixel[2])
Try this:
pixel = pixel[0][0][0],pixel[1][0][0],pixel[2][0][0]
Python 3 handles strings much differently from Python 2. I suspect PyOpenGL
was changed, intentionally, to make this string functionality consistent
across Python versions.
Ian

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users