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

Method GetCurrentMonitor

engine/PoseidonGL33/EngineGL33_Lifecycle.cpp:806–825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806int EngineGL33::GetCurrentMonitor() const
807{
808 if (!_sdlWindow)
809 return 0;
810 SDL_DisplayID id = SDL_GetDisplayForWindow(_sdlWindow);
811 int count = 0;
812 SDL_DisplayID* displays = SDL_GetDisplays(&count);
813 int idx = 0;
814 if (displays)
815 {
816 for (int i = 0; i < count; ++i)
817 if (displays[i] == id)
818 {
819 idx = i;
820 break;
821 }
822 SDL_free(displays);
823 }
824 return idx;
825}
826
827bool EngineGL33::SwitchMonitor(int idx)
828{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected