Implemented display iteration for x11. Added attributes and queries for physical size, name and logical position. Updated test executable.

This commit is contained in:
Marcel Metz
2011-05-07 10:53:50 +02:00
parent b7d1d35c20
commit beacbb3447
9 changed files with 316 additions and 13 deletions
+22 -8
View File
@@ -18,6 +18,7 @@ static void print_mode(GLFWvidmode* mode)
int main(void)
{
GLFWdisplay displayHandle;
GLFWvidmode dtmode, modes[400];
int modecount, i;
@@ -32,15 +33,28 @@ int main(void)
printf("Desktop mode: ");
print_mode(&dtmode);
// List available video modes
modecount = glfwGetVideoModes(modes, sizeof(modes) / sizeof(GLFWvidmode));
printf("Available modes:\n");
for (i = 0; i < modecount; i++)
{
printf("%3i: ", i);
print_mode(modes + i);
}
displayHandle = GLFW_DISPLAY_INVALID_HANDLE;
while( GLFW_DISPLAY_INVALID_HANDLE != ( displayHandle = glfwGetNextDisplay( displayHandle )))
{
printf( "Display name: %s\n"
"Physical dimensions: %dmm x %dmm\n"
"Logical position: (%d,%d)\n",
glfwGetDisplayStringParam( displayHandle, GLFW_DISPLAY_PARAM_S_NAME ),
glfwGetDisplayIntegerParam( displayHandle, GLFW_DISPLAY_PARAM_I_PHYS_WIDTH ),
glfwGetDisplayIntegerParam( displayHandle, GLFW_DISPLAY_PARAM_I_PHYS_HEIGHT ),
glfwGetDisplayIntegerParam( displayHandle, GLFW_DISPLAY_PARAM_I_SCREEN_X_POS ),
glfwGetDisplayIntegerParam( displayHandle, GLFW_DISPLAY_PARAM_I_SCREEN_Y_POS )
);
// List available video modes
modecount = glfwGetVideoModes(displayHandle, modes, sizeof(modes) / sizeof(GLFWvidmode));
printf( "Available modes:\n" );
for( i = 0; i < modecount; i ++ )
{
printf("%3i: ", i);
print_mode(modes + i);
}
}
glfwTerminate();
exit(EXIT_SUCCESS);
}