mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix alignment of pixels for reading to video recorder
This commit is contained in:
parent
1e36b4df15
commit
511c9d248e
|
@ -354,7 +354,11 @@ void CVideo::read_rgb_from_gl()
|
|||
size_t cur_gl, cur_rgb;
|
||||
/* Get RGBA to align to 32 bits instead of just 24 for RGB. May be faster for FFmpeg. */
|
||||
glReadBuffer(GL_FRONT);
|
||||
GLint Alignment;
|
||||
glGetIntegerv(GL_PACK_ALIGNMENT, &Alignment);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadPixels(0, 0, m_Width, m_Height, GL_RGB, GL_UNSIGNED_BYTE, m_pPixels);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, Alignment);
|
||||
for (i = 0; i < m_Height; i++)
|
||||
{
|
||||
for (j = 0; j < m_Width; j++)
|
||||
|
|
Loading…
Reference in a new issue