Changeset 108 for trunk/src/gl


Ignore:
Timestamp:
06/05/13 17:19:34 (12 years ago)
Author:
epyon
Message:
  • gui_common.hh - render_data did not have virtual destructor - fixed
  • position.hh - fixed comparison operators (were not const)
  • gl_context - draw will not be done if count = 0 (state will be applied though?)
  • gl_context - unpack alignment set to 1 (possibly not needed if careful)
File:
1 edited

Legend:

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

    r64 r108  
    351351gl_context::gl_context()
    352352{
     353        // TODO: do we really need this?
     354        glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
    353355        force_apply_render_state( m_render_state );
    354356}
     
    357359{
    358360        apply_render_state( rs );
    359         p->bind();
    360         va->bind();
    361         glDrawArrays( primitive_to_enum(prim), 0, count);
    362         va->unbind();
    363         p->unbind();
    364 }
     361        if ( count > 0 )
     362        {
     363                p->bind();
     364                va->bind();
     365                glDrawArrays( primitive_to_enum(prim), 0, count);
     366                va->unbind();
     367                p->unbind();
     368        }
     369}
Note: See TracChangeset for help on using the changeset viewer.