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

Truncated null bytes from shader logs #12

Merged
merged 2 commits into from Apr 12, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

16 gl2.rs
@@ -622,14 +622,28 @@ pub fn get_program_iv(program: GLuint, pname: GLenum) -> GLint {
}
}

pub fn get_program_info_log(program: GLuint) -> ~str {
unsafe {
let mut result = from_elem(1024u, 0u8);
let result_len: GLsizei = 0 as GLsizei;
ll::glGetProgramInfoLog(program,
1024 as GLsizei,
to_unsafe_ptr(&result_len),
to_ptr(result) as *GLchar);
result.truncate((result_len - 1)as uint);
return from_bytes(result);
}
}

pub fn get_shader_info_log(shader: GLuint) -> ~str {
unsafe {
let result = from_elem(1024u, 0u8);
let mut result = from_elem(1024u, 0u8);
let result_len: GLsizei = 0 as GLsizei;
ll::glGetShaderInfoLog(shader,
1024 as GLsizei,
to_unsafe_ptr(&result_len),
to_ptr(result) as *GLchar);
result.truncate((result_len - 1)as uint);
return from_bytes(result);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.