mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Added decimals to DPI reported by monitor test.
This commit is contained in:
parent
bb50368d55
commit
acaddf9cd9
@ -83,7 +83,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
||||
|
||||
static void list_modes(GLFWmonitor* monitor)
|
||||
{
|
||||
int count, x, y, widthMM, heightMM, dpi, i;
|
||||
int count, x, y, widthMM, heightMM, i;
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
|
||||
const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
||||
|
||||
@ -96,8 +96,8 @@ static void list_modes(GLFWmonitor* monitor)
|
||||
printf("Current mode: %s\n", format_mode(mode));
|
||||
printf("Virtual position: %i %i\n", x, y);
|
||||
|
||||
dpi = (int) ((float) mode->width * 25.4f / (float) widthMM);
|
||||
printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi);
|
||||
printf("Physical size: %i x %i mm (%0.2f dpi)\n",
|
||||
widthMM, heightMM, mode->width * 25.4f / widthMM);
|
||||
|
||||
printf("Modes:\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user