This is a simple tactic for creating a full-window fade effect using SDL2 - Simple DirectMedia Layer 2.
Creating a fade effect is easy using a single SDL Rect that covers the entire window. You can alter the alpha value when calling SDL's SetRenderDrawColor() function before calling RenderFillRect(). Using animation keyframes, you can gradually increase and decrease the alpha value to get the desired fade.
You can view the completed code at this commit :: https://github.com/patrickodacre/odin-space-shooter/commit/d1a92b15c62218e92caf4c7e68b6d29a14c7a5cf
Download
0 formats
No download links available.
Fade Effect using SDL2 and the Odin Programming Language | NatokHD