Index: configure
===================================================================
--- configure	(revision 171)
+++ configure	(revision 172)
@@ -196,36 +196,36 @@
 exit_if_error "$?" "You must install glu-devel package"
 
 # Test GLUT
-echo -n "* GLUT lib :"
+#echo -n "* GLUT lib :"
 
-file='#include <GL/glut.h>
-int main(void) { gluGetString(GLU_VERSION); return 0; }'
-test_build "$file" "-L/usr/X11R6/lib/ -lGL -lGLU -lglut"
-exit_if_error "$?" "You must install glut-devel package"
+#file='#include <GL/glut.h>
+#int main(void) { gluGetString(GLU_VERSION); return 0; }'
+#test_build "$file" "-L/usr/X11R6/lib/ -lGL -lGLU -lglut"
+#exit_if_error "$?" "You must install glut-devel package"
 
 # Full GL/GLU/Glut test, looking for hardware accel
-echo -n "* GL/GLU/GLUT and hardware support :"
+#echo -n "* GL/GLU/GLUT and hardware support :"
 
-file='
+#file='
 #include <stdio.h>
-#include <string.h>
-#include <GL/glut.h>
-int main(int argc, char **argv) { 
-char *r;
-glutInit(&argc,argv);
-glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
-glutInitWindowSize(320,240);
-glutCreateWindow("Test window");
-r=glGetString(GL_RENDERER);
-if(!strcmp(r,"Mesa GLX Indirect"))
-    {
-    fprintf(stderr,"WARNING ! Mesa Software renderer detected !");
-    fprintf(stdout,"WARNING ! Mesa Software renderer detected !");
-    }
-return 0; }
-'
-test_build "$file" "-L/usr/X11R6/lib/ -lGL -lglut -lGLU"
-exit_if_error "$?" "Full GL test faild, see configure.log"
+##include <string.h>
+##include <GL/glut.h>
+#int main(int argc, char **argv) { 
+#char *r;
+#glutInit(&argc,argv);
+#glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
+#glutInitWindowSize(320,240);
+#glutCreateWindow("Test window");
+#r=glGetString(GL_RENDERER);
+#if(!strcmp(r,"Mesa GLX Indirect"))
+#    {
+#    fprintf(stderr,"WARNING ! Mesa Software renderer detected !");
+#    fprintf(stdout,"WARNING ! Mesa Software renderer detected !");
+#    }
+#return 0; }
+#'
+#test_build "$file" "-L/usr/X11R6/lib/ -lGL -lglut -lGLU"
+#exit_if_error "$?" "Full GL test faild, see configure.log"
 
 # OpenAL
 echo -n "* OpenAL :"
 			currentradious		=	raydium_trigo_sin(180*((float)i/(float)detail));
 			//getting the heights for each section of the sphere
-			z1					=	raydium_trigo_cos(180*((float)i/(float)detail));		
+			z1	 		=	raydium_trigo_cos(180*((float)i/(float)detail));		
 			for(j=0;j<=detail;j++)
 			{
 				ang1		=	360*((float)j/(float)detail);
@@ -167,19 +186,127 @@
 		raydium_sky_sphere_generated	=	1;
 	}
 
-	//locating the modelview in the pos of the camera
+	//Postioning the modelview in the pos of the camera
 	glTranslatef(x,y,z);
+
+	//test code
+	//the texture should be loaded with a different function
+	if(!raydium_texture_exists("SKYCLOUDS.tga"))
+	{
+		raydium_texture_load("SKYCLOUDS.tga");
+	}
+	raydium_texture_current_set_name("SKYCLOUDS.tga");	
+	
+	//activating texture 
+	raydium_rendering_internal_prepare_texture_render(raydium_texture_current_main);
+	
+	//shutdown the DEPTH writting
+	glDepthMask(GL_FALSE);
+
+	//activating and setting fog
+	raydium_fog_enable();
+	glFogf(GL_FOG_START,0.6);
+	glFogf(GL_FOG_END,1);
+	glFogi(GL_FOG_MODE,GL_EXP2);
+	
+	//setting h to the height of the vault
+	h=raydium_sky_sphere_heigth;
+
+	//activating the blending needed for the clouds
+	glEnable(GL_BLEND);
+	glBlendFunc(GL_DST_COLOR,GL_ONE_MINUS_SRC_ALPHA);
+
+	//drawing the layers of clouds
+	for(co=0;co<raydium_sky_sphere_quality;co++)
+	{
+		//drawing the upper vault		
+		
+		glBegin(GL_TRIANGLES);
+		glColor4f(1,1,1,1*(co/raydium_sky_sphere_quality));
+		glTexCoord2f(-1+dx,1+dy);
+		glVertex3f(-1,1,0);
+		glTexCoord2f(1+dx,1+dy);
+		glVertex3f(1,1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+	
+		glTexCoord2f(1+dx,1+dy);
+		glVertex3f(1,1,0);
+		glTexCoord2f(1+dx,-1+dy);
+		glVertex3f(1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+	
+		glTexCoord2f(1+dx,-1+dy);
+		glVertex3f(1,-1,0);
+		glTexCoord2f(-1+dx,-1+dy);
+		glVertex3f(-1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);	
+	
+		glTexCoord2f(-1+dx,1+dy);
+		glVertex3f(-1,1,0);
+		glTexCoord2f(-1+dx,-1+dy);
+		glVertex3f(-1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+		
+		//drawing the botom vault, mirror of the upper one
+		h=-h;
+		
+		//glColor4f(1,1,1,1);
+		glTexCoord2f(-1+dx,1+dy);
+		glVertex3f(-1,1,0);
+		glTexCoord2f(1+dx,1+dy);
+		glVertex3f(1,1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+	
+		glTexCoord2f(1+dx,1+dy);
+		glVertex3f(1,1,0);
+		glTexCoord2f(1+dx,-1+dy);
+		glVertex3f(1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+	
+		glTexCoord2f(1+dx,-1+dy);
+		glVertex3f(1,-1,0);
+		glTexCoord2f(-1+dx,-1+dy);
+		glVertex3f(-1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);	
+	
+		glTexCoord2f(-1+dx,1+dy);
+		glVertex3f(-1,1,0);
+		glTexCoord2f(-1+dx,-1+dy);
+		glVertex3f(-1,-1,0);
+		glTexCoord2f(0+dx,0+dy);
+		glVertex3f(0,0,h);
+		glEnd();
+	
+		//recalculating the new heigth of the vault(a new layer)
+		h=-h*0.95;	
+	}
+
+	//deactivating the fog, unused
+	raydium_fog_disable();
+	//reactivating the previous blending
+	glEnable(GL_BLEND);
+	glBlendFunc(GL_ONE_MINUS_SRC_COLOR,GL_SRC_COLOR);
+
+	//match the orientation of the camera with the universe
 	//rotating according the orbit angles(ugly)
 	glRotatef(raydium_sky_sphere_angle_orbit_v,0,0,1);
 	glRotatef(raydium_sky_sphere_angle_orbit_u,1,0,0);
-	//now drawing with the obtained values
+
+	//now drawing the sphere with the pre-obtained values
 	for(i=0;i<detail;i++)
 	{
 		for(j=0;j<detail;j++)
 		{
 			//calculating colors
-			z1	=	1-(float)i/detail;
-			z2	=	1-(float)(i+1)/detail;
+			z1 = 1-sin((float)2*i/detail);
+			z2 = 1-sin((float)(2*i+2)/detail);
 			
 			glBegin(GL_TRIANGLES);
 			
@@ -198,7 +325,7 @@
 			glColor4f(z2,z2,z2,1);
 			glVertex3f(p[i+1][j+1][0],p[i+1][j+1][1],p[i+1][j+1][2]);
 			
-			glColor4f(z1,z1,z1,z1);
+			glColor4f(z1,z1,z1,1);
 			glVertex3f(p[i][j+1][0],p[i][j+1][1],p[i][j+1][2]);
 			
 			glEnd();
@@ -214,14 +341,17 @@
 	glDepthMask(GL_TRUE);
 	//glPopAttrib();
 	glPopMatrix();
+
 }
 
 void raydium_sky_atmosphere_enable(void)
 {
 	raydium_sky_atmosphere_enable_tag=1;
+	raydium_sky_sphere_quality=20;
+	raydium_sky_sphere_heigth=0.09;
 	//this will force to recalculate the sphere once
 	raydium_sky_sphere_generated=0;
-	raydium_log("atmosphere created");
+	raydium_log("atmosphere created with quality 20");
 }
 
 void raydium_sky_atmosphere_disable(void)