ScreenCaptureKit example in Go/C
I’m working on improving open source library to capture screenshots: https://github.com/kbinani/screenshot – it is somewhat popular and it uses legacy approach, and MacOS 15 (beta as of time of writing) already complains that “CGDisplayCreateImageForRect’ is unavailable: obsoleted in macOS 15.0”. So you can’t use it on macOS 15.0 – will not compile.