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 vertex array gen/binding and glPolygonMode #24

Merged
merged 2 commits into from Apr 26, 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

Next

Added gen and bind vertex arrays

  • Loading branch information
Jeaye
Jeaye committed Apr 21, 2013
commit 701526c00bc5b35a55df8e02c392dee3e4b3fd58
18 gl2.rs
@@ -388,6 +388,12 @@ pub fn bind_texture(target: GLenum, texture: GLuint) {
}
}

pub fn bind_vertex_array(array: GLuint) {
unsafe {
ll::glBindVertexArray(array);
}
}

pub fn blend_color(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
unsafe {
ll::glBlendColor(red, green, blue, alpha);
@@ -633,6 +639,14 @@ pub fn gen_textures(n: GLsizei) -> ~[GLuint] {
}
}

pub fn gen_vertex_arrays(n: GLsizei) -> ~[GLuint] {
unsafe {
let result = from_elem(n as uint, 0 as GLuint);
ll::glGenVertexArrays(n, to_ptr(result));
return result;
}
}

pub fn get_attrib_location(program: GLuint, name: ~str) -> c_int {
unsafe {
return as_c_str(name, |name_bytes|
@@ -939,6 +953,8 @@ pub fn glBindRenderbuffer(++target: GLenum, ++renderbuffer: GLuint);

pub fn glBindTexture(++target: GLenum, ++texture: GLuint);

pub fn glBindVertexArray(++array: GLuint);

pub fn glBlendColor(++red: GLclampf, ++green: GLclampf, ++blue: GLclampf, ++alpha: GLclampf);

pub fn glBlendEquation(++mode: GLenum);
@@ -1035,6 +1051,8 @@ pub fn glGenRenderbuffers(++n: GLsizei, ++renderbuffers: *GLuint);

pub fn glGenTextures(++n: GLsizei, ++textures: *GLuint);

pub fn glGenVertexArrays(++n: GLsizei, arrays: *GLuint);

pub fn glGetActiveAttrib(++program: GLuint, ++index: GLuint, ++bufsize: GLsizei, ++length: *GLsizei, ++size: *GLint, ++_type: *GLenum, ++name: *GLchar);

pub fn glGetActiveUniform(++program: GLuint, ++index: GLuint, ++bufsize: GLsizei, ++length: *GLsizei, ++size: *GLint, ++_type: *GLenum, ++name: *GLchar);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.