Пример #1
0
// ----------------------------------------------------------------------------
void
vertex_buffer_render ( vertex_buffer_t *self, GLenum mode )
{
    size_t vcount = self->vertices->size;
    size_t icount = self->indices->size;

    vertex_buffer_render_setup( self, mode );

    if( icount )
    {
        glDrawElements( mode, icount, GL_UNSIGNED_SHORT, 0 );

        if (DEBUG_GL_ERRORS) {
            vertex_buffer_show_gl_errors("vertex_buffer_render() glDrawElements");
        }
    }
    else
    {
        glDrawArrays( mode, 0, vcount );

        if (DEBUG_GL_ERRORS) {
            vertex_buffer_show_gl_errors("vertex_buffer_render() glDrawArrays");
        }
    }


    vertex_buffer_render_finish( self );
}
Пример #2
0
// ----------------------------------------------------------------------------
void
vertex_buffer_render ( vertex_buffer_t *self, GLenum mode )
{
    size_t vcount = self->vertices->size;
    size_t icount = self->indices->size;

    vertex_buffer_render_setup( self, mode );
    if( icount )
    {
        glDrawElements( mode, icount, GL_UNSIGNED_SHORT, 0 );
    }
    else
    {
        glDrawArrays( mode, 0, vcount );
    }
    vertex_buffer_render_finish( self );
}
Пример #3
0
// ----------------------------------------------------------------------------
void
vertex_buffer_render ( vertex_buffer_t *self, GLenum mode )
{
    size_t vcount = self->vertices->size;
    size_t icount = self->indices->size;

    vertex_buffer_render_setup( self, mode );
    if( icount )
    {
        glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, self->indices_id );
        glDrawElements( mode, icount, GL_UNSIGNED_INT, 0 );
    }
    else
    {
        glDrawArrays( mode, 0, vcount );
    }
    vertex_buffer_render_finish( self );
}