mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05: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)
|
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* mode = glfwGetVideoMode(monitor);
|
||||||
const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
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("Current mode: %s\n", format_mode(mode));
|
||||||
printf("Virtual position: %i %i\n", x, y);
|
printf("Virtual position: %i %i\n", x, y);
|
||||||
|
|
||||||
dpi = (int) ((float) mode->width * 25.4f / (float) widthMM);
|
printf("Physical size: %i x %i mm (%0.2f dpi)\n",
|
||||||
printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi);
|
widthMM, heightMM, mode->width * 25.4f / widthMM);
|
||||||
|
|
||||||
printf("Modes:\n");
|
printf("Modes:\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user