mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed screenshot bug. Closes #144
This commit is contained in:
parent
9130c91841
commit
29d29df4f0
|
@ -422,7 +422,11 @@ void CGraphics_OpenGL::ScreenshotDirect(const char *pFilename)
|
|||
int h = m_ScreenHeight;
|
||||
unsigned char *pPixelData = (unsigned char *)mem_alloc(w*(h+1)*3, 1);
|
||||
unsigned char *pTempRow = pPixelData+w*h*3;
|
||||
GLint Alignment;
|
||||
glGetIntegerv(GL_PACK_ALIGNMENT, &Alignment);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glReadPixels(0,0, w, h, GL_RGB, GL_UNSIGNED_BYTE, pPixelData);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, Alignment);
|
||||
|
||||
// flip the pixel because opengl works from bottom left corner
|
||||
for(y = 0; y < h/2; y++)
|
||||
|
|
Loading…
Reference in a new issue