Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WinRT: removed a deprecated hack regarding window resizing and Direct…
…3D viewports
  • Loading branch information
DavidLudwig committed Aug 27, 2013
1 parent d78b26e commit 409d9b1
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions src/core/winrt/SDL_winrtapp.cpp
Expand Up @@ -302,36 +302,9 @@ void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEven
// chain.
//
// TODO, WinRT: consider dropping old display modes after the fullscreen window changes size (from rotations, etc.)
m_sdlWindowData->sdlWindow->fullscreen_mode = SDL_WinRTGlobalApp->GetMainDisplayMode();
m_sdlWindowData->sdlWindow->fullscreen_mode = GetMainDisplayMode();
SDL_AddDisplayMode(&m_sdlVideoDevice->displays[0], &m_sdlWindowData->sdlWindow->fullscreen_mode);

// HACK, Feb 19, 2013: SDL_WINDOWEVENT_RESIZED events, when sent,
// will attempt to fix the values of the main window's renderer's
// viewport. While this can be good, it does appear to be buggy,
// and can cause a fullscreen viewport to become corrupted. This
// behavior was noticed on a Surface RT while rotating the device
// from landscape to portrait. Oddly enough, this did not occur
// in the Windows Simulator.
//
// Backing up, then restoring, the main renderer's 'resized' flag
// seems to fix fullscreen viewport problems when rotating a
// Windows device.
//
// Commencing hack in 3... 2... 1...
//
// UPDATE, SDL 2.0.0 update: the 'resized' flag is now gone. This
// hack might not be necessary any more.
//
//SDL_Renderer * rendererForMainWindow = SDL_GetRenderer(m_sdlWindowData->sdlWindow);
// For now, limit the hack to when the Direct3D 11.1 is getting used:
//const bool usingD3D11Renderer = \
// (rendererForMainWindow != NULL) &&
// (SDL_strcmp(rendererForMainWindow->info.name, "direct3d 11.1") == 0);
//SDL_bool wasD3D11RendererResized = SDL_FALSE;
//if (usingD3D11Renderer) {
// wasD3D11RendererResized = rendererForMainWindow->resized;
//}

// Send the window-resize event to the rest of SDL, and to apps:
const int windowWidth = (int) ceil(args->Size.Width);
const int windowHeight = (int) ceil(args->Size.Height);
Expand All @@ -340,11 +313,6 @@ void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEven
SDL_WINDOWEVENT_RESIZED,
windowWidth,
windowHeight);

//// Viewport hack, part two:
//if (usingD3D11Renderer) {
// rendererForMainWindow->resized = wasD3D11RendererResized;
//}
}
}

Expand Down

0 comments on commit 409d9b1

Please sign in to comment.