From ca583ba2a9e4ff92021d91c6b7fb0c02e9ab3a0c Mon Sep 17 00:00:00 2001 From: sirius Date: Tue, 1 Oct 2019 21:01:23 +0800 Subject: [PATCH] solve the problem about disorder of frames, reason is that no glReadBuffer() before glReadPixel() --- src/engine/client/video.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/client/video.cpp b/src/engine/client/video.cpp index be5f370ce..ad5941a03 100644 --- a/src/engine/client/video.cpp +++ b/src/engine/client/video.cpp @@ -330,6 +330,7 @@ void CVideo::read_rgb_from_gl() m_pPixels = (uint8_t *)realloc(m_pPixels, nvals * sizeof(GLubyte)); m_pRGB = (uint8_t *)realloc(m_pRGB, nvals * sizeof(uint8_t)); /* Get RGBA to align to 32 bits instead of just 24 for RGB. May be faster for FFmpeg. */ + glReadBuffer(GL_FRONT); glReadPixels(0, 0, m_Width, m_Height, GL_RGB, GL_UNSIGNED_BYTE, m_pPixels); for (i = 0; i < m_Height; i++) {