mirror of
				https://github.com/glfw/glfw.git
				synced 2025-11-04 14:16:42 +00:00 
			
		
		
		
	Added output of DPI.
This commit is contained in:
		
							parent
							
								
									da31167193
								
							
						
					
					
						commit
						dd941f5ae8
					
				@ -92,7 +92,7 @@ static void key_callback(GLFWwindow window, int key, int action)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static void list_modes(GLFWmonitor monitor)
 | 
					static void list_modes(GLFWmonitor monitor)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int count, i;
 | 
					    int count, widthMM, heightMM, dpi, i;
 | 
				
			||||||
    GLFWvidmode mode;
 | 
					    GLFWvidmode mode;
 | 
				
			||||||
    GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
 | 
					    GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -103,9 +103,11 @@ static void list_modes(GLFWmonitor monitor)
 | 
				
			|||||||
    printf("Virtual position: %i %i\n",
 | 
					    printf("Virtual position: %i %i\n",
 | 
				
			||||||
           glfwGetMonitorParam(monitor, GLFW_MONITOR_SCREEN_POS_X),
 | 
					           glfwGetMonitorParam(monitor, GLFW_MONITOR_SCREEN_POS_X),
 | 
				
			||||||
           glfwGetMonitorParam(monitor, GLFW_MONITOR_SCREEN_POS_Y));
 | 
					           glfwGetMonitorParam(monitor, GLFW_MONITOR_SCREEN_POS_Y));
 | 
				
			||||||
    printf("Physical size: %i x %i\n",
 | 
					
 | 
				
			||||||
           glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_WIDTH),
 | 
					    widthMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_WIDTH);
 | 
				
			||||||
           glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_HEIGHT));
 | 
					    heightMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_HEIGHT);
 | 
				
			||||||
 | 
					    dpi = (int) ((float) mode.width * 25.4f / (float) widthMM);
 | 
				
			||||||
 | 
					    printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    printf("Modes:\n");
 | 
					    printf("Modes:\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user