mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
add fullscreen menu item and rename side by side stereo plugin
This commit is contained in:
parent
7fb491e48c
commit
62e8ec3fdf
3 changed files with 30 additions and 4 deletions
|
@ -13,8 +13,8 @@
|
|||
|
||||
const QString Basic2DWindowOpenGLDisplayPlugin::NAME("2D Display");
|
||||
|
||||
const QString MENU_PATH = "Display";
|
||||
const QString FULLSCREEN = "Fullscreen";
|
||||
static const QString MENU_PATH = "Display";
|
||||
static const QString FULLSCREEN = "Fullscreen";
|
||||
|
||||
const QString& Basic2DWindowOpenGLDisplayPlugin::getName() const {
|
||||
return NAME;
|
||||
|
|
|
@ -10,14 +10,19 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
|
||||
#include <GlWindow.h>
|
||||
#include <ViewFrustum.h>
|
||||
#include <MatrixStack.h>
|
||||
|
||||
#include <gpu/GLBackend.h>
|
||||
#include <plugins/PluginContainer.h>
|
||||
|
||||
const QString SideBySideStereoDisplayPlugin::NAME("Debug Stereo Display");
|
||||
const QString SideBySideStereoDisplayPlugin::NAME("3D TV - Side by Side Stereo");
|
||||
|
||||
static const QString MENU_PATH = "Display";
|
||||
static const QString FULLSCREEN = "Fullscreen";
|
||||
|
||||
const QString & SideBySideStereoDisplayPlugin::getName() const {
|
||||
return NAME;
|
||||
|
@ -26,3 +31,20 @@ const QString & SideBySideStereoDisplayPlugin::getName() const {
|
|||
SideBySideStereoDisplayPlugin::SideBySideStereoDisplayPlugin() {
|
||||
}
|
||||
|
||||
void SideBySideStereoDisplayPlugin::activate() {
|
||||
CONTAINER->addMenu(MENU_PATH);
|
||||
CONTAINER->addMenuItem(MENU_PATH, FULLSCREEN,
|
||||
[this](bool clicked) {
|
||||
if (clicked) {
|
||||
CONTAINER->setFullscreen(getFullscreenTarget());
|
||||
} else {
|
||||
CONTAINER->unsetFullscreen();
|
||||
}
|
||||
}, true, false);
|
||||
StereoDisplayPlugin::activate();
|
||||
}
|
||||
|
||||
// FIXME target the screen the window is currently on
|
||||
QScreen* SideBySideStereoDisplayPlugin::getFullscreenTarget() {
|
||||
return qApp->primaryScreen();
|
||||
}
|
||||
|
|
|
@ -9,11 +9,15 @@
|
|||
|
||||
#include "StereoDisplayPlugin.h"
|
||||
|
||||
class QScreen;
|
||||
|
||||
class SideBySideStereoDisplayPlugin : public StereoDisplayPlugin {
|
||||
Q_OBJECT
|
||||
public:
|
||||
SideBySideStereoDisplayPlugin();
|
||||
virtual const QString & getName() const override;
|
||||
virtual const QString& getName() const override;
|
||||
virtual void activate() override;
|
||||
private:
|
||||
QScreen* getFullscreenTarget();
|
||||
static const QString NAME;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue