From bbef07172349a785a9fc7913cf981f494db515ee Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 1 Nov 2016 16:23:53 -0700 Subject: [PATCH] Update interface to default to HMD display plugin --- interface/src/Application.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5fe15fa8e5..f4596f5ea2 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5669,13 +5669,22 @@ void Application::updateDisplayMode() { standard.insert(std::end(standard), std::begin(advanced), std::end(advanced)); standard.insert(std::end(standard), std::begin(developer), std::end(developer)); + DisplayPluginPointer defaultDisplayPlugin; + + // Default to the first HMD plugin, otherwise use the first in the list. + auto hmdPluginIt = find_if(standard.begin(), standard.end(), [](DisplayPluginPointer& plugin) { return plugin->isHmd(); }); + if (hmdPluginIt != standard.end()) { + defaultDisplayPlugin = *hmdPluginIt; + } else if (standard.size() > 0) { + defaultDisplayPlugin = standard[0]; + } + foreach(auto displayPlugin, standard) { - addDisplayPluginToMenu(displayPlugin, first); + addDisplayPluginToMenu(displayPlugin, displayPlugin.get() == defaultDisplayPlugin.get()); auto displayPluginName = displayPlugin->getName(); QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) { resizeGL(); }); - first = false; } // after all plugins have been added to the menu, add a separator to the menu