Pyglet window contents flickering badly

181 views
Skip to first unread message

Mike Finister

unread,
Apr 30, 2020, 4:14:37 PM4/30/20
to pyglet-users
Trying to use Pyglet as a UI framework for an app I’m working on.  Already got Pygame working as a lightweight UI front end that takes all the co-ordinate, rotation data from my games engine.

Tried Pyglet and got sprites to show on screen but when using a batch to draw the contents flickers a lot and I mean a lot

Tried to set the background to be white using the .gl package but this meant it was flickering between black and white and I cannot see why.

The UI as I said is lightweight only and wanted to try Pyglet because smoother graphics then Pygame when it comes to rotating sprites

So looking for pointers - I’m subclassing Window, scheduling the update and drawing in on_draw with a self.clear first because I cannot see how to only clear the space of the sprite as Pygame does.

Any help very much appreciated 

Charles M

unread,
Apr 30, 2020, 4:28:16 PM4/30/20
to pyglet...@googlegroups.com
Can you post a simple example showing the issue? 

--
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 pyglet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyglet-users/6603b5ec-bdb6-425e-8cbb-3e1605574c7c%40googlegroups.com.

Mike Finister

unread,
Apr 30, 2020, 4:48:06 PM4/30/20
to pyglet-users
I've attached two video captures - first shows using Pygame as UI - second is Pyglet - basically got to creating and adding sprites to a batch and using the batch.draw method.

Can't understand why there is any flickering at all aside from having to use self.clear() to clear the window's contents - but still would have expected it to be smoother

Links to videos here (hope it works - don't use Google drive much anymore)




On Thursday, 30 April 2020 21:28:16 UTC+1, Charles M wrote:
Can you post a simple example showing the issue? 

On Thu, Apr 30, 2020, 3:14 PM 'Mike Finister' via pyglet-users <pyglet...@googlegroups.com> wrote:
Trying to use Pyglet as a UI framework for an app I’m working on.  Already got Pygame working as a lightweight UI front end that takes all the co-ordinate, rotation data from my games engine.

Tried Pyglet and got sprites to show on screen but when using a batch to draw the contents flickers a lot and I mean a lot

Tried to set the background to be white using the .gl package but this meant it was flickering between black and white and I cannot see why.

The UI as I said is lightweight only and wanted to try Pyglet because smoother graphics then Pygame when it comes to rotating sprites

So looking for pointers - I’m subclassing Window, scheduling the update and drawing in on_draw with a self.clear first because I cannot see how to only clear the space of the sprite as Pygame does.

Any help very much appreciated 

--
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 pyglet...@googlegroups.com.

Charles M

unread,
Apr 30, 2020, 6:30:15 PM4/30/20
to pyglet...@googlegroups.com
Sorry, I should have been more specific. Can you post the code to cause this behavior? 

To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyglet-users/5aa37608-35d0-4ae6-a86d-27be9f3b6089%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages