MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ListRefreshRates

Method ListRefreshRates

engine/PoseidonGL33/EngineGL33_Lifecycle.cpp:952–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

950}
951
952void EngineGL33::ListRefreshRates(FindArray<int>& ret)
953{
954 ret.Clear();
955 if (_windowed)
956 {
957 ret.Add(0);
958 return;
959 }
960
961 SDL_DisplayID display = _sdlWindow ? SDL_GetDisplayForWindow(_sdlWindow) : SDL_GetPrimaryDisplay();
962 if (!display)
963 return;
964
965 int count = 0;
966 SDL_DisplayMode** modes = SDL_GetFullscreenDisplayModes(display, &count);
967 if (!modes)
968 return;
969
970 for (int i = 0; i < count; i++)
971 {
972 if (modes[i]->w == Width() && modes[i]->h == Height())
973 {
974 int hz = static_cast<int>(modes[i]->refresh_rate);
975 ret.AddUnique(hz);
976 }
977 }
978 SDL_free(modes);
979}
980
981void EngineGL33::DestroySurfaces()
982{

Callers

nothing calls this directly

Calls 5

WidthFunction · 0.85
HeightFunction · 0.85
ClearMethod · 0.45
AddMethod · 0.45
AddUniqueMethod · 0.45

Tested by

no test coverage detected