this doesn't crash in my case. so check your allocation and deallocation, check "w" and "h" values twice, if it's ok - something is wrong with surrounding code(and you, probably, should submit some to get help).

Cucus

07-22-2011, 12:20 PM

It's very weird, it seems that when I call glReadPixels, it flushes all variables.

So before calling the function, sizeof(data)>0 but after, sizeof(data) is 0......

Kelvin

07-22-2011, 05:00 PM

You might need some padding for the width, or adjust the packing with glPixelStorei. Data returned by glReadPixels isn't byte-packed by default.