I've tried several approaches to run pyglet in parallel with the executing
code. One (partially) successful solution was to simply run pyglet-related
stuff into a mutliprocessing.Process and communicating using a sync
primitive such as a Queue. The problem I'm having is that this approach
doesn't play nicely with all the drivers, a test code like the following,
works nicely on 'radeon' open source drivers, but it doesn't work on
proprietary nvidia drivers (the subprocess sort-of crashes at line 6). If I
remove the call to Batch (or any other opengl-related call) it works with
both video cards/drivers. Do you think there's an explanation for this? I'd
prefer avoiding to restrict all references to opengl in just one process
the reason is that I basically cache shaders in the main process. I was
wondering if there exist some way to prevent this kind of problems.
--------------------------
import pyglet
import multiprocessing
b = pyglet.graphics.Batch()
def inprocess():
w = pyglet.window.Window()
pyglet.app.run()
p = multiprocessing.Process(target=inprocess)
p.start()
p.join()
---------------------------
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pyglet-users/-/SOjRn2XTbF8J.
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.