mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Merge branch 'master' of github.com:elmindreda/glfw
This commit is contained in:
+12
-11
@@ -1,15 +1,15 @@
|
||||
|
||||
if(UNIX)
|
||||
if(_GLFW_HAS_XRANDR)
|
||||
if (_GLFW_HAS_XRANDR)
|
||||
set(GLFW_PKGLIBS "${GLFW_PKGLIBS} xrandr")
|
||||
endif(_GLFW_HAS_XRANDR)
|
||||
if(_GLFW_HAS_XF86VIDMODE)
|
||||
endif()
|
||||
if (_GLFW_HAS_XF86VIDMODE)
|
||||
set(GLFW_PKGLIBS "${GLFW_PKGLIBS} xxf86vm")
|
||||
endif(_GLFW_HAS_XF86VIDMODE)
|
||||
endif()
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc DESTINATION lib/pkgconfig)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
||||
include_directories(${GLFW_SOURCE_DIR}/src
|
||||
${GLFW_BINARY_DIR}/src
|
||||
@@ -37,7 +37,7 @@ elseif(_GLFW_X11_GLX)
|
||||
x11_window.c)
|
||||
else()
|
||||
message(FATAL_ERROR "No supported platform was selected")
|
||||
endif(_GLFW_COCOA_NSGL)
|
||||
endif()
|
||||
|
||||
add_library(libglfwStatic STATIC ${libglfw_SOURCES})
|
||||
add_library(libglfwShared SHARED ${libglfw_SOURCES})
|
||||
@@ -47,22 +47,23 @@ set_target_properties(libglfwStatic libglfwShared PROPERTIES
|
||||
OUTPUT_NAME glfw)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(libglfwShared winmm)
|
||||
# The GLFW DLL needs a special compile-time macro and import library name
|
||||
set_target_properties(libglfwShared PROPERTIES
|
||||
DEFINE_SYMBOL GLFW_BUILD_DLL
|
||||
COMPILE_DEFINITIONS "GLFW_BUILD_DLL;_GLFW_NO_DLOAD_GDI32;_GLFW_NO_DLOAD_WINMM"
|
||||
PREFIX ""
|
||||
IMPORT_PREFIX ""
|
||||
IMPORT_SUFFIX "dll.lib")
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# Append -fno-common to the compile flags to work around a bug in the Apple GCC
|
||||
get_target_property(CFLAGS libglfwShared COMPILE_FLAGS)
|
||||
if(NOT CFLAGS)
|
||||
if (NOT CFLAGS)
|
||||
set(CFLAGS "")
|
||||
endif(NOT CFLAGS)
|
||||
endif()
|
||||
set_target_properties(libglfwShared PROPERTIES COMPILE_FLAGS "${CFLAGS} -fno-common")
|
||||
endif(APPLE)
|
||||
endif()
|
||||
|
||||
install(TARGETS libglfwStatic libglfwShared DESTINATION lib)
|
||||
|
||||
|
||||
@@ -814,6 +814,8 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||
if (!initializeAppKit())
|
||||
return GL_FALSE;
|
||||
|
||||
window->resizable = wndconfig->resizable;
|
||||
|
||||
// We can only have one application delegate, but we only allocate it the
|
||||
// first time we create a window to keep all window code in this file
|
||||
if (_glfwLibrary.NS.delegate == nil)
|
||||
|
||||
@@ -60,11 +60,6 @@
|
||||
// Define this to 1 if the Linux joystick API is available
|
||||
#cmakedefine _GLFW_USE_LINUX_JOYSTICKS 1
|
||||
|
||||
// Define this to 1 to not load gdi32.dll dynamically
|
||||
#cmakedefine _GLFW_NO_DLOAD_GDI32 1
|
||||
// Define this to 1 to not load winmm.dll dynamically
|
||||
#cmakedefine _GLFW_NO_DLOAD_WINMM 1
|
||||
|
||||
// The GLFW version as used by glfwGetVersionString
|
||||
#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@"
|
||||
|
||||
|
||||
@@ -1441,6 +1441,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||
GLboolean recreateContext = GL_FALSE;
|
||||
|
||||
window->Win32.desiredRefreshRate = wndconfig->refreshRate;
|
||||
window->resizable = wndconfig->resizable;
|
||||
|
||||
if (!_glfwLibrary.Win32.classAtom)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,11 @@ static int keyCodeToGLFWKeyCode(int keyCode)
|
||||
// Note: This way we always force "NumLock = ON", which is intentional
|
||||
// since the returned key code should correspond to a physical
|
||||
// location.
|
||||
#if defined(_GLFW_HAS_XKB)
|
||||
keySym = XkbKeycodeToKeysym(_glfwLibrary.X11.display, keyCode, 1, 0);
|
||||
#else
|
||||
keySym = XKeycodeToKeysym(_glfwLibrary.X11.display, keyCode, 1);
|
||||
#endif
|
||||
switch (keySym)
|
||||
{
|
||||
case XK_KP_0: return GLFW_KEY_KP_0;
|
||||
@@ -102,7 +106,12 @@ static int keyCodeToGLFWKeyCode(int keyCode)
|
||||
// Now try pimary keysym for function keys (non-printable keys). These
|
||||
// should not be layout dependent (i.e. US layout and international
|
||||
// layouts should give the same result).
|
||||
#if defined(_GLFW_HAS_XKB)
|
||||
keySym = XkbKeycodeToKeysym(_glfwLibrary.X11.display, keyCode, 0, 0);
|
||||
#else
|
||||
keySym = XKeycodeToKeysym(_glfwLibrary.X11.display, keyCode, 0);
|
||||
#endif
|
||||
|
||||
switch (keySym)
|
||||
{
|
||||
case XK_Escape: return GLFW_KEY_ESCAPE;
|
||||
|
||||
Reference in New Issue
Block a user