mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fix initializing the graphics module after a window is opened.
This commit is contained in:
@@ -361,18 +361,13 @@ Graphics::Graphics()
|
||||
{
|
||||
window->setGraphics(this);
|
||||
|
||||
// Recreate the window using the current renderer, if needed.
|
||||
if (window->isOpen())
|
||||
{
|
||||
int w, h;
|
||||
love::window::WindowSettings settings;
|
||||
window->getWindow(w, h, settings);
|
||||
|
||||
double dpiW = w;
|
||||
double dpiH = h;
|
||||
window->windowToDPICoords(&dpiW, &dpiH);
|
||||
|
||||
void *context = nullptr; // TODO
|
||||
setMode(context, (int) dpiW, (int) dpiH, window->getPixelWidth(), window->getPixelHeight(), settings.stencil, settings.depth);
|
||||
window->setWindow(w, h, &settings);
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -131,18 +131,13 @@ Graphics::Graphics()
|
||||
{
|
||||
window->setGraphics(this);
|
||||
|
||||
// Recreate the window using the current renderer, if needed.
|
||||
if (window->isOpen())
|
||||
{
|
||||
int w, h;
|
||||
love::window::WindowSettings s;
|
||||
window->getWindow(w, h, s);
|
||||
|
||||
double dpiW = w;
|
||||
double dpiH = h;
|
||||
window->windowToDPICoords(&dpiW, &dpiH);
|
||||
|
||||
void *context = nullptr; // TODO
|
||||
setMode(context, (int) dpiW, (int) dpiH, window->getPixelWidth(), window->getPixelHeight(), s.stencil, s.msaa);
|
||||
love::window::WindowSettings settings;
|
||||
window->getWindow(w, h, settings);
|
||||
window->setWindow(w, h, &settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user