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

Added disable and tex_sub_image_2d #18

Merged
merged 1 commit into from Apr 16, 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

33 gl2.rs
@@ -549,6 +549,12 @@ pub fn enable(cap: GLenum) {
}
}

pub fn disable(cap: GLenum) {
unsafe {
ll::glDisable(cap);
}
}

pub fn enable_vertex_attrib_array(index: GLuint) {
unsafe {
ll::glEnableVertexAttribArray(index);
@@ -726,6 +732,33 @@ pub fn tex_image_2d(target: GLenum,
}
}

// FIXME: Does not verify buffer size -- unsafe!
pub fn tex_sub_image_2d(target: GLenum,
level: GLint,
xoffset: GLint,
yoffset: GLint,
width: GLsizei,
height: GLsizei,
format: GLenum,
ty: GLenum,
opt_data: Option<&[u8]>) {
match opt_data {
Some(data) => {
unsafe {
let pdata = transmute(to_ptr(data));
ll::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty,
pdata);
}
}
None => {
unsafe {
ll::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty,
ptr::null());
}
}
}
}

pub fn tex_parameter_i(target: GLenum, pname: GLenum, param: GLint) {
unsafe {
ll::glTexParameteri(target, pname, param);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.