- Timestamp:
- 05/12/14 16:49:24 (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/gl/gl_context.hh
r171 r233 40 40 void apply_blending( const blending& blend ); 41 41 void apply_culling( const culling& cull ); 42 void apply_polygon_mode( const polygon_mode& mode ); 42 43 void enable( unsigned int what, bool value ); 43 44 -
trunk/nv/gl/gl_enum.hh
r214 r233 25 25 unsigned int clear_state_buffers_to_mask( clear_state::buffers_type type ); 26 26 unsigned int depth_state_function_to_enum( depth_test::function_type type ); 27 unsigned int polygon_mode_fill_to_enum( polygon_mode::fill_type type ); 27 28 unsigned int blending_factor_to_enum( blending::factor type ); 28 29 unsigned int blending_equation_to_enum( blending::equation type ); -
trunk/nv/interface/render_state.hh
r214 r233 39 39 40 40 depth_test() : enabled( true ), function( LESS ) {} 41 }; 42 43 struct polygon_mode 44 { 45 enum fill_type 46 { 47 POINT, 48 LINE, 49 FILL 50 }; 51 52 fill_type fill; 53 54 polygon_mode() : fill( FILL ) {} 41 55 }; 42 56 … … 183 197 nv::culling culling; 184 198 nv::color_mask color_mask; 199 nv::polygon_mode polygon_mode; 185 200 bool depth_mask; 186 201 }; -
trunk/src/gl/gl_context.cc
r198 r233 171 171 } 172 172 173 void 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 173 183 void gl_context::apply_depth_range( const depth_range& range ) 174 184 { … … 316 326 state.color_mask.blue, state.color_mask.alpha 317 327 ); 328 glPolygonMode( GL_FRONT_AND_BACK, polygon_mode_fill_to_enum( state.polygon_mode.fill ) ); 318 329 } 319 330 … … 347 358 apply_color_mask( state.color_mask ); 348 359 apply_depth_mask( state.depth_mask ); 360 apply_polygon_mode( state.polygon_mode ); 349 361 } 350 362 -
trunk/src/gl/gl_enum.cc
r121 r233 33 33 } 34 34 } 35 36 unsigned 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 35 48 36 49 unsigned int nv::blending_factor_to_enum( blending::factor type )
Note: See TracChangeset
for help on using the changeset viewer.