I'm trying to use glReadPixels to get the resulting color of the
transparent polygons and it appears that:

        p = (self.f.height*self.f.width*gl.POINTER(gl.GLvoid))()
        gl.glReadPixels(self.f.width, 0, self.f.width, self.f.height,
gl.GL_RGBA, gl.GL_UNSIGNED_BYTE, p)

is the correct way to call this(thank god for a semester of C++), and
p appears to be an array with the some data afterwords, however I'm
not quite sure what format it's in.  What I'd like is to eventually
have a tuple of (R, G, B, A), however I'm not quite sure how to get
the that point because each item in the array appears to be an int,
and I don't have a clue how I would get the components out of that.

Thanks for all your help,
Alex

On Dec 14, 6:31 pm, Alex_Gaynor <[email protected]> wrote:
> Looks like you're right.  I guess I was just using bad colors to see
> the blending.  Now I guess I have to actually work on my application
> logic since I understand OpenGL a little better.  Thanks for all the
> help.
>
> Alex
>
> On Dec 14, 6:24 pm, "Alex Holkner" <[email protected]> wrote:
>
> > On Mon, Dec 15, 2008 at 10:54 AM, Alex_Gaynor <[email protected]> wrote:
>
> > > Right now I have:
> > >        gl.glEnable(gl.GL_BLEND)
> > >        gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
>
> > > Which I believe makes sense for what I want, however I believe either
> > > the values I'm using for alpha don't make sense, or a problem is being
> > > caused by having a black background behind what I have there, does
> > > that make sense?
>
> > Seems to work for me -- if you offset your polygon so that it overlaps
> > the image you can see the blending; alternatively, adjusting the alpha
> > value changes the color (less blending with black).
>
> > Alex.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to