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

draw_elements can't draw a element buffer object #13

Closed
robn opened this issue Apr 12, 2013 · 0 comments
Closed

draw_elements can't draw a element buffer object #13

robn opened this issue Apr 12, 2013 · 0 comments

Comments

@robn
Copy link
Contributor

@robn robn commented Apr 12, 2013

draw_elements wraps glDrawElements like so:

pub fn draw_elements(mode: GLenum, element_type: GLenum, indices: &[u8]) {
    unsafe {        
        return ll::glDrawElements(mode,
                                  indices.len() as GLsizei,
                                  element_type,
                                  cast::transmute(&indices[0]));
    }
}

However when drawing with an element (index) buffer object, you want to call glDrawElements more like:

    glDrawElements(mode, N, type, (void*) 0);

Where N is the number of elements in the buffer that's already been submitted.

draw_elements gives no way to do this that I can see.

@metajack metajack closed this in 59109b2 Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.