Exemple #1
0
LRESULT App::OnWindowResized(void* context, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    App* app = reinterpret_cast<App*>(context);

    if(!app->deviceManager.FullScreen() && wParam != SIZE_MINIMIZED)
    {
        int width, height;
        app->window.GetClientArea(width, height);

        if(width != app->deviceManager.BackBufferWidth() || height != app->deviceManager.BackBufferHeight())
        {
            app->BeforeReset();

            app->deviceManager.SetBackBufferWidth(width);
            app->deviceManager.SetBackBufferHeight(height);
            app->deviceManager.Reset();

            app->AfterReset();
        }
    }

    return 0;
}