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

Method ListResolutions

engine/PoseidonGL33/EngineGL33_Lifecycle.cpp:926–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

924}
925
926void EngineGL33::ListResolutions(FindArray<ResolutionInfo>& ret)
927{
928 ret.Clear();
929 if (_windowed)
930 return;
931
932 SDL_DisplayID display = _sdlWindow ? SDL_GetDisplayForWindow(_sdlWindow) : SDL_GetPrimaryDisplay();
933 if (!display)
934 return;
935
936 int count = 0;
937 SDL_DisplayMode** modes = SDL_GetFullscreenDisplayModes(display, &count);
938 if (!modes)
939 return;
940
941 for (int i = 0; i < count; i++)
942 {
943 ResolutionInfo info;
944 info.w = modes[i]->w;
945 info.h = modes[i]->h;
946 info.bpp = SDL_BITSPERPIXEL(modes[i]->format);
947 ret.AddUnique(info);
948 }
949 SDL_free(modes);
950}
951
952void EngineGL33::ListRefreshRates(FindArray<int>& ret)
953{

Callers

nothing calls this directly

Calls 2

ClearMethod · 0.45
AddUniqueMethod · 0.45

Tested by

no test coverage detected