opengl - glReadPixels: Stack around variable was corrupted after read pixels -
i trying utilize glreadpixels() read window of 5 * 5 pixels. here code.
const unsigned int window_size = 5; const unsigned int nb_components = 3; glubyte array[nb_components * window_size * window_size]; glreadpixels( 0, 0, window_size, window_size, gl_rgb, gl_unsigned_byte, array);
yet code causes next error in visual studio: "stack around variable array corrupted"
if add together +4 size of array works fine. knows why?
since you're using gl_rgb
create sure gl_pack_alignment
set 1
.
opengl stack glreadpixels
No comments:
Post a Comment