MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getDisplayIndex

Function getDisplayIndex

src/OpenLoco/src/Ui.cpp:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 static uint32_t getDisplayIndex(SDL_DisplayID displayId)
100 {
101 int32_t numDisplays = 0;
102 auto displayIds = SDL_GetDisplays(&numDisplays);
103 if (displayIds == nullptr || numDisplays <= 0)
104 {
105 return 0;
106 }
107
108 uint32_t displayIndex = 0;
109 for (int32_t i = 0; i < numDisplays; i++)
110 {
111 if (displayIds[i] == displayId)
112 {
113 displayIndex = i;
114 break;
115 }
116 }
117
118 SDL_free(displayIds);
119 return displayIndex;
120 }
121
122 static Config::Resolution getSaneWindowedResolution(uint32_t displayIndex, Config::Resolution preferredResolution)
123 {

Callers 2

windowPositionChangedFunction · 0.85
getDesktopResolutionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected