Obviously many games support changing the screen resolution during runtime via some sort of option menu. I'm also aware that many of these games access the screen resolutions your graphics card is compatible with and displays them in said option menu. How might I implement such a system in a game of my own (using SDL2)? If it is of any relevance, my language of choice is C++.
-Example image taken from Terraria (one of my all time favorites)