mirror of
https://github.com/lubosz/overte.git
synced 2025-08-14 05:19:25 +02:00
Revert "Add scaling for high-dpi Windows/Linux displays"
This reverts commit 2828b65bea
.
This commit is contained in:
parent
03eb1a984f
commit
4751974c45
2 changed files with 2 additions and 24 deletions
|
@ -271,19 +271,7 @@ void ControllerScriptingInterface::releaseJoystick(int joystickIndex) {
|
||||||
|
|
||||||
glm::vec2 ControllerScriptingInterface::getViewportDimensions() const {
|
glm::vec2 ControllerScriptingInterface::getViewportDimensions() const {
|
||||||
auto glCanvas = DependencyManager::get<GLCanvas>();
|
auto glCanvas = DependencyManager::get<GLCanvas>();
|
||||||
#ifdef Q_OS_MAC
|
return glm::vec2(glCanvas->width(), glCanvas->height());
|
||||||
const float dpiScaleX = 1.0f;
|
|
||||||
const float dpiScaleY = 1.0f;
|
|
||||||
#else
|
|
||||||
const float NATIVE_DPI = 96.0f;
|
|
||||||
const float dpiScaleX = NATIVE_DPI / glCanvas->logicalDpiX();
|
|
||||||
const float dpiScaleY = NATIVE_DPI / glCanvas->logicalDpiY();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const float width = glCanvas->width() / dpiScaleX;
|
|
||||||
const float height = glCanvas->height() / dpiScaleY;
|
|
||||||
|
|
||||||
return glm::vec2(width, height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractInputController* ControllerScriptingInterface::createInputController(const QString& deviceName, const QString& tracker) {
|
AbstractInputController* ControllerScriptingInterface::createInputController(const QString& deviceName, const QString& tracker) {
|
||||||
|
|
|
@ -203,17 +203,7 @@ void ApplicationOverlay::renderOverlay(bool renderToTexture) {
|
||||||
const float NEAR_CLIP = -10000;
|
const float NEAR_CLIP = -10000;
|
||||||
const float FAR_CLIP = 10000;
|
const float FAR_CLIP = 10000;
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
glOrtho(0, glCanvas->width(), glCanvas->height(), 0, NEAR_CLIP, FAR_CLIP);
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// OSX will take care of scaling for us
|
|
||||||
const float dpiScaleX = 1.0f;
|
|
||||||
const float dpiScaleY = 1.0f;
|
|
||||||
#else
|
|
||||||
const float NATIVE_DPI = 96.0f;
|
|
||||||
const float dpiScaleX = NATIVE_DPI / glCanvas->logicalDpiX();
|
|
||||||
const float dpiScaleY = NATIVE_DPI / glCanvas->logicalDpiY();
|
|
||||||
#endif
|
|
||||||
glOrtho(0, glCanvas->width() * dpiScaleX, glCanvas->height() * dpiScaleY, 0, NEAR_CLIP, FAR_CLIP);
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue