The flickering is due to your use of sub-pixel positioning. Because
the images aren't perfectly aligned with pixels the image border is
used by OpenGL in rendering.
The difference in loading techniques is the resource module loads the
images into shared textures whereas the image module loads each image
into its own texture. The border in the former may include the
neighbouring image whereas the border for the latter will typically be
black.
Richard
On 17 May 2011 03:32, paeron <[email protected]> wrote:
> I solved it.
>
> Had something to do with how I loaded my images.
>
> When I load like this: pyglet.resource.image('assets/textures/
> grass.png') it flickers.
>
> This works like a charm: pyglet.image.load('assets/textures/
> grass.png').
>
> Don't know why I used pyglet.resource.image since I've used
> pyglet.image.load in my other projects. Probably something I found on
> the internet.
>
> I'll go check the documentation for more info.
>
> On 15 Maj, 15:50, paeron <[email protected]> wrote:
>> Hey!
>>
>> I have a problem while using a camera class like this:
>> glMatrixMode(GL_MODELVIEW)
>> glLoadIdentity()
>> gluLookAt(self.x, self.y, +1.0,
>> self.x, self.y, -1.0,
>> 0.0, 1.0, 0.0)
>>
>> The position is following my playersprite.
>>
>> Whenever the camera moves it causes my mapsprites to flicker with
>> black lines around its borders.
>>
>> Any solution?
>
> --
> 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.
>
>
--
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.