static const VideoModeList & GetSupportedModes() { static VideoModeList vml; if ( vml.empty() ) { GLFWvidmode modes[256]; int count = glfwGetVideoModes(modes, 256); vml.reserve(count); for (int i = 0; i < count; ++i) { VideoMode vm; vm.width = modes[i].Width; vm.height = modes[i].Height; vm.red_bits = modes[i].RedBits; vm.green_bits = modes[i].GreenBits; vm.blue_bits = modes[i].BlueBits; vml.push_back(vm); } } return vml; }