On Fri, Oct 24, 2008 at 1:35 PM, Asacolips <[EMAIL PROTECTED]> wrote:
> I've been messing around with Pyglet and Cocos, and I was wondering
> how to have a window, fullscreen or otherwise, not get filtered.  What
> I mean by this is scaling it by a method other than bilinear
> filtering.  I know that it should be possible, as I've seen it done in
> the Pyglet example "fixed_resolution.py" but I'm not sure where or how
> I would implement that in Cocos.  I'm relatively sure it would go in
> the director, but again I'm not sure.

The key is to set the following for each texture you wish to be magnified:

            from pyglet.gl import *

            image = pyglet.resource.image('filename')
            glTexParameteri(image.texture.target,
                GL_TEXTURE_MAG_FILTER, GL_NEAREST)
            glTexParameteri(image.texture.target,
                GL_TEXTURE_MIN_FILTER, GL_NEAREST)

The default setting is GL_LINEAR, which bilinearly interpolates
texture cells to obtain the image you see on screen.


     Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" 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/cocos-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to