0

我想在directx 上显示对话框。在全屏上,单击按钮时看不到对话框。当我的项目全屏时如何显示它?

4

1 回答 1

0

我自己解决了这个问题。我输入了这段代码。

D3DPRESENT_PARAMETERS d3dpp;
d3dpp.BackBufferWidth            = m_config.nWidth;
d3dpp.BackBufferHeight           = m_config.nHeight;
d3dpp.BackBufferFormat           = D3DFMT_X8R8G8B8;
d3dpp.BackBufferCount            = 1;
d3dpp.MultiSampleType            = D3DMULTISAMPLE_NONE;//D3DMULTISAMPLE_2_SAMPLES;
d3dpp.MultiSampleQuality         = 0;
d3dpp.SwapEffect                 = /*D3DSWAPEFFECT_COPY;//*/D3DSWAPEFFECT_DISCARD; 
d3dpp.hDeviceWindow              = m_hWnd;
d3dpp.Windowed                   = true;
d3dpp.EnableAutoDepthStencil     = true;
d3dpp.AutoDepthStencilFormat     = D3DFMT_D24S8;
d3dpp.Flags                      = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL|**D3DPRESENTFLAG_LOCKABLE_BACKBUFFER**;
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.PresentationInterval       = D3DPRESENT_INTERVAL_IMMEDIATE;

然后创建 LPDirect3dDevice。在这之后,

m_pd3dDevice->SetDialogBoxMode(true);

然后将显示对话框。

于 2011-12-05T01:12:37.180 回答