Changeset 233 for trunk/src/gl


Ignore:
Timestamp:
05/12/14 16:49:24 (11 years ago)
Author:
epyon
Message:
  • polygon_mode added to context and gl context implementation
Location:
trunk/src/gl
Files:
2 edited

Legend:

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

    r198 r233  
    171171}
    172172
     173void gl_context::apply_polygon_mode( const polygon_mode& mode )
     174{
     175        if ( m_render_state.polygon_mode.fill != mode.fill )
     176        {
     177                glPolygonMode( GL_FRONT_AND_BACK, polygon_mode_fill_to_enum( mode.fill ) );
     178                m_render_state.polygon_mode.fill = mode.fill;
     179        }
     180}
     181
     182
    173183void gl_context::apply_depth_range( const depth_range& range )
    174184{
     
    316326                state.color_mask.blue, state.color_mask.alpha
    317327        );
     328        glPolygonMode( GL_FRONT_AND_BACK, polygon_mode_fill_to_enum( state.polygon_mode.fill ) );
    318329}
    319330
     
    347358        apply_color_mask( state.color_mask );
    348359        apply_depth_mask( state.depth_mask );
     360        apply_polygon_mode( state.polygon_mode );
    349361}
    350362
  • trunk/src/gl/gl_enum.cc

    r121 r233  
    3333        }
    3434}
     35
     36unsigned int nv::polygon_mode_fill_to_enum( polygon_mode::fill_type type )
     37{
     38        switch( type )
     39        {
     40        case polygon_mode::FILL           : return GL_FILL;
     41        case polygon_mode::LINE           : return GL_LINE;
     42        case polygon_mode::POINT          : return GL_POINT;
     43        NV_RETURN_COVERED_DEFAULT( 0 );
     44        }
     45}
     46
     47
    3548
    3649unsigned int nv::blending_factor_to_enum( blending::factor type )
Note: See TracChangeset for help on using the changeset viewer.