Nick Nougat
12-20-2002, 06:30 PM
Hi!
I want to make screenshots in my engine and I'm trying this via glReadPixels. The thing is, that when I call the function, my buffer only gets filled black pixels. I tried glReadBuffer with back and front, as well as calling the function at different rendering stages (i.e. after or before calling swapbuffers) - to no avail.
I use this:
BYTE *pData = new BYTE[m_cx * m_cy * 3];
glReadPixels(0, m_cy-1, m_cx, m_cy, GL_RGB, GL_UNSIGNED_BYTE, pData);
with m_cx and m_cy being the window sizes.
What am I doing wrong?
Thanks,
Nick
I want to make screenshots in my engine and I'm trying this via glReadPixels. The thing is, that when I call the function, my buffer only gets filled black pixels. I tried glReadBuffer with back and front, as well as calling the function at different rendering stages (i.e. after or before calling swapbuffers) - to no avail.
I use this:
BYTE *pData = new BYTE[m_cx * m_cy * 3];
glReadPixels(0, m_cy-1, m_cx, m_cy, GL_RGB, GL_UNSIGNED_BYTE, pData);
with m_cx and m_cy being the window sizes.
What am I doing wrong?
Thanks,
Nick