src/App.cpp
// returns refresh rate of highest refresh rate display on the computer
returns refresh rate of highest refresh rate display on the computer
returns refresh rate of highest refresh rate display on the computer
static int GetHighestRefreshRateDisplay()
{
    int numDisplays = SDL_GetNumVideoDisplays();
    if (numDisplays < 1)
    {
        return 60;  
    }
    int highestRefreshRate = 30;
    SDL_DisplayMode modeStruct{};
    for (int display = 0; display < numDisplays; ++display)
    {
        int numModes = SDL_GetNumDisplayModes(display);
        for (int mode = 0; mode < numModes; ++mode)
        {
            SDL_GetDisplayMode(display, mode, &modeStruct);
            highestRefreshRate = std::max(highestRefreshRate, modeStruct.refresh_rate);
        }
    }
    return highestRefreshRate;
}
static int GetHighestRefreshRateDisplay ( ) { int numDisplays = SDL_GetNumVideoDisplays ( ) ; if ( numDisplays < 1 ) { return 60 ; } int highestRefreshRate = 30 ; SDL_DisplayMode modeStruct { } ; for ( int display = 0 ; display < numDisplays ; ++ display ) { int numModes = SDL_GetNumDisplayModes ( display ) ; for ( int mode = 0 ; mode < numModes ; ++ mode ) { SDL_GetDisplayMode ( display , mode , & modeStruct ) ; highestRefreshRate = std :: max ( highestRefreshRate , modeStruct . refresh_rate ) ; } } return highestRefreshRate ; }
returns refresh rate of highest refresh rate display on the computer
returns refresh rate of highest refresh rate display on the computer
// this should be impossible but, you know, coding.