gerardorosiles / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Switching problem to window mode ALT + ENTER #845

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I run the September 2011 SDK. 
I'm using the tutorials on your page and I changed IsWindowed in the 
SwapChainDescription to false that the application starts in fullscreen mode.
When I switch to non-full-screen with ALT + ENTER, all I see is a blank box 
that is not moveable.
When I start the application in windowed mode I can go to fullscreen and back 
to windowed mode without a problem. 

After all, I tried following solution:
    renderForm.KeyDown += (o, e) =>
            {
                if (e.Alt && e.KeyCode == Keys.Enter)
                {                 

                    bool isFull;
                    Output temp;
                    swapChain.GetFullScreenState(out isFull, out temp);
                    isFull = !isFull;
                    swapChain.IsFullScreen = isFull;
}
}

But this doesn't work too for me. How can I fix this problem in the tutorials? 
Thank you.

Original issue reported on code.google.com by northwin...@gmail.com on 4 Nov 2011 at 10:33

GoogleCodeExporter commented 9 years ago
I think this is an issue with the way Winforms interacts with DXGI. If you call 
Form.Show() before creating the fullscreen swapchain, everything works fine. If 
you don't call it, when you switch back to windowed mode you get that weird 
blank window effect.

Original comment by Mike.Popoloski on 15 Nov 2011 at 6:32