Compare commits

...

21 Commits

Author SHA1 Message Date
Camilla Berglund 22e1aa6cfc Fixed process transform when no menu bar. 2013-06-16 20:30:36 +02:00
Camilla Berglund 1c79d8a8e4 Added release description. 2013-06-16 20:04:18 +02:00
Kyle McDonald d5cd6ec8eb Restored support for Mac OS X 10.6.
Modified during merge.
2013-06-16 18:46:20 +02:00
Camilla Berglund eba8168a03 Fixed glfwGetFramebufferSize on OS X. 2013-06-16 18:32:16 +02:00
Camilla Berglund a7ff236b32 Fixed duplicate events being reported. 2013-06-16 18:29:46 +02:00
Camilla Berglund d31322cdcd Added option for disabling install. 2013-06-16 13:31:39 +02:00
Camilla Berglund 61f7de5a25 Updated credits and changelog. 2013-06-16 12:36:56 +02:00
Camilla Berglund e4d9e03efc Merge pull request #48 from Nibe/xf86vmode-fix
Fix variable name for xf86vmode library.
2013-06-16 03:32:46 -07:00
Niklas Behrens bff77eeed1 Fix variable name for xf86vmode lib
CMake bug 0006976 has been fixed. However, the variable name is
different than expected.
2013-06-16 03:17:20 +02:00
Camilla Berglund e93bade240 Fixed docs for glfwGetJoystickButtons. 2013-06-16 02:33:33 +02:00
Camilla Berglund f1c88b41f2 Fixed bad reference in documentation. 2013-06-14 12:12:16 +02:00
Camilla Berglund 77e4c61190 Fixed broken WGL error detection.
Context creation was attempted even if no valid pixel formats had been
found during enumeration.
2013-06-13 18:29:21 +02:00
Camilla Berglund 3a5fcfba06 Removed more version noise. 2013-06-13 15:09:52 +02:00
Camilla Berglund c9bd191edb Removed version noise. 2013-06-13 15:07:28 +02:00
Camilla Berglund 77572bdf6e Fixed line terminators. 2013-06-13 12:24:07 +02:00
Camilla Berglund ccb810bed9 It's not an error. 2013-06-13 12:21:16 +02:00
Camilla Berglund fdaebdd169 Removed 'unfinished' claim. 2013-06-13 12:12:45 +02:00
Camilla Berglund 74d355fae4 News page fixes. 2013-06-13 12:12:10 +02:00
Camilla Berglund 2cc2e8acd7 Added cursor crossing callback to news. 2013-06-13 12:08:42 +02:00
Camilla Berglund dbef5ea46b Grammar fix. 2013-06-13 12:06:51 +02:00
Camilla Berglund c38f33adda Started 3.0.1. 2013-06-13 12:05:23 +02:00
12 changed files with 292 additions and 414 deletions
+25 -29
View File
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8)
set(GLFW_VERSION_MAJOR "3") set(GLFW_VERSION_MAJOR "3")
set(GLFW_VERSION_MINOR "0") set(GLFW_VERSION_MINOR "0")
set(GLFW_VERSION_PATCH "0") set(GLFW_VERSION_PATCH "1")
set(GLFW_VERSION_EXTRA "") set(GLFW_VERSION_EXTRA "")
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}") set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}") set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
@@ -13,6 +13,7 @@ set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(GLFW_INSTALL "Generate installation target" ON)
set(DOXYGEN_SKIP_DOT TRUE) set(DOXYGEN_SKIP_DOT TRUE)
find_package(Doxygen) find_package(Doxygen)
@@ -199,11 +200,10 @@ if (_GLFW_X11)
list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH})
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm")
# NOTE: This is a workaround for CMake bug 0006976 (missing if (X11_Xxf86vm_LIB)
# X11_xf86vmode_LIB variable) list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB})
if (X11_xf86vmode_LIB)
list(APPEND glfw_LIBRARIES ${X11_xf86vmode_LIB})
else() else()
# Backwards compatibility (see CMake bug 0006976)
list(APPEND glfw_LIBRARIES Xxf86vm) list(APPEND glfw_LIBRARIES Xxf86vm)
endif() endif()
@@ -390,45 +390,41 @@ configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in
configure_file(${GLFW_SOURCE_DIR}/src/config.h.in configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
${GLFW_BINARY_DIR}/src/config.h @ONLY) ${GLFW_BINARY_DIR}/src/config.h @ONLY)
#--------------------------------------------------------------------
# Install the public headers
# The src directory's CMakeLists.txt file installs the library
#--------------------------------------------------------------------
install(DIRECTORY include/GLFW DESTINATION include
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
#--------------------------------------------------------------------
# Create and install glfwConfig.cmake and glfwConfigVersion files
#--------------------------------------------------------------------
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in
${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY) ${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY)
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY) ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY)
install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake
DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
if (UNIX)
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
endif()
#--------------------------------------------------------------------
# Create and install pkg-config file on supported platforms
#--------------------------------------------------------------------
if (UNIX) if (UNIX)
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY)
endif()
install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc #--------------------------------------------------------------------
DESTINATION lib${LIB_SUFFIX}/pkgconfig) # Install files
# The library is installed by src/CMakeLists.txt
#--------------------------------------------------------------------
if (GLFW_INSTALL)
install(DIRECTORY include/GLFW DESTINATION include
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake
DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
if (UNIX)
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Uninstall operation # Uninstall operation
# Don't generate this target if a higher-level project already has # Don't generate this target if a higher-level project already has
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (NOT TARGET uninstall) if (GLFW_INSTALL AND NOT TARGET uninstall)
configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in
${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
+19 -183
View File
@@ -1,4 +1,4 @@
# GLFW 3.0 # GLFW
## Introduction ## Introduction
@@ -6,12 +6,8 @@ GLFW is a free, Open Source, portable library for OpenGL and OpenGL ES
application development. It provides a simple, platform-independent API for application development. It provides a simple, platform-independent API for
creating windows and contexts, reading input, handling events, etc. creating windows and contexts, reading input, handling events, etc.
Version 3.0 brings a new API with many new features such as multiple windows Version 3.0.1 adds fixes for a number of bugs that together affect all supported
and contexts, multi-monitor support, EGL and OpenGL ES support, clipboard text platforms. As this is a patch release, there are no API changes.
support, an error description callback, gamma ramp control, layout-independent
keyboard input and UTF-8 for all strings.
GLFW is now hosted on [GitHub](https://github.com/glfw/glfw).
If you are new to GLFW, you may find the If you are new to GLFW, you may find the
[introductory tutorial](http://www.glfw.org/docs/3.0/quick.html) for GLFW [introductory tutorial](http://www.glfw.org/docs/3.0/quick.html) for GLFW
@@ -102,183 +98,20 @@ CMake.
See the [GLFW 3.0 documentation](http://www.glfw.org/docs/3.0/). See the [GLFW 3.0 documentation](http://www.glfw.org/docs/3.0/).
## Changes for version 3.0 ## Changelog
- Added `GLFWmonitor` and updated monitor-related functions to take a monitor - Bugfix: The wrong name was used for the CMake variable for the Xxf86vm
handle library
- Added `glfwGetMonitors` and `glfwGetPrimaryMonitor` for enumerating available - [Cocoa] Bugfix: `glfwGetFramebufferSize` return the size in screen
monitors coordinates
- Added `glfwGetMonitorPos`, `glfwGetMonitorPhysicalSize` and - [Cocoa] Bugfix: Messages not supported on Mac OS X 10.6 were used without
`glfwGetMonitorName` for retrieving monitor properties tests for precence
- Added `glfwSetMonitorCallback` and `GLFWmonitorfun` for notification of - [Cocoa] Bugfix: Process transformation was not performed if menu bar creation
changes in the set of available monitors was disabled
- Added `GLFWwindow` and updated window-related functions and callbacks to take - [Win32] Bugfix: Context creation was attempted even if no valid pixel formats
a window handle had been found
- Added `glfwSetWindowShouldClose` and `glfwWindowShouldClose` for setting and - [X11] Bugfix: Duplicate window position and window and framebuffer size
retrieving the window close flag events were reported
- Added `glfwGetWindowPos` for retrieving the position of a window
- Added `glfwDefaultWindowHints` for resetting all window hints to their
default values
- Added `glfwMakeContextCurrent` for making the context of the specified window
current
- Added `glfwSetErrorCallback`, `GLFWerrorfun` and error type tokens for
receiving error notifications
- Added `glfwSetWindowUserPointer` and `glfwGetWindowUserPointer` for
per-window user pointers
- Added `glfwGetVersionString` for determining which code paths were enabled at
compile time
- Added `glfwGetWindowMonitor` for querying the monitor, if any, of the
specified window
- Added `glfwGetFramebufferSize` and `glfwSetFramebufferSizeCallback` for
receiving the current size, in pixels, of the framebuffer
- Added `glfwSetWindowPosCallback` and `GLFWwindowposfun` for receiving window
position events
- Added `glfwSetWindowFocusCallback` and `GLFWwindowfocusfun` for receiving
window focus events
- Added `glfwSetWindowIconifyCallback` and `GLFWwindowiconifyfun` for receiving
window iconification events
- Added `glfwGetClipboardString` and `glfwSetClipboardString` for interacting
with the system clipboard
- Added `glfwGetJoystickName` for retrieving the name of a joystick
- Added `glfwGetCurrentContext` for retrieving the window whose OpenGL context
is current
- Added `GLFW_SRGB_CAPABLE` for requesting sRGB capable framebuffers
- Added `GLFW_CLIENT_API` and its values `GLFW_OPENGL_API` and
`GLFW_OPENGL_ES_API` for selecting client API
- Added `GLFW_CONTEXT_ROBUSTNESS` and values `GLFW_NO_ROBUSTNESS`,
`GLFW_NO_RESET_NOTIFICATION` and `GLFW_LOSE_CONTEXT_ON_RESET` for
`GL_ARB_robustness` support
- Added `GLFW_OPENGL_REVISION` to make up for removal of `glfwGetGLVersion`
- Added `GLFW_INCLUDE_GLCOREARB` macro for including `GL/glcorearb.h` instead of
`GL/gl.h`
- Added `GLFW_INCLUDE_ES1` macro for telling the GLFW header to use `GLES/gl.h`
instead of `GL/gl.h`
- Added `GLFW_INCLUDE_ES2` macro for telling the GLFW header to use
`GLES2/gl2.h` instead of `GL/gl.h`
- Added `GLFW_INCLUDE_NONE` macro for telling the GLFW header to not include
any client API header
- Added `GLFW_VISIBLE` window hint and parameter for controlling and polling
window visibility
- Added `GLFW_REPEAT` key action for repeated keys
- Added scancode parameter to key callback
- Added `refreshRate` member to `GLFWvidmode` struct
- Added key modifier parameter to key and mouse button callbacks
- Added `windows` simple multi-window test program
- Added `sharing` simple OpenGL object sharing test program
- Added `modes` video mode enumeration and setting test program
- Added `threads` simple multi-threaded rendering test program
- Added `glfw3native.h` header and platform-specific functions for explicit
access to native display, window and context handles
- Added `glfwSetGamma`, `glfwSetGammaRamp` and `glfwGetGammaRamp` functions and
`GLFWgammaramp` type for monitor gamma ramp control
- Added window parameter to `glfwSwapBuffers`
- Changed buffer bit depth parameters of `glfwOpenWindow` to window hints
- Changed `glfwCreateWindow` and `glfwSetWindowTitle` to use UTF-8 encoded
strings
- Changed `glfwGetProcAddress` to return a (generic) function pointer
- Changed `glfwGetVideoModes` to return a dynamic, unlimited number of video
modes for the specified monitor
- Changed cursor position to double-precision floating-point
- Changed default cursor mode for fullscreen to normal
- Renamed header directory `GL` to `GLFW`
- Renamed `glfw.h` to `glfw3.h` to avoid conflicts with 2.x series
- Renamed `glfwOpenWindowHint` to `glfwWindowHint`
- Renamed `glfwGetWindowParam` to `glfwGetWindowAttrib`
- Renamed `GLFW_ACTIVE` to `GLFW_FOCUSED`
- Renamed `GLFW_FSAA_SAMPLES` to `GLFW_SAMPLES`
- Renamed `GLFW_WINDOW_NO_RESIZE` to `GLFW_RESIZABLE`
- Renamed `GLFW_BUILD_DLL` to `_GLFW_BUILD_DLL`
- Renamed `version` test to `glfwinfo`
- Renamed `GLFW_NO_GLU` to `GLFW_INCLUDE_GLU` and made it disabled by default
- Renamed `glfwGetJoystickPos` to `glfwGetJoystickAxes` to match
`glfwGetJoystickButtons`
- Renamed mouse position functions to cursor position equivalents
- Replaced `glfwOpenWindow` and `glfwCloseWindow` with `glfwCreateWindow` and
`glfwDestroyWindow`
- Replaced `glfwGetDesktopMode` width `glfwGetVideoMode`
- Replaced ad hoc build system with CMake
- Replaced layout-dependent key codes with single, platform-independent set
based on US layout
- Replaced mouse wheel interface with two-dimensional, floating point scrolling
interface
- Replaced `glfwEnable` and `glfwDisable` with `glfwGetInputMode` and
`glfwSetInputMode`
- Replaced `joystick` test with graphical version
- Replaced automatic closing of windows with the window close flag
- Removed the `GLFW_KEY_REPEAT` input option
- Removed event auto-polling and the `GLFW_AUTO_POLL_EVENTS` window enable
- Removed the Win32 port .def files
- Removed the entire threading API
- Removed the entire image loading API
- Removed deprecated Carbon port
- Removed registering `glfwTerminate` with `atexit`
- Removed `glfwSleep` function
- Removed `glfwGetNumberOfProcessors` function
- Removed `glfwGetGLVersion` function
- Removed `GLFW_OPENED` window parameter
- Removed `GLFW_WINDOW` and `GLFW_FULLSCREEN`
- Removed nonsensical key actions for Unicode character input
- Removed `GLFWCALL` and `GLFWAPIENTRY` macros for stdcall calling convention
- Removed `GLFW_ACCELERATED` window parameter
- Removed default framebuffer attributes from `glfwGetWindowParam`
- Bugfix: The default OpenGL version in the `glfwinfo` test was set to 1.1
- Bugfix: The OpenGL profile and forward-compatibility window parameters were
not saved after context creation
- Bugfix: The FSAA test did not check for the availability of
`GL_ARB_multisample`
- Bugfix: Cursor centering upon leaving captured cursor mode was reported
before the mode was changed to non-captured
- [Cocoa] Added support for OpenGL 3.2 core profile in 10.7 Lion and above
- [Cocoa] Added support for high-DPI (Retina) monitors
- [Cocoa] Added support for joysticks
- [Cocoa] Postponed menu creation to first window creation
- [Cocoa] Replaced `NSDate` time source with `mach_absolute_time`
- [Cocoa] Replaced all deprecated CoreGraphics calls with non-deprecated
counterparts
- [Cocoa] Bugfix: The `NSOpenGLPFAFullScreen` pixel format attribute caused
creation to fail on some machines
- [Cocoa] Bugfix: `glfwCreateWindow` did not properly enforce the
forward-compatible and context profile hints
- [Cocoa] Bugfix: The loop condition for saving video modes used the wrong
index variable
- [Cocoa] Bugfix: The OpenGL framework was not retrieved, making
`glfwGetProcAddress` crash
- [Cocoa] Bugfix: `glfwInit` changed the current directory for unbundled
executables
- [Cocoa] Bugfix: The `GLFW_WINDOW_NO_RESIZE` window parameter was always zero
- [Cocoa] Bugfix: The cursor position incorrectly rounded during conversion
- [Cocoa] Bugfix: Cursor positioning led to nonsensical results for fullscreen
windows
- [Cocoa] Bugfix: The GLFW window was flagged as restorable
- [X11] Added support for the `GLX_EXT_swap_control` and
`GLX_MESA_swap_control` extensions as alternatives to
`GLX_SGI_swap_control`
- [X11] Added the POSIX `CLOCK_MONOTONIC` time source as the preferred method
- [X11] Added dependency on libm, where present
- [X11] Added support for the `_NET_WM_NAME` and `_NET_WM_ICON_NAME` EWMH
window properties
- [X11] Made client-side RandR and Xf86VidMode extensions required
- [X11] Bugfix: Some window properties required by the ICCCM were not set
- [X11] Bugfix: Calling `glXCreateContextAttribsARB` with an unavailable OpenGL
version caused the application to terminate with a `BadMatch`
Xlib error
- [X11] Bugfix: A synchronization point necessary for jitter-free locked cursor
mode was incorrectly removed
- [X11] Bugfix: The window size hints were not updated when calling
`glfwSetWindowSize` on a non-resizable window
- [Win32] Added support for high-DPI monitors
- [Win32] Changed port to use Unicode mode only
- [Win32] Removed explicit support for versions of Windows older than Windows
XP
- [Win32] Bugfix: Window activation and iconification did not work as expected
- [Win32] Bugfix: Software rasterizer pixel formats were not discarded by the
`WGL_ARB_pixel_format` code path
- [Win32] Bugfix: The array for WGL context attributes was too small and could
overflow
- [Win32] Bugfix: Alt+F4 hot key was not translated into `WM_CLOSE`
- [Win32] Bugfix: The `GLFW_WINDOW_NO_RESIZE` window parameter was always zero
- [Win32] Bugfix: A test was missing for whether all available pixel formats
had been disqualified
## Contact ## Contact
@@ -311,6 +144,7 @@ skills.
- Matt Arsenault - Matt Arsenault
- Keith Bauer - Keith Bauer
- John Bartholomew - John Bartholomew
- Niklas Behrens
- Niklas Bergström - Niklas Bergström
- blanco - blanco
- Lambert Clara - Lambert Clara
@@ -326,6 +160,7 @@ skills.
- Stefan Gustavson - Stefan Gustavson
- Sylvain Hellegouarch - Sylvain Hellegouarch
- heromyth - heromyth
- Paul Holden
- Toni Jovanoski - Toni Jovanoski
- Osman Keskin - Osman Keskin
- Cameron King - Cameron King
@@ -337,6 +172,7 @@ skills.
- Martins Mozeiko - Martins Mozeiko
- Tristam MacDonald - Tristam MacDonald
- Hans Mackowiak - Hans Mackowiak
- Kyle McDonald
- David Medlock - David Medlock
- Jonathan Mercier - Jonathan Mercier
- Marcel Metz - Marcel Metz
-2
View File
@@ -17,6 +17,4 @@ If you have used GLFW 2.x in the past, there is a
[transition guide](@ref moving) that explains what has changed and how to update [transition guide](@ref moving) that explains what has changed and how to update
existing code to use the new API. existing code to use the new API.
As this is still unfinished software, there are still [a number of bugs](@ref bug).
*/ */
+20 -11
View File
@@ -38,10 +38,10 @@ that specific monitor.
@subsection news_30_unicode Unicode support @subsection news_30_unicode Unicode support
All string arguments to GLFW functions and all strings returned by GLFW use the All string arguments to GLFW functions and all strings returned by GLFW now use
UTF-8 encoding. This includes the window title, error string, clipboard text, the UTF-8 encoding. This includes the window title, error string, clipboard
monitor and joystick names as well as the extension function arguments (as ASCII text, monitor and joystick names as well as the extension function arguments (as
is a subset of UTF-8). ASCII is a subset of UTF-8).
@subsection news_30_clipboard Clipboard text I/O @subsection news_30_clipboard Clipboard text I/O
@@ -58,7 +58,7 @@ GLFW now supports setting and reading back the gamma ramp of monitors, with the
glfwSetGamma, which generates a ramp from a gamma value and then sets it. glfwSetGamma, which generates a ramp from a gamma value and then sets it.
@subsection news_30_gles OpenGL ES and EGL support @subsection news_30_gles OpenGL ES support
GLFW now supports the creation of OpenGL ES contexts, by setting the GLFW now supports the creation of OpenGL ES contexts, by setting the
`GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such `GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such
@@ -67,8 +67,11 @@ driver must provide support in a way usable by GLFW. Modern nVidia and Intel
drivers support creation of OpenGL ES context using the GLX and WGL APIs, while drivers support creation of OpenGL ES context using the GLX and WGL APIs, while
AMD provides an EGL implementation instead. AMD provides an EGL implementation instead.
GLFW now has an (experimental) EGL context creation back end, which can be
selected through CMake options. @subsection news_30_egl (Experimental) EGL support
GLFW now has an experimental EGL context creation back end that can be selected
through CMake options.
@subsection news_30_hidpi High-DPI support @subsection news_30_hidpi High-DPI support
@@ -89,20 +92,20 @@ an error code and a description string.
@subsection news_30_wndptr Per-window user pointer @subsection news_30_wndptr Per-window user pointer
Each window object has a user-defined pointer, retrieved with @ref Each window now has a user-defined pointer, retrieved with @ref
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
easier to integrate GLFW into C++ code. easier to integrate GLFW into C++ code.
@subsection news_30_iconifyfun Window iconification callback @subsection news_30_iconifyfun Window iconification callback
Each window object has a callback for iconification and restoration events, Each window now has a callback for iconification and restoration events,
which is set with @ref glfwSetWindowIconifyCallback. which is set with @ref glfwSetWindowIconifyCallback.
@subsection news_30_wndposfun Window position callback @subsection news_30_wndposfun Window position callback
Each window object has a callback for position events, which is set with @ref Each window now has a callback for position events, which is set with @ref
glfwSetWindowPosCallback. glfwSetWindowPosCallback.
@@ -113,10 +116,16 @@ The position of a window can now be retrieved using @ref glfwGetWindowPos.
@subsection news_30_focusfun Window focus callback @subsection news_30_focusfun Window focus callback
Windows now have a callback for focus events, which is set with @ref Each windows now has a callback for focus events, which is set with @ref
glfwSetWindowFocusCallback. glfwSetWindowFocusCallback.
@subsection news_30_enterleave Cursor enter/leave callback
Each window now has a callback for when the mouse cursor enters or leaves its
client area, which is set with @ref glfwSetCursorEnterCallback.
@subsection news_30_wndtitle Initial window title @subsection news_30_wndtitle Initial window title
The title of a window is now specified at creation time, as one of the arguments The title of a window is now specified at creation time, as one of the arguments
+5 -5
View File
@@ -225,7 +225,7 @@ extern "C" {
* API changes. * API changes.
* @ingroup init * @ingroup init
*/ */
#define GLFW_VERSION_REVISION 0 #define GLFW_VERSION_REVISION 1
/*! @} */ /*! @} */
/*! @name Key and button actions /*! @name Key and button actions
@@ -1119,7 +1119,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
/*! @brief Generates a gamma ramp and sets it for the specified monitor. /*! @brief Generates a gamma ramp and sets it for the specified monitor.
* *
* This function generates a 256-element gamma ramp from the specified exponent * This function generates a 256-element gamma ramp from the specified exponent
* and then calls @ref glfwSetGamma with it. * and then calls @ref glfwSetGammaRamp with it.
* *
* @param[in] monitor The monitor whose gamma ramp to set. * @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] gamma The desired exponent. * @param[in] gamma The desired exponent.
@@ -2006,14 +2006,14 @@ GLFWAPI int glfwJoystickPresent(int joy);
*/ */
GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);
/*! @brief Returns the values of all buttons of the specified joystick. /*! @brief Returns the state of all buttons of the specified joystick.
* *
* This function returns the values of all buttons of the specified joystick. * This function returns the state of all buttons of the specified joystick.
* *
* @param[in] joy The joystick to query. * @param[in] joy The joystick to query.
* @param[out] count Where to store the size of the returned array. This is * @param[out] count Where to store the size of the returned array. This is
* set to zero if an error occurred. * set to zero if an error occurred.
* @return An array of axis values, or `NULL` if the joystick is not present. * @return An array of button states, or `NULL` if the joystick is not present.
* *
* @note The returned array is allocated and freed by GLFW. You should not * @note The returned array is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
+2 -2
View File
@@ -60,8 +60,8 @@ extern "C" {
* * `GLFW_EXPOSE_NATIVE_GLX` * * `GLFW_EXPOSE_NATIVE_GLX`
* * `GLFW_EXPOSE_NATIVE_EGL` * * `GLFW_EXPOSE_NATIVE_EGL`
* *
* These macros select which of the native access functions are declared and * These macros select which of the native access functions that are declared
* which platform-specific headers to include. It is then up your (by * and which platform-specific headers to include. It is then up your (by
* definition platform-specific) code to handle which of these should be * definition platform-specific) code to handle which of these should be
* defined. * defined.
*/ */
+3 -3
View File
@@ -81,7 +81,7 @@ if (BUILD_SHARED_LIBS)
target_link_libraries(glfw LINK_INTERFACE_LIBRARIES) target_link_libraries(glfw LINK_INTERFACE_LIBRARIES)
endif() endif()
install(TARGETS glfw if (GLFW_INSTALL)
EXPORT glfwTargets install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})
DESTINATION lib${LIB_SUFFIX} ) endif()
+29 -12
View File
@@ -69,6 +69,16 @@ static float transformY(float y)
return height - y; return height - y;
} }
// Returns the backing rect of the specified window
//
static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect)
{
if ([window->ns.view respondsToSelector:@selector(convertRectToBacking:)])
return [window->ns.view convertRectToBacking:contentRect];
else
return contentRect;
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Delegate for window related notifications // Delegate for window related notifications
@@ -112,7 +122,7 @@ static void centerCursor(_GLFWwindow *window)
[window->nsgl.context update]; [window->nsgl.context update];
const NSRect contentRect = [window->ns.view frame]; const NSRect contentRect = [window->ns.view frame];
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect]; const NSRect fbRect = convertRectToBacking(window, contentRect);
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height); _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
_glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height); _glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height);
@@ -525,7 +535,7 @@ static int translateKey(unsigned int key)
- (void)viewDidChangeBackingProperties - (void)viewDidChangeBackingProperties
{ {
const NSRect contentRect = [window->ns.view frame]; const NSRect contentRect = [window->ns.view frame];
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect]; const NSRect fbRect = convertRectToBacking(window, contentRect);
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height); _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
} }
@@ -678,14 +688,6 @@ static NSString* findAppName(void)
} }
} }
// If we get here, the application is unbundled
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
// Having the app in front of the terminal window is also generally
// handy. There is an NSApplication API to do this, but...
SetFrontProcess(&psn);
char** progname = _NSGetProgname(); char** progname = _NSGetProgname();
if (progname && *progname) if (progname && *progname)
return [NSString stringWithUTF8String:*progname]; return [NSString stringWithUTF8String:*progname];
@@ -771,6 +773,14 @@ static GLboolean initializeAppKit(void)
// Implicitly create shared NSApplication instance // Implicitly create shared NSApplication instance
[GLFWApplication sharedApplication]; [GLFWApplication sharedApplication];
// If we get here, the application is unbundled
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
// Having the app in front of the terminal window is also generally
// handy. There is an NSApplication API to do this, but...
SetFrontProcess(&psn);
#if defined(_GLFW_USE_MENUBAR) #if defined(_GLFW_USE_MENUBAR)
// Menu bar setup must go between sharedApplication above and // Menu bar setup must go between sharedApplication above and
// finishLaunching below, in order to properly emulate the behavior // finishLaunching below, in order to properly emulate the behavior
@@ -815,7 +825,8 @@ static GLboolean createWindow(_GLFWwindow* window,
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window]; window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
[window->ns.view setWantsBestResolutionOpenGLSurface:YES]; if ([window->ns.view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
[window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]]; [window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]];
[window->ns.object setContentView:window->ns.view]; [window->ns.object setContentView:window->ns.view];
@@ -942,7 +953,13 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)
{ {
_glfwPlatformGetWindowSize(window, width, height); const NSRect contentRect = [window->ns.view frame];
const NSRect fbRect = convertRectToBacking(window, contentRect);
if (width)
*width = (int) fbRect.size.width;
if (height)
*height = (int) fbRect.size.height;
} }
void _glfwPlatformIconifyWindow(_GLFWwindow* window) void _glfwPlatformIconifyWindow(_GLFWwindow* window)
+6 -2
View File
@@ -276,9 +276,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
} }
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount); closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
if (closest) if (!closest)
*result = closest->wgl; {
free(usableConfigs);
return GL_FALSE;
}
*result = closest->wgl;
free(usableConfigs); free(usableConfigs);
return GL_TRUE; return GL_TRUE;
-3
View File
@@ -470,10 +470,7 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height)
_GLFW_REQUIRE_INIT(); _GLFW_REQUIRE_INIT();
if (window->iconified) if (window->iconified)
{
// TODO: Figure out if this is an error
return; return;
}
if (window->monitor) if (window->monitor)
{ {
+4
View File
@@ -86,6 +86,10 @@ typedef struct _GLFWwindowX11
GLboolean cursorGrabbed; // True if cursor is currently grabbed GLboolean cursorGrabbed; // True if cursor is currently grabbed
GLboolean cursorHidden; // True if cursor is currently hidden GLboolean cursorHidden; // True if cursor is currently hidden
// Cached position and size used to filter out duplicate events
int width, height;
int xpos, ypos;
// The last received cursor position, regardless of source // The last received cursor position, regardless of source
double cursorPosX, cursorPosY; double cursorPosX, cursorPosY;
// The last position the cursor was warped to by GLFW // The last position the cursor was warped to by GLFW
+26 -9
View File
@@ -291,6 +291,9 @@ static GLboolean createWindow(_GLFWwindow* window,
XRRSelectInput(_glfw.x11.display, window->x11.handle, XRRSelectInput(_glfw.x11.display, window->x11.handle,
RRScreenChangeNotifyMask); RRScreenChangeNotifyMask);
_glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);
_glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);
return GL_TRUE; return GL_TRUE;
} }
@@ -635,17 +638,31 @@ static void processEvent(XEvent *event)
case ConfigureNotify: case ConfigureNotify:
{ {
_glfwInputFramebufferSize(window, if (event->xconfigure.width != window->x11.width ||
event->xconfigure.width, event->xconfigure.height != window->x11.height)
event->xconfigure.height); {
_glfwInputFramebufferSize(window,
event->xconfigure.width,
event->xconfigure.height);
_glfwInputWindowSize(window, _glfwInputWindowSize(window,
event->xconfigure.width, event->xconfigure.width,
event->xconfigure.height); event->xconfigure.height);
_glfwInputWindowPos(window, window->x11.width = event->xconfigure.width;
event->xconfigure.x, window->x11.height = event->xconfigure.height;
event->xconfigure.y); }
if (event->xconfigure.x != window->x11.xpos ||
event->xconfigure.y != window->x11.ypos)
{
_glfwInputWindowPos(window,
event->xconfigure.x,
event->xconfigure.y);
window->x11.xpos = event->xconfigure.x;
window->x11.ypos = event->xconfigure.y;
}
break; break;
} }