mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:28:09 +02:00
Merge pull request #11892 from SamGondelman/snapshot
Expose Window.getDeviceSize()
This commit is contained in:
commit
fffcf56904
5 changed files with 12 additions and 12 deletions
|
@ -7075,11 +7075,11 @@ QRect Application::getRecommendedHUDRect() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize Application::getDeviceSize() const {
|
glm::vec2 Application::getDeviceSize() const {
|
||||||
static const int MIN_SIZE = 1;
|
static const int MIN_SIZE = 1;
|
||||||
QSize result(MIN_SIZE, MIN_SIZE);
|
glm::vec2 result(MIN_SIZE);
|
||||||
if (_displayPlugin) {
|
if (_displayPlugin) {
|
||||||
result = fromGlm(getActiveDisplayPlugin()->getRecommendedRenderSize());
|
result = getActiveDisplayPlugin()->getRecommendedRenderSize();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -7098,10 +7098,6 @@ bool Application::hasFocus() const {
|
||||||
return (QApplication::activeWindow() != nullptr);
|
return (QApplication::activeWindow() != nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 Application::getViewportDimensions() const {
|
|
||||||
return toGlm(getDeviceSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
|
void Application::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
|
||||||
if (maxOctreePPS != _maxOctreePPS) {
|
if (maxOctreePPS != _maxOctreePPS) {
|
||||||
_maxOctreePPS = maxOctreePPS;
|
_maxOctreePPS = maxOctreePPS;
|
||||||
|
|
|
@ -158,7 +158,7 @@ public:
|
||||||
|
|
||||||
glm::uvec2 getUiSize() const;
|
glm::uvec2 getUiSize() const;
|
||||||
QRect getRecommendedHUDRect() const;
|
QRect getRecommendedHUDRect() const;
|
||||||
QSize getDeviceSize() const;
|
glm::vec2 getDeviceSize() const;
|
||||||
bool hasFocus() const;
|
bool hasFocus() const;
|
||||||
|
|
||||||
void showCursor(const Cursor::Icon& cursor);
|
void showCursor(const Cursor::Icon& cursor);
|
||||||
|
@ -228,8 +228,6 @@ public:
|
||||||
|
|
||||||
FileLogger* getLogger() const { return _logger; }
|
FileLogger* getLogger() const { return _logger; }
|
||||||
|
|
||||||
glm::vec2 getViewportDimensions() const;
|
|
||||||
|
|
||||||
NodeToJurisdictionMap& getEntityServerJurisdictions() { return _entityServerJurisdictions; }
|
NodeToJurisdictionMap& getEntityServerJurisdictions() { return _entityServerJurisdictions; }
|
||||||
|
|
||||||
float getRenderResolutionScale() const;
|
float getRenderResolutionScale() const;
|
||||||
|
|
|
@ -104,8 +104,7 @@ void Application::paintGL() {
|
||||||
PerformanceTimer perfTimer("renderOverlay");
|
PerformanceTimer perfTimer("renderOverlay");
|
||||||
// NOTE: There is no batch associated with this renderArgs
|
// NOTE: There is no batch associated with this renderArgs
|
||||||
// the ApplicationOverlay class assumes it's viewport is setup to be the device size
|
// the ApplicationOverlay class assumes it's viewport is setup to be the device size
|
||||||
QSize size = getDeviceSize();
|
renderArgs._viewport = glm::ivec4(0, 0, getDeviceSize());
|
||||||
renderArgs._viewport = glm::ivec4(0, 0, size.width(), size.height());
|
|
||||||
_applicationOverlay.renderOverlay(&renderArgs);
|
_applicationOverlay.renderOverlay(&renderArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,10 @@ bool WindowScriptingInterface::isPointOnDesktopWindow(QVariant point) {
|
||||||
return offscreenUi->isPointOnDesktopWindow(point);
|
return offscreenUi->isPointOnDesktopWindow(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec2 WindowScriptingInterface::getDeviceSize() const {
|
||||||
|
return qApp->getDeviceSize();
|
||||||
|
}
|
||||||
|
|
||||||
/// Makes sure that the reticle is visible, use this in blocking forms that require a reticle and
|
/// Makes sure that the reticle is visible, use this in blocking forms that require a reticle and
|
||||||
/// might be in same thread as a script that sets the reticle to invisible
|
/// might be in same thread as a script that sets the reticle to invisible
|
||||||
void WindowScriptingInterface::ensureReticleVisible() const {
|
void WindowScriptingInterface::ensureReticleVisible() const {
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#ifndef hifi_WindowScriptingInterface_h
|
#ifndef hifi_WindowScriptingInterface_h
|
||||||
#define hifi_WindowScriptingInterface_h
|
#define hifi_WindowScriptingInterface_h
|
||||||
|
|
||||||
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtQuick/QQuickItem>
|
#include <QtQuick/QQuickItem>
|
||||||
|
@ -73,6 +75,7 @@ public slots:
|
||||||
bool isPhysicsEnabled();
|
bool isPhysicsEnabled();
|
||||||
bool setDisplayTexture(const QString& name);
|
bool setDisplayTexture(const QString& name);
|
||||||
bool isPointOnDesktopWindow(QVariant point);
|
bool isPointOnDesktopWindow(QVariant point);
|
||||||
|
glm::vec2 getDeviceSize() const;
|
||||||
|
|
||||||
int openMessageBox(QString title, QString text, int buttons, int defaultButton);
|
int openMessageBox(QString title, QString text, int buttons, int defaultButton);
|
||||||
void updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton);
|
void updateMessageBox(int id, QString title, QString text, int buttons, int defaultButton);
|
||||||
|
|
Loading…
Reference in a new issue