mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 22:32:50 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22e1aa6cfc | |||
| 1c79d8a8e4 | |||
| d5cd6ec8eb | |||
| eba8168a03 | |||
| a7ff236b32 | |||
| d31322cdcd | |||
| 61f7de5a25 | |||
| e4d9e03efc | |||
| bff77eeed1 | |||
| e93bade240 | |||
| f1c88b41f2 | |||
| 77e4c61190 | |||
| 3a5fcfba06 | |||
| c9bd191edb | |||
| 77572bdf6e | |||
| ccb810bed9 | |||
| fdaebdd169 | |||
| 74d355fae4 | |||
| 2cc2e8acd7 | |||
| dbef5ea46b | |||
| c38f33adda |
+25
-29
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set(GLFW_VERSION_MAJOR "3")
|
||||
set(GLFW_VERSION_MINOR "0")
|
||||
set(GLFW_VERSION_PATCH "0")
|
||||
set(GLFW_VERSION_PATCH "1")
|
||||
set(GLFW_VERSION_EXTRA "")
|
||||
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
|
||||
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_TESTS "Build the GLFW test programs" ON)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
option(GLFW_INSTALL "Generate installation target" ON)
|
||||
|
||||
set(DOXYGEN_SKIP_DOT TRUE)
|
||||
find_package(Doxygen)
|
||||
@@ -199,11 +200,10 @@ if (_GLFW_X11)
|
||||
list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm")
|
||||
|
||||
# NOTE: This is a workaround for CMake bug 0006976 (missing
|
||||
# X11_xf86vmode_LIB variable)
|
||||
if (X11_xf86vmode_LIB)
|
||||
list(APPEND glfw_LIBRARIES ${X11_xf86vmode_LIB})
|
||||
if (X11_Xxf86vm_LIB)
|
||||
list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB})
|
||||
else()
|
||||
# Backwards compatibility (see CMake bug 0006976)
|
||||
list(APPEND glfw_LIBRARIES Xxf86vm)
|
||||
endif()
|
||||
|
||||
@@ -390,45 +390,41 @@ configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
|
||||
${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
|
||||
${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY)
|
||||
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in
|
||||
${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)
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
|
||||
${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()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Uninstall operation
|
||||
# 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
|
||||
${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GLFW 3.0
|
||||
# GLFW
|
||||
|
||||
## 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
|
||||
creating windows and contexts, reading input, handling events, etc.
|
||||
|
||||
Version 3.0 brings a new API with many new features such as multiple windows
|
||||
and contexts, multi-monitor support, EGL and OpenGL ES support, clipboard text
|
||||
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).
|
||||
Version 3.0.1 adds fixes for a number of bugs that together affect all supported
|
||||
platforms. As this is a patch release, there are no API changes.
|
||||
|
||||
If you are new to GLFW, you may find the
|
||||
[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/).
|
||||
|
||||
|
||||
## Changes for version 3.0
|
||||
## Changelog
|
||||
|
||||
- Added `GLFWmonitor` and updated monitor-related functions to take a monitor
|
||||
handle
|
||||
- Added `glfwGetMonitors` and `glfwGetPrimaryMonitor` for enumerating available
|
||||
monitors
|
||||
- Added `glfwGetMonitorPos`, `glfwGetMonitorPhysicalSize` and
|
||||
`glfwGetMonitorName` for retrieving monitor properties
|
||||
- Added `glfwSetMonitorCallback` and `GLFWmonitorfun` for notification of
|
||||
changes in the set of available monitors
|
||||
- Added `GLFWwindow` and updated window-related functions and callbacks to take
|
||||
a window handle
|
||||
- Added `glfwSetWindowShouldClose` and `glfwWindowShouldClose` for setting and
|
||||
retrieving the window close flag
|
||||
- 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
|
||||
- Bugfix: The wrong name was used for the CMake variable for the Xxf86vm
|
||||
library
|
||||
- [Cocoa] Bugfix: `glfwGetFramebufferSize` return the size in screen
|
||||
coordinates
|
||||
- [Cocoa] Bugfix: Messages not supported on Mac OS X 10.6 were used without
|
||||
tests for precence
|
||||
- [Cocoa] Bugfix: Process transformation was not performed if menu bar creation
|
||||
was disabled
|
||||
- [Win32] Bugfix: Context creation was attempted even if no valid pixel formats
|
||||
had been found
|
||||
- [X11] Bugfix: Duplicate window position and window and framebuffer size
|
||||
events were reported
|
||||
|
||||
|
||||
## Contact
|
||||
@@ -311,6 +144,7 @@ skills.
|
||||
- Matt Arsenault
|
||||
- Keith Bauer
|
||||
- John Bartholomew
|
||||
- Niklas Behrens
|
||||
- Niklas Bergström
|
||||
- blanco
|
||||
- Lambert Clara
|
||||
@@ -326,6 +160,7 @@ skills.
|
||||
- Stefan Gustavson
|
||||
- Sylvain Hellegouarch
|
||||
- heromyth
|
||||
- Paul Holden
|
||||
- Toni Jovanoski
|
||||
- Osman Keskin
|
||||
- Cameron King
|
||||
@@ -337,6 +172,7 @@ skills.
|
||||
- Martins Mozeiko
|
||||
- Tristam MacDonald
|
||||
- Hans Mackowiak
|
||||
- Kyle McDonald
|
||||
- David Medlock
|
||||
- Jonathan Mercier
|
||||
- Marcel Metz
|
||||
|
||||
@@ -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
|
||||
existing code to use the new API.
|
||||
|
||||
As this is still unfinished software, there are still [a number of bugs](@ref bug).
|
||||
|
||||
*/
|
||||
|
||||
+173
-164
@@ -1,164 +1,173 @@
|
||||
/*!
|
||||
|
||||
@page news New features
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@section news_30 New features in version 3.0
|
||||
|
||||
@subsection news_30_cmake CMake build system
|
||||
|
||||
GLFW now uses the CMake build system instead of the various makefiles and
|
||||
project files used by earlier versions. CMake is available for all platforms
|
||||
supported by GLFW, is present in most package systems and can generate
|
||||
makefiles and/or project files for most popular development environments.
|
||||
|
||||
For more information on how to use CMake, see the
|
||||
[CMake manual](http://cmake.org/cmake/help/documentation.html).
|
||||
|
||||
|
||||
@subsection new_30_multiwnd Multi-window support
|
||||
|
||||
GLFW now supports the creation of multiple windows, each with their own OpenGL
|
||||
or OpenGL ES context, and all window functions now take a window handle. Event
|
||||
callbacks are now per-window and are provided with the handle of the window that
|
||||
received the event. The @ref glfwMakeContextCurrent function has been added to
|
||||
select which context is current on a given thread.
|
||||
|
||||
|
||||
@subsection news_30_multimon Multi-monitor support
|
||||
|
||||
GLFW now explicitly supports multiple monitors. They can be enumerated with
|
||||
@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
|
||||
glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
|
||||
and specified at window creation to make the newly created window full screen on
|
||||
that specific monitor.
|
||||
|
||||
|
||||
@subsection news_30_unicode Unicode support
|
||||
|
||||
All string arguments to GLFW functions and all strings returned by GLFW use the
|
||||
UTF-8 encoding. This includes the window title, error string, clipboard text,
|
||||
monitor and joystick names as well as the extension function arguments (as ASCII
|
||||
is a subset of UTF-8).
|
||||
|
||||
|
||||
@subsection news_30_clipboard Clipboard text I/O
|
||||
|
||||
GLFW now supports reading and writing plain text to and from the system
|
||||
clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
|
||||
functions.
|
||||
|
||||
|
||||
@subsection news_30_gamma Gamma ramp support
|
||||
|
||||
GLFW now supports setting and reading back the gamma ramp of monitors, with the
|
||||
@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref
|
||||
glfwSetGamma, which generates a ramp from a gamma value and then sets it.
|
||||
|
||||
|
||||
@subsection news_30_gles OpenGL ES and EGL support
|
||||
|
||||
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
|
||||
contexts are supported. Note that GLFW *does not implement* OpenGL ES, so your
|
||||
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
|
||||
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_hidpi High-DPI support
|
||||
|
||||
GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full
|
||||
resolution framebuffers where other UI elements are scaled up. To achieve this,
|
||||
@ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been
|
||||
added. These work with pixels, while the rest of the GLFW API work with screen
|
||||
coordinates.
|
||||
|
||||
|
||||
@subsection news_30_error Error callback
|
||||
|
||||
GLFW now has an error callback, which can provide your application with much
|
||||
more detailed diagnostics than was previously possible. The callback is passed
|
||||
an error code and a description string.
|
||||
|
||||
|
||||
@subsection news_30_wndptr Per-window user pointer
|
||||
|
||||
Each window object has a user-defined pointer, retrieved with @ref
|
||||
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
|
||||
easier to integrate GLFW into C++ code.
|
||||
|
||||
|
||||
@subsection news_30_iconifyfun Window iconification callback
|
||||
|
||||
Each window object has a callback for iconification and restoration events,
|
||||
which is set with @ref glfwSetWindowIconifyCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndposfun Window position callback
|
||||
|
||||
Each window object has a callback for position events, which is set with @ref
|
||||
glfwSetWindowPosCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndpos Window position query
|
||||
|
||||
The position of a window can now be retrieved using @ref glfwGetWindowPos.
|
||||
|
||||
|
||||
@subsection news_30_focusfun Window focus callback
|
||||
|
||||
Windows now have a callback for focus events, which is set with @ref
|
||||
glfwSetWindowFocusCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndtitle Initial window title
|
||||
|
||||
The title of a window is now specified at creation time, as one of the arguments
|
||||
to @ref glfwCreateWindow.
|
||||
|
||||
|
||||
@subsection news_30_hidden Hidden windows
|
||||
|
||||
Windows can now be hidden with @ref glfwHideWindow, shown using @ref
|
||||
glfwShowWindow and created initially hidden with the `GLFW_VISIBLE` window hint.
|
||||
This allows for off-screen rendering in a way compatible with most drivers, as
|
||||
well as moving a window to a specific position before showing it.
|
||||
|
||||
|
||||
@subsection news_30_undecorated Undecorated windows
|
||||
|
||||
Windowed mode windows can now be created without decorations, i.e. things like
|
||||
a frame, a title bar, with the `GLFW_DECORATED` window hint. This allows for
|
||||
the creation of things like splash screens.
|
||||
|
||||
|
||||
@subsection news_30_keymods Modifier key bit masks
|
||||
|
||||
[Modifier key bit mask](@ref mods) parameters have been added to the
|
||||
[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
|
||||
|
||||
|
||||
@subsection news_30_scancode Platform-specific scancodes
|
||||
|
||||
A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
|
||||
that don't have a [key token](@ref keys) still get passed on with the key
|
||||
parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines
|
||||
and are intended to be used for key bindings.
|
||||
|
||||
|
||||
@subsection news_30_jsname Joystick names
|
||||
|
||||
The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
|
||||
|
||||
|
||||
@subsection news_30_doxygen Doxygen documentation
|
||||
|
||||
You are reading it.
|
||||
|
||||
*/
|
||||
/*!
|
||||
|
||||
@page news New features
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@section news_30 New features in version 3.0
|
||||
|
||||
@subsection news_30_cmake CMake build system
|
||||
|
||||
GLFW now uses the CMake build system instead of the various makefiles and
|
||||
project files used by earlier versions. CMake is available for all platforms
|
||||
supported by GLFW, is present in most package systems and can generate
|
||||
makefiles and/or project files for most popular development environments.
|
||||
|
||||
For more information on how to use CMake, see the
|
||||
[CMake manual](http://cmake.org/cmake/help/documentation.html).
|
||||
|
||||
|
||||
@subsection new_30_multiwnd Multi-window support
|
||||
|
||||
GLFW now supports the creation of multiple windows, each with their own OpenGL
|
||||
or OpenGL ES context, and all window functions now take a window handle. Event
|
||||
callbacks are now per-window and are provided with the handle of the window that
|
||||
received the event. The @ref glfwMakeContextCurrent function has been added to
|
||||
select which context is current on a given thread.
|
||||
|
||||
|
||||
@subsection news_30_multimon Multi-monitor support
|
||||
|
||||
GLFW now explicitly supports multiple monitors. They can be enumerated with
|
||||
@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
|
||||
glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
|
||||
and specified at window creation to make the newly created window full screen on
|
||||
that specific monitor.
|
||||
|
||||
|
||||
@subsection news_30_unicode Unicode support
|
||||
|
||||
All string arguments to GLFW functions and all strings returned by GLFW now use
|
||||
the UTF-8 encoding. This includes the window title, error string, clipboard
|
||||
text, monitor and joystick names as well as the extension function arguments (as
|
||||
ASCII is a subset of UTF-8).
|
||||
|
||||
|
||||
@subsection news_30_clipboard Clipboard text I/O
|
||||
|
||||
GLFW now supports reading and writing plain text to and from the system
|
||||
clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
|
||||
functions.
|
||||
|
||||
|
||||
@subsection news_30_gamma Gamma ramp support
|
||||
|
||||
GLFW now supports setting and reading back the gamma ramp of monitors, with the
|
||||
@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref
|
||||
glfwSetGamma, which generates a ramp from a gamma value and then sets it.
|
||||
|
||||
|
||||
@subsection news_30_gles OpenGL ES support
|
||||
|
||||
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
|
||||
contexts are supported. Note that GLFW *does not implement* OpenGL ES, so your
|
||||
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
|
||||
AMD provides an EGL implementation instead.
|
||||
|
||||
|
||||
@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
|
||||
|
||||
GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full
|
||||
resolution framebuffers where other UI elements are scaled up. To achieve this,
|
||||
@ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been
|
||||
added. These work with pixels, while the rest of the GLFW API work with screen
|
||||
coordinates.
|
||||
|
||||
|
||||
@subsection news_30_error Error callback
|
||||
|
||||
GLFW now has an error callback, which can provide your application with much
|
||||
more detailed diagnostics than was previously possible. The callback is passed
|
||||
an error code and a description string.
|
||||
|
||||
|
||||
@subsection news_30_wndptr Per-window user pointer
|
||||
|
||||
Each window now has a user-defined pointer, retrieved with @ref
|
||||
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
|
||||
easier to integrate GLFW into C++ code.
|
||||
|
||||
|
||||
@subsection news_30_iconifyfun Window iconification callback
|
||||
|
||||
Each window now has a callback for iconification and restoration events,
|
||||
which is set with @ref glfwSetWindowIconifyCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndposfun Window position callback
|
||||
|
||||
Each window now has a callback for position events, which is set with @ref
|
||||
glfwSetWindowPosCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndpos Window position query
|
||||
|
||||
The position of a window can now be retrieved using @ref glfwGetWindowPos.
|
||||
|
||||
|
||||
@subsection news_30_focusfun Window focus callback
|
||||
|
||||
Each windows now has a callback for focus events, which is set with @ref
|
||||
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
|
||||
|
||||
The title of a window is now specified at creation time, as one of the arguments
|
||||
to @ref glfwCreateWindow.
|
||||
|
||||
|
||||
@subsection news_30_hidden Hidden windows
|
||||
|
||||
Windows can now be hidden with @ref glfwHideWindow, shown using @ref
|
||||
glfwShowWindow and created initially hidden with the `GLFW_VISIBLE` window hint.
|
||||
This allows for off-screen rendering in a way compatible with most drivers, as
|
||||
well as moving a window to a specific position before showing it.
|
||||
|
||||
|
||||
@subsection news_30_undecorated Undecorated windows
|
||||
|
||||
Windowed mode windows can now be created without decorations, i.e. things like
|
||||
a frame, a title bar, with the `GLFW_DECORATED` window hint. This allows for
|
||||
the creation of things like splash screens.
|
||||
|
||||
|
||||
@subsection news_30_keymods Modifier key bit masks
|
||||
|
||||
[Modifier key bit mask](@ref mods) parameters have been added to the
|
||||
[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
|
||||
|
||||
|
||||
@subsection news_30_scancode Platform-specific scancodes
|
||||
|
||||
A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
|
||||
that don't have a [key token](@ref keys) still get passed on with the key
|
||||
parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines
|
||||
and are intended to be used for key bindings.
|
||||
|
||||
|
||||
@subsection news_30_jsname Joystick names
|
||||
|
||||
The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
|
||||
|
||||
|
||||
@subsection news_30_doxygen Doxygen documentation
|
||||
|
||||
You are reading it.
|
||||
|
||||
*/
|
||||
|
||||
@@ -225,7 +225,7 @@ extern "C" {
|
||||
* API changes.
|
||||
* @ingroup init
|
||||
*/
|
||||
#define GLFW_VERSION_REVISION 0
|
||||
#define GLFW_VERSION_REVISION 1
|
||||
/*! @} */
|
||||
|
||||
/*! @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.
|
||||
*
|
||||
* 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] gamma The desired exponent.
|
||||
@@ -2006,14 +2006,14 @@ GLFWAPI int glfwJoystickPresent(int joy);
|
||||
*/
|
||||
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[out] count Where to store the size of the returned array. This is
|
||||
* 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
|
||||
* free it yourself.
|
||||
|
||||
@@ -60,8 +60,8 @@ extern "C" {
|
||||
* * `GLFW_EXPOSE_NATIVE_GLX`
|
||||
* * `GLFW_EXPOSE_NATIVE_EGL`
|
||||
*
|
||||
* These macros select which of the native access functions are declared and
|
||||
* which platform-specific headers to include. It is then up your (by
|
||||
* These macros select which of the native access functions that are declared
|
||||
* and which platform-specific headers to include. It is then up your (by
|
||||
* definition platform-specific) code to handle which of these should be
|
||||
* defined.
|
||||
*/
|
||||
|
||||
+3
-3
@@ -81,7 +81,7 @@ if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(glfw LINK_INTERFACE_LIBRARIES)
|
||||
endif()
|
||||
|
||||
install(TARGETS glfw
|
||||
EXPORT glfwTargets
|
||||
DESTINATION lib${LIB_SUFFIX} )
|
||||
if (GLFW_INSTALL)
|
||||
install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})
|
||||
endif()
|
||||
|
||||
|
||||
+29
-12
@@ -69,6 +69,16 @@ static float transformY(float 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
|
||||
@@ -112,7 +122,7 @@ static void centerCursor(_GLFWwindow *window)
|
||||
[window->nsgl.context update];
|
||||
|
||||
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);
|
||||
_glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height);
|
||||
@@ -525,7 +535,7 @@ static int translateKey(unsigned int key)
|
||||
- (void)viewDidChangeBackingProperties
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -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();
|
||||
if (progname && *progname)
|
||||
return [NSString stringWithUTF8String:*progname];
|
||||
@@ -771,6 +773,14 @@ static GLboolean initializeAppKit(void)
|
||||
// Implicitly create shared NSApplication instance
|
||||
[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)
|
||||
// Menu bar setup must go between sharedApplication above and
|
||||
// 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 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 setContentView:window->ns.view];
|
||||
@@ -942,7 +953,13 @@ void _glfwPlatformSetWindowSize(_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)
|
||||
|
||||
+6
-2
@@ -276,9 +276,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window,
|
||||
}
|
||||
|
||||
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
|
||||
if (closest)
|
||||
*result = closest->wgl;
|
||||
if (!closest)
|
||||
{
|
||||
free(usableConfigs);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
*result = closest->wgl;
|
||||
free(usableConfigs);
|
||||
|
||||
return GL_TRUE;
|
||||
|
||||
@@ -470,10 +470,7 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height)
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
if (window->iconified)
|
||||
{
|
||||
// TODO: Figure out if this is an error
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->monitor)
|
||||
{
|
||||
|
||||
@@ -86,6 +86,10 @@ typedef struct _GLFWwindowX11
|
||||
GLboolean cursorGrabbed; // True if cursor is currently grabbed
|
||||
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
|
||||
double cursorPosX, cursorPosY;
|
||||
// The last position the cursor was warped to by GLFW
|
||||
|
||||
+26
-9
@@ -291,6 +291,9 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
XRRSelectInput(_glfw.x11.display, window->x11.handle,
|
||||
RRScreenChangeNotifyMask);
|
||||
|
||||
_glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos);
|
||||
_glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
@@ -635,17 +638,31 @@ static void processEvent(XEvent *event)
|
||||
|
||||
case ConfigureNotify:
|
||||
{
|
||||
_glfwInputFramebufferSize(window,
|
||||
event->xconfigure.width,
|
||||
event->xconfigure.height);
|
||||
if (event->xconfigure.width != window->x11.width ||
|
||||
event->xconfigure.height != window->x11.height)
|
||||
{
|
||||
_glfwInputFramebufferSize(window,
|
||||
event->xconfigure.width,
|
||||
event->xconfigure.height);
|
||||
|
||||
_glfwInputWindowSize(window,
|
||||
event->xconfigure.width,
|
||||
event->xconfigure.height);
|
||||
_glfwInputWindowSize(window,
|
||||
event->xconfigure.width,
|
||||
event->xconfigure.height);
|
||||
|
||||
_glfwInputWindowPos(window,
|
||||
event->xconfigure.x,
|
||||
event->xconfigure.y);
|
||||
window->x11.width = event->xconfigure.width;
|
||||
window->x11.height = event->xconfigure.height;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user