Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress alignment padding from glReadPixels #58

Merged
merged 2 commits into from Nov 2, 2013
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Suppress alignment padding from glReadPixels

This was causing the driver to write past the end of our vector.
  • Loading branch information
kmcallister committed Nov 2, 2013
commit 8079db11fa7ea94a6e46b212bc196780bcfca14b
2 gl2.rs
@@ -934,6 +934,8 @@ pub fn read_pixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format:

do pixels.as_mut_buf |buf, _| {
unsafe {
// We don't want any alignment padding on pixel rows.
glPixelStorei(PACK_ALIGNMENT, 1);
glReadPixels(x, y, width, height, format, pixel_type, buf as *mut c_void);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.