mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 06:04:34 +00:00
Merge branch 'master' of github.com:elmindreda/glfw
This commit is contained in:
commit
c3da8e417f
@ -147,6 +147,7 @@ GLFWAPI int glfwInit(void)
|
|||||||
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
_glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
|
||||||
if (!_glfw.monitors)
|
if (!_glfw.monitors)
|
||||||
{
|
{
|
||||||
|
_glfwErrorCallback(GLFW_PLATFORM_ERROR, "No monitors found");
|
||||||
_glfwPlatformTerminate();
|
_glfwPlatformTerminate();
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ int _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
|||||||
{
|
{
|
||||||
GLFWvidmode current;
|
GLFWvidmode current;
|
||||||
const GLFWvidmode* best;
|
const GLFWvidmode* best;
|
||||||
|
DEVMODE dm;
|
||||||
|
|
||||||
best = _glfwChooseVideoMode(monitor, mode);
|
best = _glfwChooseVideoMode(monitor, mode);
|
||||||
|
|
||||||
@ -63,7 +64,6 @@ int _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* mode)
|
|||||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
DEVMODE dm;
|
|
||||||
dm.dmSize = sizeof(DEVMODE);
|
dm.dmSize = sizeof(DEVMODE);
|
||||||
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
|
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
|
||||||
dm.dmPelsWidth = best->width;
|
dm.dmPelsWidth = best->width;
|
||||||
@ -120,6 +120,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
DEVMODE settings;
|
DEVMODE settings;
|
||||||
char* name;
|
char* name;
|
||||||
HDC dc;
|
HDC dc;
|
||||||
|
GLboolean primary;
|
||||||
|
|
||||||
ZeroMemory(&adapter, sizeof(DISPLAY_DEVICE));
|
ZeroMemory(&adapter, sizeof(DISPLAY_DEVICE));
|
||||||
adapter.cb = sizeof(DISPLAY_DEVICE);
|
adapter.cb = sizeof(DISPLAY_DEVICE);
|
||||||
@ -171,7 +172,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
EnumDisplayDevices(adapter.DeviceName, 0, &monitor, 0);
|
EnumDisplayDevices(adapter.DeviceName, 0, &monitor, 0);
|
||||||
dc = CreateDC(L"DISPLAY", monitor.DeviceString, NULL, NULL);
|
dc = CreateDC(L"DISPLAY", monitor.DeviceString, NULL, NULL);
|
||||||
|
|
||||||
const GLboolean primary = adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE;
|
primary = adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE;
|
||||||
|
|
||||||
monitors[found] = _glfwCreateMonitor(name, primary,
|
monitors[found] = _glfwCreateMonitor(name, primary,
|
||||||
GetDeviceCaps(dc, HORZSIZE),
|
GetDeviceCaps(dc, HORZSIZE),
|
||||||
|
@ -24,7 +24,7 @@ endif()
|
|||||||
set(GETOPT ${GLFW_SOURCE_DIR}/support/getopt.h
|
set(GETOPT ${GLFW_SOURCE_DIR}/support/getopt.h
|
||||||
${GLFW_SOURCE_DIR}/support/getopt.c)
|
${GLFW_SOURCE_DIR}/support/getopt.c)
|
||||||
set(TINYCTHREAD ${GLFW_SOURCE_DIR}/support/tinycthread.h
|
set(TINYCTHREAD ${GLFW_SOURCE_DIR}/support/tinycthread.h
|
||||||
${GLFW_SOURCE_DIR}/support/tinycthread.c)
|
${GLFW_SOURCE_DIR}/support/tinycthread.c)
|
||||||
|
|
||||||
add_executable(clipboard clipboard.c ${GETOPT})
|
add_executable(clipboard clipboard.c ${GETOPT})
|
||||||
add_executable(defaults defaults.c)
|
add_executable(defaults defaults.c)
|
||||||
@ -57,9 +57,8 @@ set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title")
|
|||||||
add_executable(windows WIN32 MACOSX_BUNDLE windows.c)
|
add_executable(windows WIN32 MACOSX_BUNDLE windows.c)
|
||||||
set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
|
set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
target_link_libraries(threads ${thread_LIBRARIES})
|
||||||
target_link_libraries(threads ${thread_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(WINDOWS_BINARIES accuracy sharing tearing threads title windows)
|
set(WINDOWS_BINARIES accuracy sharing tearing threads title windows)
|
||||||
set(CONSOLE_BINARIES clipboard defaults events fsaa fsfocus gamma glfwinfo
|
set(CONSOLE_BINARIES clipboard defaults events fsaa fsfocus gamma glfwinfo
|
||||||
|
Loading…
Reference in New Issue
Block a user