Untested cross platform implementation
This commit is contained in:
@@ -6,10 +6,14 @@
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include <Engine/Main/Android/android_native_app_glue.h>
|
||||
|
||||
#define DefaultDPI 96
|
||||
|
||||
AndroidWindow::AndroidWindow(const CreateWindowSettings& settings)
|
||||
: WindowBase(settings)
|
||||
{
|
||||
_clientSize = settings.Size;
|
||||
_dpi = DefaultDPI;
|
||||
_dpiScale = (float)_dpi / (float)DefaultDPI;
|
||||
}
|
||||
|
||||
AndroidWindow::~AndroidWindow()
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define _NET_WM_STATE_REMOVE 0L // remove/unset property
|
||||
#define _NET_WM_STATE_ADD 1L // add/set property
|
||||
#define _NET_WM_STATE_TOGGLE 2L // toggle property
|
||||
#define DefaultDPI 96
|
||||
|
||||
// Window routines function prolog
|
||||
#define LINUX_WINDOW_PROLOG X11::Display* display = (X11::Display*)LinuxPlatform::GetXDisplay(); X11::Window window = (X11::Window)_window
|
||||
@@ -138,6 +139,9 @@ LinuxWindow::LinuxWindow(const CreateWindowSettings& settings)
|
||||
if (settings.Parent)
|
||||
X11::XSetTransientForHint(display, window, (X11::Window)((LinuxWindow*)settings.Parent)->GetNativePtr());
|
||||
|
||||
_dpi = Platform::GetDpi();
|
||||
_dpiScale = (float)_dpi / (float)DefaultDPI;
|
||||
|
||||
// Set mask
|
||||
long eventMask =
|
||||
ExposureMask | FocusChangeMask |
|
||||
|
||||
@@ -100,7 +100,6 @@ private:
|
||||
|
||||
UWPWindowImpl* _impl;
|
||||
|
||||
float _dpi, _dpiScale;
|
||||
Vector2 _logicalSize;
|
||||
|
||||
public:
|
||||
|
||||
@@ -98,7 +98,7 @@ WindowsWindow::WindowsWindow(const CreateWindowSettings& settings)
|
||||
(HINSTANCE)Platform::Instance,
|
||||
nullptr);
|
||||
|
||||
_dpi = DefaultDPI;
|
||||
_dpi = Platform::GetDpi();
|
||||
|
||||
const HMODULE user32Dll = LoadLibraryW(L"user32.dll");
|
||||
if (user32Dll)
|
||||
|
||||
Reference in New Issue
Block a user