Logo Search packages:      
Sourcecode: qcake version File versions  Download package

void Glcontrol::paintGL (  )  [protected]

Paint the box. The actual openGL commands for drawing the box are performed here.

Definition at line 783 of file glcontrol.cpp.

{
  sgCoord campos ;

  my_context->makeCurrent();

  glClear  ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ;
  glDisable ( GL_FOG ) ;
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glEnable ( GL_BLEND ) ;

  update_motion () ;

  if(gl_fog){ 
    glEnable ( GL_FOG ) ;
  }
  if(gl_sky_obj[0] != NULL){
    // Sky Fog
    /* Adjust fog based on visibility (when in clouds) */
    glClearColor ( fog_color[0], fog_color[1], fog_color[2], fog_color[3] ) ;
    glClear  ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ;
    GLfloat fog_exp2_density = sqrt_m_log01 / gl_sky_obj[0]->getVisibility();
    glEnable( GL_FOG );
    glFogf  ( GL_FOG_DENSITY, fog_exp2_density);
    glFogi  ( GL_FOG_MODE,    GL_EXP2 );
    glFogfv ( GL_FOG_COLOR,   fog_color );
  
    // we need a white diffuse light for the phase of the moon
    ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, mywhite );
    gl_sky_obj[0] -> preDraw  ( );
    // return to the desired diffuse color
    ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, scene_diffuse );
    
  }
//  if(scene)
//  {
    ssgCullAndDraw ( scene ) ;
//  }
  if(gl_sky_obj[0] != NULL){
    my_context->getCameraPosition ( campos.xyz );
    gl_sky_obj[0] -> postDraw ( campos.xyz[SG_Z] ); /* altitude */
    glDisable ( GL_FOG ) ;
  }
  if(gl_fog){
    glDisable ( GL_FOG ) ;
  }
  puDisplay () ;
}


Generated by  Doxygen 1.6.0   Back to index