Fade Effect using SDL2 and the Odin Programming Language
Handmade Games
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 ... https://www.youtube.com/watch?v=B0CpkLW0p7Q
2023-01-14
0.0 LBC
Copyrighted (contact publisher)
33119182 Bytes