Hello,

I'm trying to do some pixelated graphics with pyglet and I'd love to use
the Sprite classes. Basically when the window is resized, the graphics
are scaled without any kind of aliasing/smoothing.

I'm not an opengl expert, but looks like it as easy as using
glTexParameteri to setup mag and min texture filters to GL_NEAREST.

Unfortunately it doesn't look like a simple task to do it with pyglet's
Sprites because the SpriteGroup will set the opengl state and it doesn't
support such filters (it supports blend src/dest parameters though).

The easiest way would be just patch Pyglet and move on, because I can't
seem to get it right providing a group to the Sprite class.

Instead I got it working with this:

https://gist.github.com/reidrac/9874610

I'm not completely sure I'm doing the right thing!

Ideally I would add this to the Sprite class with two new parameters:

 - mag_filer, defaults to GL_LINEAR
 - min_filer, defaults to GL_LINEAR

and both parameters will be made available for SpriteGroup to use them
in the set_state method (in the same way the blend parameters are
already in use).

I wish my opengl-fu was better so any comment will be very appreciated!

Regards,

Juan

-- 
jjm's home: http://www.usebox.net/jjm/
blackshell: http://blackshell.usebox.net/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to