mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-19 23:05:38 +00:00
Qt: Set display window size on context create not constructor
The size isn't known at construction time.
This commit is contained in:
parent
cd2f6d1f68
commit
e48e6141c8
|
@ -7,8 +7,6 @@
|
||||||
QtDisplayWindow::QtDisplayWindow(QtHostInterface* host_interface, QWindow* parent)
|
QtDisplayWindow::QtDisplayWindow(QtHostInterface* host_interface, QWindow* parent)
|
||||||
: QWindow(parent), m_host_interface(host_interface)
|
: QWindow(parent), m_host_interface(host_interface)
|
||||||
{
|
{
|
||||||
m_window_width = static_cast<int>(static_cast<qreal>(width()) * devicePixelRatio());
|
|
||||||
m_window_height = static_cast<int>(static_cast<qreal>(height()) * devicePixelRatio());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QtDisplayWindow::~QtDisplayWindow() = default;
|
QtDisplayWindow::~QtDisplayWindow() = default;
|
||||||
|
@ -30,6 +28,9 @@ bool QtDisplayWindow::createDeviceContext(QThread* worker_thread, bool debug_dev
|
||||||
|
|
||||||
bool QtDisplayWindow::initializeDeviceContext(bool debug_device)
|
bool QtDisplayWindow::initializeDeviceContext(bool debug_device)
|
||||||
{
|
{
|
||||||
|
m_window_width = static_cast<int>(static_cast<qreal>(width()) * devicePixelRatio());
|
||||||
|
m_window_height = static_cast<int>(static_cast<qreal>(height()) * devicePixelRatio());
|
||||||
|
|
||||||
if (!createImGuiContext() || !createDeviceResources())
|
if (!createImGuiContext() || !createDeviceResources())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue