IDXGIFactory::MakeWindowAssociation Method (Windows)
Allows DXGI to monitor an application's message queue for the alt-enter key sequence (which causes the application to switch from windowed to fullscreen or vice versa).
Syntax
Parameters
- WindowHandle [in]
- HWND
-
The handle of the window that is to be monitored. This parameter can be NULL; but only if the flags are also 0.
- Flags [in]
- UINT
-
One or more of the following values:
- DXGI_MWA_NO_WINDOW_CHANGES - Prevent DXGI from monitoring an applications message queue; this makes DXGI unable to respond to mode changes.
- DXGI_MWA_NO_ALT_ENTER - Prevent DXGI from responding to an alt-enter sequence.
- DXGI_MWA_NO_PRINT_SCREEN - Prevent DXGI from responding to a print-screen key.
Return Value
DXGIERR_INVALID_CALL if hWnd is invalid, or E_OUTOFMEMORY.
Remarks
The combination of WindowHandle and Flags tells DXGI to stop monitoring window messages for the previously-associated window.
If the application switches to full screen mode, DXGI will choose a fullscreen resolution to be the smallest supported resolution that is larger or the same size as the current back buffer size.
Applications can make some changes to make the transition from windowed to fullscreen more efficient. For example, on a WM_SIZE message, the application should release any outstanding swap-chain back buffers, call IDXGISwapChain::ResizeBackBuffers, then re-acquire the back buffers from the swap chain(s). This gives the swap chain(s) an opportunity to re-size the back buffers, and/or recreate them to enable fullscreen flipping operation. If the application does not perform this sequence, DXGI will still make the fullscreen/windowed transition, but may be forced to use a stretch operation (since the back buffers may not be the correct size), which may be less efficient. Even if a stretch is not required, presentation may not be optimal because the back buffers might not be directly interchangeable with the front buffer. Thus, a call to ResizeBuffers on WM_SIZE is always recommended, since WM_SIZE is always sent during a fullscreen transition.
While windowed, the application can, if it chooses, restrict the size of its window's client area to sizes to which it is comfortable rendering. A fully flexible application would make no such restriction, but UI elements or other design considerations can, of course, make this flexibility untenable. If the application further chooses to restrict its window's client area to just those that match supported fullscreen resolutions, the application can field WM_SIZING, then check against IDXGIOutput::FindClosestMatchingMode. If a matching mode is found, allow the resize. (The IDXGIOutput can be retrieved from IDXGISwapChain::GetContainingOutput. Absent subsequent changes to desktop topology, this will be the same output that will be chosen when alt-enter is fielded and fullscreen mode is begun for that swap chain.)
Applications that want to handle mode changes or Alt+Enter themselves should call MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swapchain creation. The WindowHandle argument, if non-NULL, specifies that the application message queues will not be handled by the DXGI runtime for all swapchains of a particular target HWND. Calling MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swapchain creation ensures that DXGI will not interfere with application's handling of window mode changes or Alt+Enter.
Requirements
Header |
DXGI.h |
---|---|
Library |
DXGI.lib |
See Also
'Study > Directx 10' 카테고리의 다른 글
Resource (자원) (0) | 2010.07.03 |
---|---|
듀얼모니터.. 빌어먹을 dxut (0) | 2010.06.13 |
반사 (0) | 2010.06.04 |
shadow volume (0) | 2010.06.02 |
평면 그림자 (0) | 2010.06.02 |