On Nov 20, 3:29 am, Andreas Schiefer <[email protected]>
wrote:
> I'm not quite sure, but the implementation may use the
> ARB_texture_rectangle extension for non-power of 2 textures. This extension
> specifies texture coordinates to be pixel based/non-normalized.
> So I guess the pixel based texture coordinates for non-power of 2 textures
> are probably intentional (to conform with the extension).
> Note that such textures do not support mipmap filtering (if you need that).

That is what it is doing.

Do you have any idea why this works:

...
self.tileAtlas = pyglet.image.atlas.TextureAtlas(1025,1025)  #non po2
... add some 16x16 images

glEnable(self.tileAtlas.texture.target)
glBindTexture(self.tileAtlas.texture.target,
self.tileAtlas.texture.id)
glBegin(GL_QUADS)
glTexCoord2i(0,0)
glVertex3i(0,0,0)
glTexCoord2i(1025,0)
glVertex3i(1025,0,0)
glTexCoord2i(1025,1025)
glVertex3i(1025,1025,0)
glTexCoord2i(0,1025)
glVertex3i(0,1025,0)
glEnd()

and displays the whole texture on the screen.

But this does not work:

...
self.tileAtlas = pyglet.image.atlas.TextureAtlas(1024,1024)  #po2
... add some 16x16 images

glEnable(self.tileAtlas.texture.target)
glBindTexture(self.tileAtlas.texture.target,
self.tileAtlas.texture.id)
glBegin(GL_QUADS)
glTexCoord2f(0.0, 0.0)
glVertex3f(0,0.0, 0.0)
glTexCoord2f(1.0, 0.0)
glVertex3f(1.0, 0.0, 0.0)
glTexCoord2f(1.0 ,1.0)
glVertex3f(1.0, 1.0, 0.0)
glTexCoord2f(0.0, 1.0)
glVertex3f(0.0, 1.0, 0.0)
glEnd()

If I add:

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();

before the glBegin, it does display the texture, but almost freezes my
video and it gets about .01 fps.

-- 
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