mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 08:39:45 +00:00
Merge branch 'master' into multi-monitor
Conflicts: include/GL/glfw3.h src/CMakeLists.txt src/fullscreen.c src/internal.h src/win32_fullscreen.c src/win32_platform.h src/x11_fullscreen.c tests/modes.c
This commit is contained in:
@@ -42,7 +42,6 @@ typedef struct
|
||||
|
||||
static Param parameters[] =
|
||||
{
|
||||
{ GLFW_ACCELERATED, "accelerated" },
|
||||
{ GLFW_RED_BITS, "red bits" },
|
||||
{ GLFW_GREEN_BITS, "green bits" },
|
||||
{ GLFW_BLUE_BITS, "blue bits" },
|
||||
|
||||
+14
-8
@@ -249,23 +249,29 @@ int main(int argc, char** argv)
|
||||
if (major >= 3)
|
||||
{
|
||||
glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
||||
printf("OpenGL context flags:");
|
||||
printf("OpenGL context flags (0x%08x):", flags);
|
||||
|
||||
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
|
||||
puts(" forward-compatible");
|
||||
else
|
||||
puts(" none");
|
||||
printf(" forward-compatible");
|
||||
if (flags & 0)
|
||||
printf(" debug");
|
||||
putchar('\n');
|
||||
|
||||
printf("OpenGL forward-compatible flag parsed by GLFW: %s\n",
|
||||
glfwGetWindowParam(window, GLFW_OPENGL_FORWARD_COMPAT) ? "true" : "false");
|
||||
printf("OpenGL context flags parsed by GLFW:");
|
||||
|
||||
if (glfwGetWindowParam(window, GLFW_OPENGL_FORWARD_COMPAT))
|
||||
printf(" forward-compatible");
|
||||
if (glfwGetWindowParam(window, GLFW_OPENGL_DEBUG_CONTEXT))
|
||||
printf(" debug");
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
if (major > 3 || (major == 3 && minor >= 2))
|
||||
{
|
||||
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);
|
||||
printf("OpenGL profile mask: %s (0x%08x)\n", get_profile_name(mask), mask);
|
||||
printf("OpenGL profile mask (0x%08x): %s\n", mask, get_profile_name(mask));
|
||||
|
||||
printf("OpenGL profile parsed by GLFW: %s\n",
|
||||
printf("OpenGL profile mask parsed by GLFW: %s\n",
|
||||
get_glfw_profile_name(glfwGetWindowParam(window, GLFW_OPENGL_PROFILE)));
|
||||
}
|
||||
|
||||
|
||||
+4
-28
@@ -90,34 +90,15 @@ static void key_callback(GLFWwindow dummy, int key, int action)
|
||||
}
|
||||
}
|
||||
|
||||
static GLFWvidmode* get_video_modes(GLFWmonitor monitor, size_t* found)
|
||||
{
|
||||
size_t count = 0;
|
||||
GLFWvidmode* modes = NULL;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
count += 256;
|
||||
modes = realloc(modes, sizeof(GLFWvidmode) * count);
|
||||
|
||||
*found = glfwGetVideoModes(monitor, modes, count);
|
||||
if (*found < count)
|
||||
break;
|
||||
}
|
||||
|
||||
return modes;
|
||||
}
|
||||
|
||||
static void list_modes(GLFWmonitor monitor)
|
||||
{
|
||||
size_t count, i;
|
||||
int count, i;
|
||||
GLFWvidmode desktop_mode;
|
||||
GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
||||
|
||||
glfwGetDesktopMode(&desktop_mode);
|
||||
printf("Desktop mode: %s\n", format_mode(&desktop_mode));
|
||||
|
||||
GLFWvidmode* modes = get_video_modes(monitor, &count);
|
||||
|
||||
printf("Monitor %s (%ix%i mm):\n",
|
||||
glfwGetMonitorString(monitor, GLFW_MONITOR_NAME),
|
||||
glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_WIDTH),
|
||||
@@ -132,15 +113,12 @@ static void list_modes(GLFWmonitor monitor)
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
free(modes);
|
||||
}
|
||||
|
||||
static void test_modes(GLFWmonitor monitor)
|
||||
{
|
||||
int width, height;
|
||||
size_t i, count;
|
||||
GLFWvidmode* modes = get_video_modes(monitor, &count);
|
||||
int i, count, width, height;
|
||||
GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
||||
|
||||
glfwSetWindowSizeCallback(window_size_callback);
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
@@ -214,8 +192,6 @@ static void test_modes(GLFWmonitor monitor)
|
||||
glfwPollEvents();
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
free(modes);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
||||
Reference in New Issue
Block a user