How to display an in-memory framebuffer
Have you considered using SDL 2?
My use-case is basically identical to yours, and I've found this approach to work really well. They have a really nice C (and C++) API for drawing framebuffers to a window. It's also platform-agnostic, so you can share your implementation fairly easily between macOS, Linux and Windows.
If you want to see an example, you can go check out this module here on GitHub. I do warn you though, while this implementation works, and I can easily run it at 60-120FPS, it likely does use more CPU than a fully optimised implementation.
Specifically observe the initDisplay() and drawWindow() functions.