Changeset 108 for trunk


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)
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/gui/gui_common.hh

    r69 r108  
    3333                {
    3434                public:
    35                         ~render_data(){}
     35                        virtual ~render_data(){}
    3636                };
    3737
    3838                class element;
    3939                class environment;
     40                class renderer;
    4041
    4142        } // namespace gui
  • trunk/nv/position.hh

    r97 r108  
    5959                rectangle& operator-=( const position& pos ) { ul -= pos; lr -= pos; return (*this); }
    6060                rectangle operator-( const position& pos ) const {      rectangle r(*this); return r -= pos; }
    61                 bool operator==( const rectangle& r ) { return r.ul == ul && r.lr == lr; }
    62                 bool operator!=( const rectangle& r ) { return r.ul != ul || r.lr != lr; }
     61                bool operator==( const rectangle& r ) const { return r.ul == ul && r.lr == lr; }
     62                bool operator!=( const rectangle& r ) const { return r.ul != ul || r.lr != lr; }
    6363
    6464                bool contains( const position& r ) const{ return y2 >= r.y && y1 <= r.y && x2 >= r.x && x1 <= r.x; }
  • 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.