本文整理汇总了C++中D3DPipelineManager::SetFSFocusWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ D3DPipelineManager::SetFSFocusWindow方法的具体用法?C++ D3DPipelineManager::SetFSFocusWindow怎么用?C++ D3DPipelineManager::SetFSFocusWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D3DPipelineManager
的用法示例。
在下文中一共展示了D3DPipelineManager::SetFSFocusWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SUCCEEDED
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: enterFullScreenExclusiveNative
* Signature: (IJ)V
*/
JNIEXPORT jboolean JNICALL
Java_sun_java2d_d3d_D3DGraphicsDevice_enterFullScreenExclusiveNative
(JNIEnv *env, jclass gdc, jint gdiScreen, jlong window)
{
HRESULT res;
D3DPipelineManager *pMgr;
D3DContext *pCtx;
HWND hWnd;
AwtWindow *w;
D3DPRESENT_PARAMETERS newParams, *pCurParams;
D3DDISPLAYMODE dm;
UINT adapter;
J2dTraceLn(J2D_TRACE_INFO, "D3DGD_enterFullScreenExclusiveNative");
RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), JNI_FALSE);
adapter = pMgr->GetAdapterOrdinalForScreen(gdiScreen);
if (FAILED(res = pMgr->GetD3DContext(adapter, &pCtx))) {
D3DRQ_MarkLostIfNeeded(res, D3DRQ_GetCurrentDestination());
return JNI_FALSE;
}
w = (AwtWindow *)AwtComponent::GetComponent((HWND)window);
if (w == NULL || !::IsWindow(hWnd = w->GetTopLevelHWnd())) {
J2dTraceLn(J2D_TRACE_WARNING,
"D3DGD_enterFullScreenExclusiveNative: disposed window");
return JNI_FALSE;
}
// REMIND: should we also move the non-topleve window from
// being on top here (it's moved to front in GraphicsDevice.setFSW())?
pCtx->Get3DObject()->GetAdapterDisplayMode(adapter, &dm);
pCurParams = pCtx->GetPresentationParams();
// let the mananger know that we're entering the fs mode, it will
// set the proper current focus window for us, which ConfigureContext will
// use when creating the device
pMgr->SetFSFocusWindow(adapter, hWnd);
newParams = *pCurParams;
newParams.hDeviceWindow = hWnd;
newParams.Windowed = FALSE;
newParams.BackBufferCount = 1;
newParams.BackBufferFormat = dm.Format;
newParams.FullScreen_RefreshRateInHz = dm.RefreshRate;
newParams.BackBufferWidth = dm.Width;
newParams.BackBufferHeight = dm.Height;
newParams.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
newParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
res = pCtx->ConfigureContext(&newParams);
D3DRQ_MarkLostIfNeeded(res, D3DRQ_GetCurrentDestination());
return SUCCEEDED(res);
}