本文整理汇总了C++中D3DPipelineManager类的典型用法代码示例。如果您正苦于以下问题:C++ D3DPipelineManager类的具体用法?C++ D3DPipelineManager怎么用?C++ D3DPipelineManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了D3DPipelineManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
/*
* Class: sun_java2d_d3d_D3DSurfaceData
* Method: initOps
* Signature: (III)V
*/
JNIEXPORT void
JNICALL Java_sun_java2d_d3d_D3DSurfaceData_initOps
(JNIEnv *env, jobject d3dsd, jint gdiScreen, jint width, jint height)
{
D3DPipelineManager *pMgr;
D3DSDOps *d3dsdo = (D3DSDOps *)SurfaceData_InitOps(env, d3dsd,
sizeof(D3DSDOps));
J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_initOps");
if (d3dsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "creating native d3d ops");
return;
}
d3dsdo->sdOps.Lock = D3DSD_Lock;
d3dsdo->sdOps.GetRasInfo = D3DSD_GetRasInfo;
d3dsdo->sdOps.Unlock = D3DSD_Unlock;
d3dsdo->sdOps.Dispose = D3DSD_Dispose;
d3dsdo->xoff = 0;
d3dsdo->yoff = 0;
d3dsdo->width = width;
d3dsdo->height = height;
d3dsdo->pResource = NULL;
d3dsdo->adapter =
(pMgr = D3DPipelineManager::GetInstance()) == NULL ?
D3DADAPTER_DEFAULT :
pMgr->GetAdapterOrdinalForScreen(gdiScreen);
}
示例2: J2dTraceLn
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getCurrentDisplayModeNative
* Signature: (I)Ljava/awt/DisplayMode;
*/
JNIEXPORT jobject JNICALL
Java_sun_java2d_d3d_D3DGraphicsDevice_getCurrentDisplayModeNative
(JNIEnv *env, jclass gdc, jint gdiScreen)
{
D3DPipelineManager *pMgr;
IDirect3D9 *pd3d9;
jobject ret = NULL;
D3DDISPLAYMODE mode;
UINT adapter;
J2dTraceLn(J2D_TRACE_INFO, "D3DGD_getCurrentDisplayModeNative");
RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), NULL);
RETURN_STATUS_IF_NULL(pd3d9 = pMgr->GetD3DObject(), NULL);
adapter = pMgr->GetAdapterOrdinalForScreen(gdiScreen);
if (SUCCEEDED(pd3d9->GetAdapterDisplayMode(adapter, &mode))) {
int bitDepth = -1;
// these are the only three valid screen formats
switch (mode.Format) {
case D3DFMT_X8R8G8B8: bitDepth = 32; break;
case D3DFMT_R5G6B5:
case D3DFMT_X1R5G5B5: bitDepth = 16; break;
}
J2dTraceLn4(J2D_TRACE_VERBOSE,
" current dm: %dx%dx%[email protected]%d",
mode.Width, mode.Height, bitDepth, mode.RefreshRate);
ret = CreateDisplayMode(env, mode.Width, mode.Height, bitDepth,
mode.RefreshRate);
}
return ret;
}
示例3: changed
// static
HRESULT D3DPipelineManager::HandleAdaptersChange(HMONITOR *pHMONITORs, UINT monNum)
{
HRESULT res = S_OK;
BOOL bResetD3D = FALSE, bFound;
D3DPipelineManager *pMgr = D3DPipelineManager::GetInstance();
RETURN_STATUS_IF_NULL(pHMONITORs, E_FAIL);
if (pMgr == NULL) {
// NULL pMgr is valid when the pipeline is not enabled or if it hasn't
// been created yet
return S_OK;
}
RETURN_STATUS_IF_NULL(pMgr->pAdapters, E_FAIL);
RETURN_STATUS_IF_NULL(pMgr->pd3d9, E_FAIL);
J2dTraceLn(J2D_TRACE_INFO, "D3DPPLM::HandleAdaptersChange");
if (monNum != pMgr->adapterCount) {
J2dTraceLn2(J2D_TRACE_VERBOSE,
" number of adapters changed (old=%d, new=%d)",
pMgr->adapterCount, monNum);
bResetD3D = TRUE;
} else {
for (UINT i = 0; i < pMgr->adapterCount; i++) {
HMONITOR hMon = pMgr->pd3d9->GetAdapterMonitor(i);
if (hMon == (HMONITOR)0x0) {
J2dTraceLn1(J2D_TRACE_VERBOSE, " adapter %d: removed", i);
bResetD3D = TRUE;
break;
}
bFound = FALSE;
for (UINT mon = 0; mon < monNum; mon++) {
if (pHMONITORs[mon] == hMon) {
J2dTraceLn3(J2D_TRACE_VERBOSE,
" adapter %d: found hmnd[%d]=0x%x", i, mon, hMon);
bFound = TRUE;
break;
}
}
if (!bFound) {
J2dTraceLn2(J2D_TRACE_VERBOSE,
" adapter %d: could not find hmnd=0x%x "\
"in the list of new hmnds", i, hMon);
bResetD3D = TRUE;
break;
}
}
}
if (bResetD3D) {
J2dTraceLn(J2D_TRACE_VERBOSE, " adapters changed: resetting d3d");
pMgr->ReleaseD3D();
res = pMgr->InitD3D();
}
return res;
}
示例4: J2dTraceLn
/*
* Class: sun_java2d_d3d_D3DSurfaceData
* Method: dbGetPixelNative
* Signature: (JII)I
*/
JNIEXPORT jint JNICALL Java_sun_java2d_d3d_D3DSurfaceData_dbGetPixelNative
(JNIEnv *env, jclass clazz, jlong pData, jint x, jint y)
{
HRESULT res;
D3DSDOps *d3dsdo;
D3DContext *pCtx;
D3DPipelineManager *pMgr;
D3DResource *pLockableRes;
jint pixel = 0;
J2dTraceLn(J2D_TRACE_INFO, "D3DSurfaceData_dbGetPixelNative");
RETURN_STATUS_IF_NULL(d3dsdo = (D3DSDOps *)jlong_to_ptr(pData), pixel);
RETURN_STATUS_IF_NULL(d3dsdo->pResource, pixel);
RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), pixel);
if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) {
D3DRQ_MarkLostIfNeeded(res, d3dsdo);
return pixel;
}
RETURN_STATUS_IF_NULL(pCtx->GetResourceManager(), 0);
IDirect3DDevice9 *pd3dDevice = pCtx->Get3DDevice();
IDirect3DSurface9 *pSrc = d3dsdo->pResource->GetSurface();
D3DFORMAT srcFmt = d3dsdo->pResource->GetDesc()->Format;
pCtx->UpdateState(STATE_OTHEROP);
res = pCtx->GetResourceManager()->
GetLockableRTSurface(1, 1, srcFmt, &pLockableRes);
if (SUCCEEDED(res)) {
IDirect3DSurface9 *pTmpSurface;
RECT srcRect = { x, y, x+1, y+1};
RECT dstRect = { 0l, 0l, 1, 1 };
pTmpSurface = pLockableRes->GetSurface();
res = pd3dDevice->StretchRect(pSrc, &srcRect, pTmpSurface, &dstRect,
D3DTEXF_NONE);
if (SUCCEEDED(res)) {
D3DLOCKED_RECT lRect;
res = pTmpSurface->LockRect(&lRect, &dstRect, D3DLOCK_NOSYSLOCK);
if (SUCCEEDED(res)) {
if (srcFmt == D3DFMT_X8R8G8B8) {
pixel = *(jint*)lRect.pBits;
} else {
pixel = *(unsigned short*)lRect.pBits;
}
pTmpSurface->UnlockRect();
}
}
}
D3DRQ_MarkLostIfNeeded(res, d3dsdo);
return pixel;
}
示例5: J2dRlsTraceLn1
void D3DInitializer::D3DAdapterInitializer::InitImpl()
{
J2dRlsTraceLn1(J2D_TRACE_INFO, "D3DAdapterInitializer::InitImpl(%d) started", adapter);
D3DPipelineManager *pMgr = D3DPipelineManager::GetInstance();
if (pMgr == NULL) {
return;
}
D3DContext *pd3dContext;
pMgr->GetD3DContext(adapter, &pd3dContext);
J2dRlsTraceLn1(J2D_TRACE_INFO, "D3DAdapterInitializer::InitImpl(%d) finished", adapter);
}
示例6: J2dRlsTraceLn
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getDeviceCapsNative
* Signature: (I)I
*/
JNIEXPORT jint JNICALL
Java_sun_java2d_d3d_D3DGraphicsDevice_getDeviceCapsNative
(JNIEnv *env, jclass d3dsdc, jint gdiScreen)
{
D3DPipelineManager *pMgr;
D3DContext *pCtx;
UINT adapter;
J2dRlsTraceLn(J2D_TRACE_INFO, "D3DGD_getDeviceCapsNative");
pMgr = D3DPipelineManager::GetInstance();
RETURN_STATUS_IF_NULL(pMgr, CAPS_EMPTY);
adapter = pMgr->GetAdapterOrdinalForScreen(gdiScreen);
if (FAILED(pMgr->GetD3DContext(adapter, &pCtx))) {
J2dRlsTraceLn1(J2D_TRACE_ERROR,
"D3DGD_getDeviceCapsNative: device %d disabled", adapter);
return CAPS_EMPTY;
}
return pCtx->GetContextCaps();
}
示例7: D3DSD_Flush
void D3DSD_Flush(void *pData)
{
J2dTraceLn(J2D_TRACE_INFO, "D3DSD_Flush");
RETURN_IF_NULL(pData);
D3DSDOps *d3dsdo = (D3DSDOps*)pData;
if (d3dsdo->pResource != NULL) {
D3DContext *pCtx;
D3DPipelineManager *pMgr;
d3dsdo->pResource->SetSDOps(NULL);
if ((pMgr = D3DPipelineManager::GetInstance()) != NULL &&
SUCCEEDED(pMgr->GetD3DContext(d3dsdo->adapter, &pCtx)))
{
if (pCtx->GetResourceManager()) {
pCtx->GetResourceManager()->ReleaseResource(d3dsdo->pResource);
}
}
d3dsdo->pResource = NULL;
}
}