global_tile_mgr.render();
- xglDisable( GL_TEXTURE_2D );
- xglDisable( GL_FOG );
-
- // display HUD && Panel
- xglDisable( GL_CULL_FACE );
- fgCockpitUpdate();
-
- // We can do translucent menus, so why not. :-)
- xglEnable ( GL_BLEND ) ;
- xglBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
- puDisplay();
- xglDisable ( GL_BLEND ) ;
- xglEnable( GL_FOG );
-
// ssg test
xglMatrixMode(GL_PROJECTION);
xglLoadIdentity();
ssgSetFOV(60.0f, 0.0f);
- ssgSetNearFar(1.0f, 14000.0f);
+ ssgSetNearFar(10.0f, 14000.0f);
sgMat4 sgTRANS;
sgMakeTransMat4( sgTRANS,
// ssgSetCamera( current_view.sgVIEW );
ssgCullAndDraw( scene );
+ xglDisable( GL_TEXTURE_2D );
+ xglDisable( GL_FOG );
+
+ // display HUD && Panel
+ xglDisable( GL_CULL_FACE );
+ fgCockpitUpdate();
+
+ // We can do translucent menus, so why not. :-)
+ xglEnable ( GL_BLEND ) ;
+ xglBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ puDisplay();
+ xglDisable ( GL_BLEND ) ;
+ xglEnable( GL_FOG );
+
}
xglutSwapBuffers();
inline bool is_loaded() const { return loaded; }
inline GLuint get_texture_id() const { return texture_id; }
+ inline string get_texture_name() const { return texture_name; }
inline double get_xsize() const { return xsize; }
inline double get_ysize() const { return ysize; }
inline GLfloat *get_ambient() { return ambient; }
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
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;
}
}
// size_t list_size;
// ssg stage structure
- ssgSimpleState state;
+ ssgSimpleState *state;
bool state_valid;
public:
inline void set_m( FGMaterial new_m ) { m = new_m; }
// ssg state
- inline ssgSimpleState *get_state() { return &state; }
- inline void set_state( ssgSimpleState s ) { state = s; }
+ inline ssgSimpleState *get_state() { return state; }
+ inline void set_state( ssgSimpleState *s ) { state = s; }
inline bool get_state_valid() const { return state_valid; }
inline void set_state_valid( bool flag ) { state_valid = flag; }
};