mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
CR feedback
This commit is contained in:
parent
c322317878
commit
160a5de271
21 changed files with 24 additions and 41 deletions
|
@ -2954,8 +2954,6 @@ void Application::loadSettings() {
|
|||
Menu::getInstance()->loadSettings();
|
||||
// If there is a preferred plugin, we probably messed it up with the menu settings, so fix it.
|
||||
auto pluginManager = PluginManager::getInstance();
|
||||
|
||||
|
||||
auto plugins = pluginManager->getPreferredDisplayPlugins();
|
||||
for (auto plugin : plugins) {
|
||||
auto menu = Menu::getInstance();
|
||||
|
@ -5192,7 +5190,6 @@ void Application::updateDisplayMode() {
|
|||
// FIXME probably excessive and useless context switching
|
||||
_offscreenContext->makeCurrent();
|
||||
|
||||
qDebug() << "Application::updateDisplayMode()... line:" << __LINE__ << "about to call newDisplayPlugin->activate()";
|
||||
bool active = newDisplayPlugin->activate();
|
||||
|
||||
if (!active) {
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <QtGui/QGuiApplication>
|
||||
#include <QtWidgets/QAction>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
||||
const QString Basic2DWindowOpenGLDisplayPlugin::NAME("Desktop");
|
||||
|
||||
static const QString FULLSCREEN = "Fullscreen";
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "NullDisplayPlugin.h"
|
||||
|
||||
#include <QtGui/QImage>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
||||
const QString NullDisplayPlugin::NAME("NullDisplayPlugin");
|
||||
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
//
|
||||
#pragma once
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include "DisplayPlugin.h"
|
||||
|
||||
class NullDisplayPlugin : public DisplayPlugin {
|
||||
ACCESS_PLUGIN_CONTAINER_MIXIN
|
||||
public:
|
||||
|
||||
virtual ~NullDisplayPlugin() final {}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <NumericalConstants.h>
|
||||
#include <DependencyManager.h>
|
||||
#include <shared/NsightHelpers.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <gl/Config.h>
|
||||
#include <gl/GLEscrow.h>
|
||||
#include <GLMHelpers.h>
|
||||
|
|
|
@ -21,14 +21,10 @@
|
|||
#include <gl/GLEscrow.h>
|
||||
#include <shared/RateCounter.h>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
||||
#define THREADED_PRESENT 1
|
||||
|
||||
class OpenGLDisplayPlugin : public DisplayPlugin {
|
||||
|
||||
ACCESS_PLUGIN_CONTAINER_MIXIN
|
||||
|
||||
protected:
|
||||
using Mutex = std::mutex;
|
||||
using Lock = std::unique_lock<Mutex>;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <QtWidgets/QWidget>
|
||||
|
||||
#include <GLMHelpers.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <CursorManager.h>
|
||||
#include <gl/GLWidget.h>
|
||||
#include <shared/NsightHelpers.h>
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#include "../OpenGLDisplayPlugin.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
class HmdDisplayPlugin : public OpenGLDisplayPlugin {
|
||||
using Parent = OpenGLDisplayPlugin;
|
||||
public:
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "SideBySideStereoDisplayPlugin.h"
|
||||
#include <GLMHelpers.h>
|
||||
#include <CursorManager.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <gl/GLWidget.h>
|
||||
#include "../CompositorHelper.h"
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <ViewFrustum.h>
|
||||
#include <MatrixStack.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <gl/GLWidget.h>
|
||||
#include <CursorManager.h>
|
||||
#include "../CompositorHelper.h"
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
|
||||
QString Plugin::UNKNOWN_PLUGIN_ID("unknown");
|
||||
|
||||
void Plugin::setContainer(PluginContainer* container) {
|
||||
_container = container;
|
||||
}
|
||||
|
||||
bool Plugin::isSupported() const { return true; }
|
||||
|
||||
void Plugin::init() {}
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
#include "Forward.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
class Plugin : public QObject {
|
||||
public:
|
||||
/// \return human-readable name
|
||||
|
@ -30,11 +28,8 @@ public:
|
|||
virtual const QString& getID() const { assert(false); return UNKNOWN_PLUGIN_ID; }
|
||||
|
||||
virtual bool isSupported() const;
|
||||
|
||||
/// Some plugins may need access to the PluginContainer, if the individual plugin
|
||||
/// needs access to this, they should override these methods and store their own
|
||||
/// type safe version of the pointer to the container.
|
||||
virtual void setContainer(void* container) { }
|
||||
|
||||
void setContainer(PluginContainer* container);
|
||||
|
||||
/// Called when plugin is initially loaded, typically at application start
|
||||
virtual void init();
|
||||
|
@ -70,5 +65,7 @@ public:
|
|||
|
||||
protected:
|
||||
bool _active { false };
|
||||
PluginContainer* _container { nullptr };
|
||||
static QString UNKNOWN_PLUGIN_ID;
|
||||
|
||||
};
|
||||
|
|
|
@ -133,10 +133,8 @@ const DisplayPluginList& PluginManager::getDisplayPlugins() {
|
|||
}
|
||||
}
|
||||
for (auto plugin : displayPlugins) {
|
||||
plugin->setContainer(_container);
|
||||
plugin->init();
|
||||
if (_container) {
|
||||
plugin->setContainer(_container);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -172,10 +170,8 @@ const InputPluginList& PluginManager::getInputPlugins() {
|
|||
}
|
||||
|
||||
for (auto plugin : inputPlugins) {
|
||||
plugin->setContainer(_container);
|
||||
plugin->init();
|
||||
if (_container) {
|
||||
plugin->setContainer(_container);
|
||||
}
|
||||
}
|
||||
});
|
||||
return inputPlugins;
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
void disableDisplays(const QStringList& displays);
|
||||
void disableInputs(const QStringList& inputs);
|
||||
void saveSettings();
|
||||
void setContainer(void* container) { _container = container; }
|
||||
void setContainer(PluginContainer* container) { _container = container; }
|
||||
private:
|
||||
void* _container { nullptr };
|
||||
PluginContainer* _container { nullptr };
|
||||
};
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
//
|
||||
#pragma once
|
||||
|
||||
#include <assert.h>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QPair>
|
||||
|
@ -87,11 +85,3 @@ protected:
|
|||
QRect _savedGeometry { 10, 120, 800, 600 };
|
||||
};
|
||||
|
||||
/// Mixin this class to your class to get easy access to the PluginContainer
|
||||
#define ACCESS_PLUGIN_CONTAINER_MIXIN \
|
||||
public: \
|
||||
virtual void setContainer(void* container) override { \
|
||||
_container = static_cast<PluginContainer*>(container); \
|
||||
} \
|
||||
protected: \
|
||||
PluginContainer* _container { nullptr };
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <NumericalConstants.h>
|
||||
#include <PathUtils.h>
|
||||
#include <PerfStat.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <SettingHandle.h>
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <controllers/InputDevice.h>
|
||||
#include <controllers/StandardControls.h>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <plugins/InputPlugin.h>
|
||||
|
||||
struct _sixenseControllerData;
|
||||
|
@ -25,7 +24,6 @@ using SixenseControllerData = _sixenseControllerData;
|
|||
|
||||
// Handles interaction with the Sixense SDK (e.g., Razer Hydra).
|
||||
class SixenseManager : public InputPlugin {
|
||||
ACCESS_PLUGIN_CONTAINER_MIXIN
|
||||
Q_OBJECT
|
||||
public:
|
||||
// Plugin functions
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <gl/OglplusHelpers.h>
|
||||
#include <ViewFrustum.h>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include "OculusHelpers.h"
|
||||
|
||||
using namespace oglplus;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <gl/GlWindow.h>
|
||||
|
||||
#include <PerfStat.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <ViewFrustum.h>
|
||||
#include <shared/NsightHelpers.h>
|
||||
#include "OpenVrHelpers.h"
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <gpu/Context.h>
|
||||
#include <DeferredLightingEffect.h>
|
||||
#include <NumericalConstants.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
#include <UserActivityLogger.h>
|
||||
|
||||
#include <controllers/UserInputMapper.h>
|
||||
|
|
|
@ -23,14 +23,12 @@
|
|||
#include <plugins/InputPlugin.h>
|
||||
#include <RenderArgs.h>
|
||||
#include <render/Scene.h>
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
||||
namespace vr {
|
||||
class IVRSystem;
|
||||
}
|
||||
|
||||
class ViveControllerManager : public InputPlugin {
|
||||
ACCESS_PLUGIN_CONTAINER_MIXIN
|
||||
class ViveControllerManager : public InputPlugin {
|
||||
Q_OBJECT
|
||||
public:
|
||||
// Plugin functions
|
||||
|
|
Loading…
Reference in a new issue