本文整理汇总了C++中CD3DTexture::GetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CD3DTexture::GetWidth方法的具体用法?C++ CD3DTexture::GetWidth怎么用?C++ CD3DTexture::GetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CD3DTexture
的用法示例。
在下文中一共展示了CD3DTexture::GetWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderHW
void CWinRenderer::RenderHW(DWORD flags, CD3DTexture* target)
{
CRenderBuffer& buf = m_renderBuffers[m_iYV12RenderBuffer];
if ( buf.format != BUFFER_FMT_D3D11_BYPASS
&& buf.format != BUFFER_FMT_D3D11_NV12
&& buf.format != BUFFER_FMT_D3D11_P010
&& buf.format != BUFFER_FMT_D3D11_P016)
return;
if (!buf.loaded)
return;
int past = 0;
int future = 0;
CRenderBuffer* views[8];
memset(views, 0, 8 * sizeof(CRenderBuffer*));
views[2] = &buf;
// set future frames
while (future < 2)
{
bool found = false;
for (int i = 0; i < m_NumYV12Buffers; i++)
{
if (m_renderBuffers[i].frameIdx == buf.frameIdx + (future*2 + 2))
{
// a future frame may not be loaded yet
if (m_renderBuffers[i].loaded || m_renderBuffers[i].UploadBuffer())
{
views[1 - future++] = &m_renderBuffers[i];
found = true;
break;
}
}
}
if (!found)
break;
}
// set past frames
while (past < 4)
{
bool found = false;
for (int i = 0; i < m_NumYV12Buffers; i++)
{
if (m_renderBuffers[i].frameIdx == buf.frameIdx - (past*2 + 2))
{
if (m_renderBuffers[i].loaded)
{
views[3 + past++] = &m_renderBuffers[i];
found = true;
break;
}
}
}
if (!found)
break;
}
CRect destRect;
switch (m_renderOrientation)
{
case 90:
destRect = CRect(m_rotatedDestCoords[3], m_rotatedDestCoords[1]);
break;
case 180:
destRect = m_destRect;
break;
case 270:
destRect = CRect(m_rotatedDestCoords[1], m_rotatedDestCoords[3]);
break;
default:
destRect = m_bUseHQScaler ? m_sourceRect : CServiceBroker::GetWinSystem()->GetGfxContext().StereoCorrection(m_destRect);
break;
}
CRect src = m_sourceRect, dst = destRect;
CRect targetRect = CRect(0.0f, 0.0f,
static_cast<float>(m_IntermediateTarget.GetWidth()),
static_cast<float>(m_IntermediateTarget.GetHeight()));
if (target != DX::Windowing()->GetBackBuffer())
{
// rendering capture
targetRect.x2 = static_cast<float>(target->GetWidth());
targetRect.y2 = static_cast<float>(target->GetHeight());
}
CWIN32Util::CropSource(src, dst, targetRect, m_renderOrientation);
m_processor->Render(src, dst, m_IntermediateTarget.Get(), views, flags, buf.frameIdx, m_renderOrientation,
m_videoSettings.m_Contrast, m_videoSettings.m_Brightness);
if (!m_bUseHQScaler)
{
if ( CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_SPLIT_HORIZONTAL
|| CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_SPLIT_VERTICAL)
{
CD3DTexture *backBuffer = DX::Windowing()->GetBackBuffer();
CD3D11_VIEWPORT bbSize(0.f, 0.f, static_cast<float>(backBuffer->GetWidth()), static_cast<float>(backBuffer->GetHeight()));
//.........这里部分代码省略.........