python - Can I add pygame events from a second thread -
Well I have read in different places that the pygame event should be handled in the main thread. I want to do this but my question is, can I add events to a different thread in the event queue?
I want to call from EDIT: To clarify, I will run a separate thread for asynchronous network I / O when a new message reaches the thread then there will be something to signal to an event in the event queue. Time for some spy work! Looking at the source for This function thread is secure, and can be safely said with another thread. It seems that this is actually a safe thread. pygame.event.post (myEvent) instead of handling the incident in a separate thread and main loop. Is this possible?
event_post , indicates that the C function uses SDL calls
SDL_PushEvent , without checking thread for self-protection However, for this, the documentation says:
Comments
Post a Comment