Changeset 116 for trunk/src/gl


Ignore:
Timestamp:
06/11/13 22:33:08 (12 years ago)
Author:
epyon
Message:
  • support for indexed arrays
Location:
trunk/src/gl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_context.cc

    r108 r116  
    363363                p->bind();
    364364                va->bind();
    365                 glDrawArrays( primitive_to_enum(prim), 0, count);
     365                if ( va->has_index_buffer() )
     366                {
     367                        glDrawElements( primitive_to_enum(prim), count, datatype_to_gl_enum( va->get_index_buffer_type() ), 0 );
     368                }
     369                else
     370                {
     371                        glDrawArrays( primitive_to_enum(prim), 0, count);
     372                }
    366373                va->unbind();
    367374                p->unbind();
  • trunk/src/gl/gl_vertex_buffer.cc

    r100 r116  
    9292        }
    9393
     94        if ( m_index )
     95        {
     96                m_index->bind();
     97        }
    9498}
    9599
    96100void gl_vertex_array::unbind()
    97101{
     102        if ( m_index )
     103        {
     104                m_index->unbind();
     105        }
     106
    98107        for ( vertex_buffer_attribute_map::iterator i = m_map.begin();  i != m_map.end(); ++i )
    99108        {
Note: See TracChangeset for help on using the changeset viewer.