void Frigate2D::draw( ){
	keel  .draw( *this );
	rudder.draw( *this );
	mast  .draw( *this );
	if( left_guns != NULL ){
		//printf( " plotting guns \n" );
		for( int i=0; i<nguns; i++ ){
			drawGun( left_guns [i] );
			drawGun( right_guns[i] );
		};
	}
}
示例#2
0
void Render_Gioco(void){

	float tmp;
	
	pointer_pos=cursor_position();

	glutSetCursor(GLUT_CURSOR_NONE);
  
	glDisable(GL_FOG);

    drawSkybox();
	drawGun();
	drawBullet();
    drawScore();
	
    glPushMatrix();
    gluLookAt(0.f,0.f,3.f,0.f,0.f,-5.f,0.f,1.f,0.f);

	tmp = 0.0536414;
	glScalef(tmp, tmp, tmp);
    
	glTranslated(-xpos,0.0f,0.0f);
	
	//SPOSTAMENTO DELLA CAMERA:
	float xx=9,yy=0,zz=42;
	glTranslatef(xx,yy,zz);
	glRotatef(main_camera.getLocRot().y_rot,0.0f,1.0f,0.0f);

	glTranslatef(-xx,-yy,-zz);
	//translo la camera (in realta' translo tutto il resto)
	glTranslatef(main_camera.getLocRot().x, main_camera.getLocRot().y, main_camera.getLocRot().z);


	//Fog----------------------

	glFogi(GL_FOG_MODE, GL_LINEAR);					// Fog Mode
	GLfloat fogColor[4]= {0.6f, 0.5f, 0.3f, 1.0f};
	glFogfv(GL_FOG_COLOR, fogColor);				// Set Fog Color
	glFogf(GL_FOG_DENSITY, 0.45f);					// How Dense Will The Fog Be
	glHint(GL_FOG_HINT, GL_DONT_CARE);				// Fog Hint Value
	glFogf(GL_FOG_START, 3.5f);						// Fog Start Depth
	glFogf(GL_FOG_END, 6.0f);						// Fog End Depth
	glEnable(GL_FOG);								// Enables GL_FOG
	
	//-------------------------

	if(first == TRUE){
		scene_list_case=glGenLists(4);
		scene_list_target=glGenLists(10);
		lista_case(scene_list_case,level1_scene.scene,level2_scene.scene,level3_scene.scene,terreno_scene.scene);
		lista_target(scene_list_target,target_scene.scene);
		pos=scegli_pos(livello,livelli);
		first = FALSE;
	}

	if(m[pos].stato==2){
        m[pos]=reset_motion(m[pos]);
        pos=scegli_pos(livello,livelli);
    }
       
	ch=render_target(livello,scene_list_target,pos,livelli,m[pos],ch,t.v);
	render_case(livello,scene_list_case);

	if(!pause)t=count_time(t);

	m[pos]=scegli_mov(m[pos],livelli,pos,t.tempoi, t.v, ch_index,ch);
    
    glPopMatrix();

	drawPointer(pointer_pos);

	if(pause) DrawMenu(0,0,menuArray[5],true);

}