pysdl2

Will converting to PySDL2 make my app run faster than it does under PyGame?

拈花ヽ惹草 提交于 2019-12-25 09:48:48
问题 I've written a little toy in Python using Pygame. It generates critters (a circle with a directional line, not an image) to wander around the screen. I'm interested in making it more sophisticated, but I'm running into serious performance problems. As the number of critters on the screen passes 20, the frame rate drops rapidly from 60fps as far as 11fps with 50 on the screen. I've gone over my (very simple) code a number of different ways, even profiling with cProfile, without finding any way

Will converting to PySDL2 make my app run faster than it does under PyGame?

六眼飞鱼酱① 提交于 2019-12-25 09:48:07
问题 I've written a little toy in Python using Pygame. It generates critters (a circle with a directional line, not an image) to wander around the screen. I'm interested in making it more sophisticated, but I'm running into serious performance problems. As the number of critters on the screen passes 20, the frame rate drops rapidly from 60fps as far as 11fps with 50 on the screen. I've gone over my (very simple) code a number of different ways, even profiling with cProfile, without finding any way

Converting cv2 images to PySDL2 surfaces for blitting to screen

社会主义新天地 提交于 2019-12-24 14:32:10
问题 I'm using the new PySDL2 package, trying to interface it with my existing OpenCV code. I want to take an image captured from a webcam via the cv2 python interface to OpenCV and use PySDL2 to show it in a window on screen. I think I figured out how to convert the cv2 image format to a PySDL2 surface properly, but at the end of the code below, all I get is a black window. Any pointers on where I have gone awry would be greatly appreciated! #grab a frame from a webcam import cv2 vc = cv2

Trouble installing PySDL2 on Windows. (No module error)

一曲冷凌霜 提交于 2019-12-08 13:35:22
问题 So I tried to install pySDL2 just now, but I keep getting an error stating: No module named 'sdl2.util' I've followed the directions from the website, so I have no idea why this is not working. And I don't see anyone else asking this. 1: I downloaded: "PySDL2-0.9.2.zip" from BitBucket. 2: I unzipped the folder and moved the contents out. 3: I went to my command line, and then navigated to the directory containing the setup.py 4: I typed (As directed in the instructions): python setup.py