本文整理汇总了C++中LPDIRECT3DDEVICE9::SetDialogBoxMode方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECT3DDEVICE9::SetDialogBoxMode方法的具体用法?C++ LPDIRECT3DDEVICE9::SetDialogBoxMode怎么用?C++ LPDIRECT3DDEVICE9::SetDialogBoxMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECT3DDEVICE9
的用法示例。
在下文中一共展示了LPDIRECT3DDEVICE9::SetDialogBoxMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
HRESULT HookIDirect3DDevice9::SetDialogBoxMode(LPVOID _this, BOOL bEnableDialogs)
{
LOG_API();
return pD3Dev->SetDialogBoxMode(bEnableDialogs);
}
示例2: InitProcessorFeature
HRESULT KG3DGraphicsEngine::Init(KG3DDeviceSettings const* pSettings, BOOL bEnableDebug)
{
HRESULT hResult = E_FAIL;
HRESULT hr = E_FAIL;
UINT uAdapter = D3DADAPTER_DEFAULT;
D3DDEVTYPE DeviceType = D3DDEVTYPE_HAL;
KG3DDeviceSettings Settings;
int nInitVIM3D = false;
KGLOG_PROCESS_ERROR(pSettings);
hr = InitProcessorFeature();
KGLOG_COM_PROCESS_ERROR(hr);
ASSERT(m_pD3D == NULL);
m_pD3D = Direct3DCreate9(D3D_SDK_VERSION);
KGLOG_PROCESS_ERROR(m_pD3D);
memcpy(&Settings, pSettings, sizeof(KG3DDeviceSettings));
hr = GetAdapater(&uAdapter, &DeviceType);
KGLOG_COM_PROCESS_ERROR(hr);
hr = m_pD3D->GetAdapterDisplayMode(uAdapter, &m_DisplayMode);
KGLOG_COM_PROCESS_ERROR(hr);
hr = g_cEngineOptionCaps.GetAdaperModeCaps(uAdapter, m_DisplayMode.Format);
KGLOG_COM_PROCESS_ERROR(hr);
memset(&m_PresentParam, 0, sizeof(m_PresentParam));
hr = SetPresentParam(uAdapter, DeviceType, &m_PresentParam, &Settings);
KGLOG_COM_PROCESS_ERROR(hr);
hr = InitDevice(uAdapter, DeviceType, g_hBaseWnd);
KGLOG_COM_PROCESS_ERROR(hr);
g_GetDefaultShaderGroup().CheckShaderModel();
if (m_PresentParam.MultiSampleType == D3DMULTISAMPLE_NONE && !g_b3DVision)
{
hr = g_pd3dDevice->SetDialogBoxMode(!m_PresentParam.Windowed);
KGLOG_COM_PROCESS_ERROR(hr);
}
if (bEnableDebug)
{
g_DebugD3DDevice.Enable(bEnableDebug);
hr = InitDebugDevice();
KGLOG_COM_PROCESS_ERROR(hr);
}
hr = InitVIM3D(g_pd3dDevice);
KGLOG_COM_PROCESS_ERROR(hr);
nInitVIM3D = true;
m_bDeviceLost = false;
m_bDeviceObjectsLost = false;
memcpy(&m_DeviceSettings, &Settings, sizeof(KG3DDeviceSettings));
//确实是否要使用多目标渲染
g_cEngineOption.bUseRenderTarget_DepthTexture = g_cGraphicsEngine.m_PresentParam.MultiSampleType != D3DMULTISAMPLE_NONE;
g_nDepthTexturePackingType = 0;
if (g_cEngineOption.bUseRenderTarget_DepthTexture)
{
g_nDepthTexturePackingType = CheckDepthTexturePackingType(uAdapter,DeviceType);
LPCTSTR strPackType = NULL;
switch (g_nDepthTexturePackingType)
{
case 0:
strPackType = _T("0");
break;
case 1:
strPackType = _T("1");
break;
default:
strPackType = _T("0");
break;
}
D3DXMACRO macroPackType[] = {
{_T("PACKTYPE"), strPackType},
{NULL, NULL},
};
D3DXMACRO_ARRAY macroArray = {macroPackType, _countof(macroPackType)};
g_GetDefaultShaderGroup().ModifyGlobalMacro(macroArray);
}
//g_cEngineOption.bUseMultiRenderTarget = TRUE;
hr = GetBackBufferDesc(g_pd3dDevice, &m_BackBufferSurfaceDesc);
KGLOG_COM_PROCESS_ERROR(hr);
if (m_pDeviceCallback)
{
hr = m_pDeviceCallback->OnCreateDevice(g_pd3dDevice, &m_BackBufferSurfaceDesc, &m_PresentParam);
KGLOG_COM_PROCESS_ERROR(hr);
}
//.........这里部分代码省略.........
示例3: min
HRESULT KG3DGraphicsEngine::SetDeviceSettings(KG3DDeviceSettings* pSettings)
{
HRESULT hr = E_FAIL;
HRESULT hrResult = E_FAIL;
UINT uAdapter = D3DADAPTER_DEFAULT;
D3DDEVTYPE DeviceType = D3DDEVTYPE_HAL;
KG3DDeviceSettings Settings;
KGLOG_PROCESS_ERROR(pSettings);
pSettings->nMultiSampleType = min(4,pSettings->nMultiSampleType);
memcpy(&Settings, pSettings, sizeof(KG3DDeviceSettings));
hr = GetAdapater(&uAdapter, &DeviceType);
KGLOG_COM_PROCESS_ERROR(hr);
hr = g_cEngineOptionCaps.GetAdaperModeCaps(uAdapter, m_DisplayMode.Format);
KGLOG_COM_PROCESS_ERROR(hr);
hr = SetPresentParam(uAdapter, DeviceType, &m_PresentParam, &Settings);
KGLOG_COM_PROCESS_ERROR(hr);
memcpy(&m_DeviceSettings, &Settings, sizeof(m_DeviceSettings));
g_cEngineOption.bUseRenderTarget_DepthTexture = g_cGraphicsEngine.m_PresentParam.MultiSampleType != D3DMULTISAMPLE_NONE;
//Testing Packing Type;
g_nDepthTexturePackingType = 0;
if (g_cEngineOption.bUseRenderTarget_DepthTexture)
{
g_nDepthTexturePackingType = CheckDepthTexturePackingType(uAdapter,DeviceType);
LPCTSTR strPackType = NULL;
switch (g_nDepthTexturePackingType)
{
case 0:
strPackType = _T("0");
break;
case 1:
strPackType = _T("1");
break;
default:
strPackType = _T("0");
break;
}
D3DXMACRO macroPackType[] = {
{_T("PACKTYPE"), strPackType},
{NULL, NULL},
};
D3DXMACRO_ARRAY macroArray = {macroPackType, _countof(macroPackType)};
g_GetDefaultShaderGroup().ModifyGlobalMacro(macroArray);
}
//要求原来的设备还在。虽然是在创建设备前,但是因为改变了抗锯齿,而抗锯齿和其他postrender会有冲突,所以,先检查。
g_cEngineManager.SetEngineOption(&g_cEngineOption);
hr = Reset();
if (hr == D3DERR_DEVICELOST)
{
do
{
hr = CheckDevice();
}
while (hr == D3DERR_DEVICELOST);
}
KG_COM_PROCESS_ERROR(hr);
//////////////////
// DWORD dwHeight = 0,dwWidth = 0;
IEKG3DScene* pScene = g_cGraphicsTool.GetScene();
if (pScene)
{
IEKG3DSceneOutputWnd* pOutputWindow = NULL;
pScene->GetCurOutputWnd(&pOutputWindow);
if (pOutputWindow)
{
KG3DSceneOutputWnd* pWnd = static_cast<KG3DSceneOutputWnd*>(pOutputWindow);
pWnd->OnResizeWindow(&(pWnd->m_Rect));
}
}
/////////////////
if (m_PresentParam.MultiSampleType == D3DMULTISAMPLE_NONE && !g_b3DVision)
{
hr = g_pd3dDevice->SetDialogBoxMode(!m_PresentParam.Windowed);
KGLOG_COM_PROCESS_ERROR(hr);
}
hrResult = S_OK;
Exit0:
if (FAILED(hrResult))
{
if (hr == D3DERR_DEVICELOST)
m_bDeviceLost = true;
else
KGLOG_COM_CHECK_ERROR(hr);
hrResult = hr;
}
if (pSettings)
memcpy(pSettings, &m_DeviceSettings, sizeof(m_DeviceSettings));
return hrResult;
//.........这里部分代码省略.........
示例4: if
HRESULT KGraphicsEngine::Toggle2Windowed()
{
if (m_lpCurScene)
{
g_cMeshTable.InvalidateDeviceObjects();
g_SceneTable.InvalidateDeviceObjects();
}
g_EffectMgr.InvalidateDeviceObjects();
if (m_bUseMotionBlur)
{
BackBufferRelease();
}
HRESULT hr = S_OK;
GetWindowRect(m_LastRenderWindow,&m_RenderWindowRect);
//m_PresentParam.BackBufferWidth = m_RenderWindowRect.right-m_RenderWindowRect.left ;
//m_PresentParam.BackBufferHeight= m_RenderWindowRect.bottom - m_RenderWindowRect.top;
m_PresentParam.BackBufferWidth = m_DisplayMode.Width;
m_PresentParam.BackBufferHeight= m_DisplayMode.Height;
D3DFORMAT DepFormat;
if (SUCCEEDED(g_pD3D->CheckDepthStencilMatch(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
m_DisplayMode.Format,
m_DisplayMode.Format,
D3DFMT_D24S8)))
{
DepFormat = D3DFMT_D24S8;
}
else
{
DepFormat = D3DFMT_D16;
}
m_PresentParam.Windowed = TRUE ;
m_PresentParam.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_PresentParam.BackBufferFormat = m_DisplayMode.Format;
m_PresentParam.EnableAutoDepthStencil = TRUE;
m_PresentParam.AutoDepthStencilFormat = DepFormat;
m_PresentParam.MultiSampleType = D3DMULTISAMPLE_NONE;
m_PresentParam.hDeviceWindow = g_hBaseWnd;
m_PresentParam.Flags = 0;
m_PresentParam.FullScreen_RefreshRateInHz = 0;
m_PresentParam.BackBufferCount = 0;
m_PresentParam.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
//just set camera's aspect
m_cCamera.Aspect = m_PresentParam.BackBufferWidth*1.0f/m_PresentParam.BackBufferHeight;
g_pd3dDevice->SetDialogBoxMode( FALSE );
if ( FAILED(hr = g_pd3dDevice->Reset( &m_PresentParam )))
{
//fprintf(Note,"Create D3D Device Failed.\n");
if (hr == D3DERR_INVALIDCALL)
MessageBox(g_hBaseWnd,"Toggle to Windowed Failed!","Failed in Toggling",0);
else if (hr == E_OUTOFMEMORY )
MessageBox(g_hBaseWnd,"Direct3D could not allocate sufficient memory to complete the call.","Failed Create Device!",0);
else if (hr == D3DERR_OUTOFVIDEOMEMORY)
MessageBox(g_hBaseWnd,"Direct3D does not have enough display memory to perform the operation. ","Failed Create Device!",0);
return E_FAIL;
}
SetWindowLong( g_hBaseWnd , GWL_STYLE, m_BaseWinStyle );
SetRenderWindow(m_LastRenderWindow);
m_bWindowed = TRUE;
if (m_lpCurScene)
{
g_cMeshTable.RestoreDeviceObjects();
g_SceneTable.RestoreDeviceObjects();
}
g_EffectMgr.RestoreDeviceObjects();
if (m_bUseMotionBlur)
{
BackBufferCreate();
}
return S_OK;
}