Browse Source
			
			
			[Examples] set FPS to 60 (#4235)
			
				* set FPS to 60
* remove extra commented lines
			
			
				pull/4247/head
			
			
		 
		
			
				
					
						
						Anthony Carbajal
					
					1 year ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: B5690EEEBB952194
				  	
				  
				
			
		
		
		
	
		
			  7 changed files with 
14 additions and 
3 deletions
			
		 
		
			
				- 
					
					
					 
					examples/core/core_vr_simulator.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_blend_modes.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_image_rotate.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_logo_raylib.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_raw_data.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_sprite_explosion.c
				
 
			
				- 
					
					
					 
					examples/textures/textures_to_image.c
				
 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -100,7 +100,7 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    DisableCursor();                    // Limit cursor to relative movement inside the window | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(90);                   // Set our game to run at 90 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);                   // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //-------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -43,6 +43,9 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    const int blendCountMax = 4; | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    BlendMode blendMode = 0; | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    while (!WindowShouldClose())    // Detect window close button or ESC key | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    { | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -43,6 +43,8 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    textures[2] = LoadTextureFromImage(imageNeg90); | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    int currentTexture = 0; | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -27,6 +27,8 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    Texture2D texture = LoadTexture("resources/raylib_logo.png");        // Texture loading | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -63,6 +63,8 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    Texture2D checked = LoadTextureFromImage(checkedIm); | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    UnloadImage(checkedIm);         // Unload CPU (RAM) image data (pixels) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -48,8 +48,8 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    bool active = false; | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    int framesCounter = 0; | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(120); | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //-------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    while (!WindowShouldClose())    // Detect window close button or ESC key | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 | 
			
		
		
	
											
										
									
								
							 
						
					 
				 
			
		
		
			
				
					
					
						
							
								
									
										
											
												
	
		
			
				| 
				
				
					
						
					
				
				
				 | 
			
			 | 
			
			@ -38,6 +38,8 @@ int main(void) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    texture = LoadTextureFromImage(image);                 // Recreate texture from retrieved image data (RAM -> VRAM) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    UnloadImage(image);                                    // Unload retrieved image data from CPU memory (RAM) | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    //--------------------------------------------------------------------------------------- | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			
 | 
			
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
			    // Main game loop | 
			
		
		
	
	
		
			
				| 
				
					
						
					
				
				
				
				 | 
			
			 | 
			
			
 |