Made glfwGetVideoMode consistent with getters.

This commit is contained in:
Camilla Berglund
2013-05-22 22:16:43 +02:00
parent 5d308db654
commit ce1e84def6
7 changed files with 18 additions and 19 deletions
+2 -2
View File
@@ -371,7 +371,7 @@ void monitor_callback(GLFWmonitor* monitor, int event)
if (event == GLFW_CONNECTED)
{
int x, y, widthMM, heightMM;
GLFWvidmode mode = glfwGetVideoMode(monitor);
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
glfwGetMonitorPos(monitor, &x, &y);
glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM);
@@ -380,7 +380,7 @@ void monitor_callback(GLFWmonitor* monitor, int event)
counter++,
glfwGetTime(),
glfwGetMonitorName(monitor),
mode.width, mode.height,
mode->width, mode->height,
x, y,
widthMM, heightMM);
}
+3 -3
View File
@@ -127,9 +127,9 @@ int main(int argc, char** argv)
if (monitor)
{
GLFWvidmode mode = glfwGetVideoMode(monitor);
width = mode.width;
height = mode.height;
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
width = mode->width;
height = mode->height;
}
else
{
+3 -3
View File
@@ -117,9 +117,9 @@ int main(int argc, char** argv)
if (monitor)
{
GLFWvidmode mode = glfwGetVideoMode(monitor);
width = mode.width;
height = mode.height;
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
width = mode->width;
height = mode->height;
}
else
{
+3 -3
View File
@@ -82,7 +82,7 @@ static void key_callback(GLFWwindow* window, int key, int action, int mods)
static void list_modes(GLFWmonitor* monitor)
{
int count, x, y, widthMM, heightMM, dpi, i;
GLFWvidmode mode = glfwGetVideoMode(monitor);
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
glfwGetMonitorPos(monitor, &x, &y);
@@ -91,10 +91,10 @@ static void list_modes(GLFWmonitor* monitor)
printf("Name: %s (%s)\n",
glfwGetMonitorName(monitor),
glfwGetPrimaryMonitor() == monitor ? "primary" : "secondary");
printf("Current mode: %s\n", format_mode(&mode));
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);
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");