mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Merge pull request #647 from selfshadow/avi-swizzle-fix
Fixed swapped R and B in D3D11 and OpenGL video capture
This commit is contained in:
commit
ce84bd4f57
2 changed files with 12 additions and 0 deletions
|
@ -3081,6 +3081,13 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||||
D3D11_MAPPED_SUBRESOURCE mapped;
|
D3D11_MAPPED_SUBRESOURCE mapped;
|
||||||
DX_CHECK(m_deviceCtx->Map(m_captureTexture, 0, D3D11_MAP_READ, 0, &mapped) );
|
DX_CHECK(m_deviceCtx->Map(m_captureTexture, 0, D3D11_MAP_READ, 0, &mapped) );
|
||||||
|
|
||||||
|
imageSwizzleBgra8(getBufferWidth()
|
||||||
|
, getBufferHeight()
|
||||||
|
, mapped.RowPitch
|
||||||
|
, mapped.pData
|
||||||
|
, mapped.pData
|
||||||
|
);
|
||||||
|
|
||||||
g_callback->captureFrame(mapped.pData, getBufferHeight()*mapped.RowPitch);
|
g_callback->captureFrame(mapped.pData, getBufferHeight()*mapped.RowPitch);
|
||||||
|
|
||||||
m_deviceCtx->Unmap(m_captureTexture, 0);
|
m_deviceCtx->Unmap(m_captureTexture, 0);
|
||||||
|
|
|
@ -2899,6 +2899,11 @@ namespace bgfx { namespace gl
|
||||||
, m_capture
|
, m_capture
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
if (GL_RGBA == m_readPixelsFmt)
|
||||||
|
{
|
||||||
|
imageSwizzleBgra8(m_resolution.m_width, m_resolution.m_height, m_resolution.m_width*4, m_capture, m_capture);
|
||||||
|
}
|
||||||
|
|
||||||
g_callback->captureFrame(m_capture, m_captureSize);
|
g_callback->captureFrame(m_capture, m_captureSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue