mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
Fix initializing the graphics module after a window is opened.
This commit is contained in:
@@ -552,6 +552,9 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
}
|
||||
}
|
||||
|
||||
if (renderer != windowRenderer && isOpen())
|
||||
close();
|
||||
|
||||
if (isOpen())
|
||||
{
|
||||
if (SDL_SetWindowFullscreen(window, sdlflags) == 0 && renderer == graphics::Graphics::RENDERER_OPENGL)
|
||||
@@ -613,6 +616,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
|
||||
updateSettings(f, false);
|
||||
|
||||
windowRenderer = renderer;
|
||||
|
||||
if (graphics.get())
|
||||
{
|
||||
double scaledw, scaledh;
|
||||
|
||||
@@ -172,6 +172,8 @@ private:
|
||||
SDL_MetalView metalView;
|
||||
#endif
|
||||
|
||||
graphics::Graphics::Renderer windowRenderer = graphics::Graphics::RENDERER_NONE;
|
||||
|
||||
bool displayedWindowError;
|
||||
bool hasSDL203orEarlier;
|
||||
ContextAttribs contextAttribs;
|
||||
|
||||
Reference in New Issue
Block a user