SDL_Renderer get access to framebuffer as a `uint32_t *`

by Safal Aryal   Last Updated April 16, 2018 08:13 AM - source

I am making my first foray into SDL. To do this, I would like to have direct access to the framebuffer on the window as a uint32_t *. This is because I have to pass this framebuffer to another file that my friend wrote which only accepts raw framebuffers like this one. I know that to write pixels you have to set up an SDL_Renderer but here I want direct access to the raw framebuffer. How would I do this using only SDL2?

Related Questions

Game Loop delay the right way and game speed

Updated February 20, 2017 20:13 PM

Use default framebuffer depth buffer in a fbo

Updated December 10, 2018 12:13 PM