SDL 3 officially released in January, and since then I've been working on wrapping its cross-platform webcam/camera functionality into a single easy-to-use PureBasic includefile!
There were some camera bugfixes and improvements in SDL 3.2.6 released a few days ago, so now I'm ready to share version 1.0 of my code. Testers and feedback welcome! I've been testing it on both Windows and Linux. Should work on Mac too.
PBWebcam project on GitHub
https://github.com/kenmo-pb/PBWebcam
See the front page README and its links. You need three things:
1. Get my
SDL3.pbi
2. Get my PBWebcam.pbi - I recommend you just download or clone the repo
3. Get SDL3 for your OS... this is a DLL on Windows, a .so on Linux, etc. You don't need the "devel" package.
Then run "Demo" which lets you choose between your cameras and specs, or "SimplerDemo" to immediately get a webcam view with no configuration. You can have a live webcam in a CanvasGadget in just a few lines of added code!
More about SDL / SDL3... it's great!
https://libsdl.org/
https://github.com/libsdl-org/SDL
Partager