I have a group for pixel graphics which should have alpha transparency
but should be scaled with nearest neighbour so they don't blur. In my
program a single instance of this group with a single child, an
instance of a transformation group (uses rotate/translate/scale etc)
which has several children OrderedGroup and each of those children has
a child TextureGroup of a particular texture.
The PixelGraphicGroup used to be used as the child of the TextureGroup
and worked fine. Because it's the same state for all the graphics in
the group I decided to move it to be the root of the tree. Now it
doesn't work. Commenting out blend enabling has the expected effect,
but the mag/min filters don't appear to affect it anymore. What am I
doing wrong?
class PixelGraphicGroup(Group):
def set_state(self):
gl.glPushAttrib(gl.GL_COLOR_BUFFER_BIT | gl.GL_TEXTURE_BIT)
gl.glEnable(gl.GL_BLEND)
gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
gl.glTexParameterf(gl.GL_TEXTURE_2D,
gl.GL_TEXTURE_MAG_FILTER,
gl.GL_NEAREST)
gl.glTexParameterf(gl.GL_TEXTURE_2D,
gl.GL_TEXTURE_MIN_FILTER,
gl.GL_NEAREST)
def unset_state(self):
gl.glPopAttrib()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---