rotation depending of time
This commit is contained in:
		
							parent
							
								
									305a814484
								
							
						
					
					
						commit
						9704be8cdb
					
				
							
								
								
									
										7
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								window.c
									
									
									
									
									
								
							@ -118,6 +118,11 @@ void init(void) {
 | 
			
		||||
/*!\brief la fonction appelée à chaque display. */
 | 
			
		||||
void draw(void) {
 | 
			
		||||
	static float a = 0.0f;
 | 
			
		||||
	static Uint32 t0 = 0;
 | 
			
		||||
	GLfloat dt = 0.0;
 | 
			
		||||
	Uint32 t;
 | 
			
		||||
	dt = ((t = SDL_GetTicks()) - t0) / 10000.0;
 | 
			
		||||
	t0 = t;
 | 
			
		||||
	float mvMat[16], projMat[16], nmv[16];
 | 
			
		||||
	/* effacer l'écran et le buffer de profondeur */
 | 
			
		||||
	gl4dpClearScreen();
 | 
			
		||||
@ -146,7 +151,7 @@ void draw(void) {
 | 
			
		||||
	gl4dpScreenHasChanged();
 | 
			
		||||
	/* fonction permettant de raffraîchir l'ensemble de la fenêtre*/
 | 
			
		||||
	gl4dpUpdateScreen(NULL);
 | 
			
		||||
	a += 0.1f;
 | 
			
		||||
	a += 360 * dt;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*!\brief intercepte l'événement clavier pour modifier les options. */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user