void
FGMaterialSlot::render_fragments()
{
+ FG_LOG( FG_GENERAL, FG_ALERT,
+ "FGMaterialSlot::render_fragments() is depricated ... " <<
+ "we shouldn't be here!" );
+
int tris_rendered = current_view.get_tris_rendered();
// cout << "rendering " + texture_name + " = " << list_size << "\n";
if ( !m.is_loaded() ) {
m.load_texture( current_options.get_fg_root() );
-
- // build the ssgSimpleState
- GLuint tex_id = m.get_texture_id();
- state.setTexture( tex_id );
- state.enable( GL_TEXTURE_2D );
- state.enable( GL_LIGHTING );
- state.setShadeModel( GL_SMOOTH );
- state.enable ( GL_CULL_FACE ) ;
- state.setMaterial ( GL_AMBIENT_AND_DIFFUSE, 1, 1, 1, 1 ) ;
}
#ifdef GL_VERSION_1_1
// Woohoo!!! We finally get to draw something!
// printf(" display_list = %d\n", frag_ptr->display_list);
- xglCallList( frag_ptr->display_list );
+ // xglCallList( frag_ptr->display_list );
}
current_view.set_tris_rendered( tris_rendered );
mpath.append( "materials" );
fg_gzifstream in( mpath.str() );
- if ( ! in ) {
+ if ( ! in.is_open() ) {
FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << mpath.str() );
exit(-1);
}
+#ifndef __MWERKS__
while ( ! in.eof() ) {
+#else
+ char c = '\0';
+ while ( in.get(c) && c != '\0' ) {
+ in.putback(c);
+#endif
// printf("%s", line);
// strip leading white space and comments
FGMaterial m;
in >> m;
- // if ( current_options.get_textures() ) {
- // m.load_texture( current_options.get_fg_root() );
- // }
-
FGMaterialSlot m_slot;
m_slot.set_m( m );
+
+ // build the ssgSimpleState
+ FGPath tex_file( current_options.get_fg_root() );
+ tex_file.append( "Textures" );
+ tex_file.append( m.get_texture_name() );
+ tex_file.concat( ".rgb" );
+
+ ssgSimpleState *state = new ssgSimpleState;
+ state->setTexture( tex_file.c_str() );
+ state->enable( GL_TEXTURE_2D );
+ state->enable( GL_LIGHTING );
+ state->setShadeModel( GL_SMOOTH );
+ state->enable ( GL_CULL_FACE ) ;
+ state->setMaterial ( GL_AMBIENT_AND_DIFFUSE, 1, 1, 1, 1 ) ;
+ m_slot.set_state( state );
+
material_mgr.material_map[material_name] = m_slot;
}
}