mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Add aspect ratio to monitor test mode listing
This commit is contained in:
parent
c156b50e4c
commit
9d42e146e7
|
@ -49,14 +49,21 @@ static void usage(void)
|
||||||
printf(" monitors -h\n");
|
printf(" monitors -h\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int euclid(int a, int b)
|
||||||
|
{
|
||||||
|
return b ? euclid(b, a % b) : a;
|
||||||
|
}
|
||||||
|
|
||||||
static const char* format_mode(const GLFWvidmode* mode)
|
static const char* format_mode(const GLFWvidmode* mode)
|
||||||
{
|
{
|
||||||
static char buffer[512];
|
static char buffer[512];
|
||||||
|
const int gcd = euclid(mode->width, mode->height);
|
||||||
|
|
||||||
sprintf(buffer,
|
sprintf(buffer,
|
||||||
"%i x %i x %i (%i %i %i) %i Hz",
|
"%i x %i x %i (%i:%i) (%i %i %i) %i Hz",
|
||||||
mode->width, mode->height,
|
mode->width, mode->height,
|
||||||
mode->redBits + mode->greenBits + mode->blueBits,
|
mode->redBits + mode->greenBits + mode->blueBits,
|
||||||
|
mode->width / gcd, mode->height / gcd,
|
||||||
mode->redBits, mode->greenBits, mode->blueBits,
|
mode->redBits, mode->greenBits, mode->blueBits,
|
||||||
mode->refreshRate);
|
mode->refreshRate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user