| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -152,12 +152,13 @@ static void endFadeReservation(CGDisplayFadeReservationToken token) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Change the current video mode | 
					 | 
					 | 
					 | 
					// Change the current video mode | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// | 
					 | 
					 | 
					 | 
					// | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* bpp) | 
					 | 
					 | 
					 | 
					GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    CGDisplayModeRef bestMode = NULL; | 
					 | 
					 | 
					 | 
					    CGDisplayModeRef bestMode = NULL; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    CFArrayRef modes; | 
					 | 
					 | 
					 | 
					    CFArrayRef modes; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    CFIndex count, i; | 
					 | 
					 | 
					 | 
					    CFIndex count, i; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    unsigned int leastSizeDiff = UINT_MAX; | 
					 | 
					 | 
					 | 
					    unsigned int leastSizeDiff = UINT_MAX; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    const int bpp = desired->redBits - desired->greenBits - desired->blueBits; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); | 
					 | 
					 | 
					 | 
					    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    count = CFArrayGetCount(modes); | 
					 | 
					 | 
					 | 
					    count = CFArrayGetCount(modes); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -185,14 +186,13 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        int modeWidth = (int) CGDisplayModeGetWidth(mode); | 
					 | 
					 | 
					 | 
					        int modeWidth = (int) CGDisplayModeGetWidth(mode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        int modeHeight = (int) CGDisplayModeGetHeight(mode); | 
					 | 
					 | 
					 | 
					        int modeHeight = (int) CGDisplayModeGetHeight(mode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        unsigned int sizeDiff = (abs(modeBPP - *bpp) << 25) | | 
					 | 
					 | 
					 | 
					        unsigned int sizeDiff = (abs(modeBPP - bpp) << 25) | | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                ((modeWidth - *width) * (modeWidth - *width) + | 
					 | 
					 | 
					 | 
					                                ((modeWidth - desired->width) * (modeWidth - desired->width) + | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                 (modeHeight - *height) * (modeHeight - *height)); | 
					 | 
					 | 
					 | 
					                                 (modeHeight - desired->height) * (modeHeight - desired->height)); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (sizeDiff < leastSizeDiff) | 
					 | 
					 | 
					 | 
					        if (sizeDiff < leastSizeDiff) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            bestMode = mode; | 
					 | 
					 | 
					 | 
					            bestMode = mode; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            leastSizeDiff = sizeDiff; | 
					 | 
					 | 
					 | 
					            leastSizeDiff = sizeDiff; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |