SDL: Call setupIcon for each window creation with SDL2.
This should make sure that the logo is properly set on Win32 with SDL2.
This commit is contained in:
parent
71cc9e41e8
commit
066e71f61a
2 changed files with 3 additions and 7 deletions
|
@ -30,14 +30,13 @@
|
|||
|
||||
SdlWindow::SdlWindow()
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
: _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM"), _windowIcon(nullptr)
|
||||
: _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM")
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
SdlWindow::~SdlWindow() {
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_FreeSurface(_windowIcon);
|
||||
destroyWindow();
|
||||
#endif
|
||||
}
|
||||
|
@ -100,16 +99,14 @@ void SdlWindow::setupIcon() {
|
|||
}
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_FreeSurface(_windowIcon);
|
||||
_windowIcon = sdl_surf;
|
||||
if (_window) {
|
||||
SDL_SetWindowIcon(_window, sdl_surf);
|
||||
}
|
||||
#else
|
||||
SDL_WM_SetIcon(sdl_surf, NULL);
|
||||
SDL_FreeSurface(sdl_surf);
|
||||
#endif
|
||||
|
||||
SDL_FreeSurface(sdl_surf);
|
||||
free(icon);
|
||||
}
|
||||
|
||||
|
@ -214,7 +211,7 @@ bool SdlWindow::createWindow(int width, int height, uint32 flags) {
|
|||
if (!_window) {
|
||||
return false;
|
||||
}
|
||||
SDL_SetWindowIcon(_window, _windowIcon);
|
||||
setupIcon();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue