Rename framebuffer transparency hint

This is a breaking change of an unreleased API.
This commit is contained in:
Camilla Löwy 2017-11-07 22:50:01 +01:00
parent baed2dad56
commit 49130ab8ec
7 changed files with 31 additions and 25 deletions

View File

@ -152,8 +152,8 @@ information on what to include when reporting a bug.
functions for accessing X11 primary selection (#894,#1056) functions for accessing X11 primary selection (#894,#1056)
- Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#850) - Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#850)
- Added definition of `GLAPIENTRY` to public header - Added definition of `GLAPIENTRY` to public header
- Added `GLFW_TRANSPARENT` window hint for enabling window framebuffer - Added `GLFW_TRANSPARENT_FRAMEBUFFER` window hint for enabling window
transparency (#197,#663,#715,#723,#1078) framebuffer transparency (#197,#663,#715,#723,#1078)
- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering - Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
(#749,#842) (#749,#842)
- Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889) - Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889)

View File

@ -82,8 +82,8 @@ extension, regular accelerated mouse motion will be used.
GLFW uses both the XRender extension and the compositing manager to support GLFW uses both the XRender extension and the compositing manager to support
transparent window framebuffers. If the running X server does not support this transparent window framebuffers. If the running X server does not support this
extension or there is no running compositing manager, the `GLFW_TRANSPARENT` extension or there is no running compositing manager, the
framebuffer hint will have no effect. `GLFW_TRANSPARENT_FRAMEBUFFER` framebuffer hint will have no effect.
@section compat_glx GLX extensions @section compat_glx GLX extensions

View File

@ -97,8 +97,9 @@ be disabled with the @ref GLFW_JOYSTICK_HAT_BUTTONS init hint.
@subsection news_33_transparent Support for transparent window framebuffer @subsection news_33_transparent Support for transparent window framebuffer
GLFW now supports the creation of windows with transparent framebuffers on GLFW now supports the creation of windows with transparent framebuffers on
systems with desktop compositing enabled with the @ref GLFW_TRANSPARENT window systems with desktop compositing enabled with the @ref
hint and attribute. Any window decorations will still be opaque. GLFW_TRANSPARENT_FRAMEBUFFER window hint and attribute. Any window decorations
will still be opaque.
@subsection news_33_centercursor Cursor centering window hint @subsection news_33_centercursor Cursor centering window hint

View File

@ -225,9 +225,9 @@ __GLFW_CENTER_CURSOR__ specifies whether the cursor should be centered over
newly created full screen windows. Possible values are `GLFW_TRUE` and newly created full screen windows. Possible values are `GLFW_TRUE` and
`GLFW_FALSE`. This hint is ignored for windowed mode windows. `GLFW_FALSE`. This hint is ignored for windowed mode windows.
@anchor GLFW_TRANSPARENT_hint @anchor GLFW_TRANSPARENT_FRAMEBUFFER_hint
__GLFW_TRANSPARENT__ specifies whether the window framebuffer will be __GLFW_TRANSPARENT_FRAMEBUFFER__ specifies whether the window framebuffer will
transparent. If enabled and supported by the system, the window framebuffer be transparent. If enabled and supported by the system, the window framebuffer
alpha channel will be used to combine the framebuffer with the background. This alpha channel will be used to combine the framebuffer with the background. This
does not affect window decorations. Possible values are `GLFW_TRUE` and does not affect window decorations. Possible values are `GLFW_TRUE` and
`GLFW_FALSE`. `GLFW_FALSE`.
@ -477,7 +477,7 @@ GLFW_AUTO_ICONIFY | `GLFW_TRUE` | `GLFW_TRUE` or `GL
GLFW_FLOATING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` GLFW_FLOATING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_MAXIMIZED | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` GLFW_MAXIMIZED | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_CENTER_CURSOR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` GLFW_CENTER_CURSOR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_TRANSPARENT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` GLFW_TRANSPARENT_FRAMEBUFFER | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_RED_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` GLFW_RED_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_GREEN_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` GLFW_GREEN_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_BLUE_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` GLFW_BLUE_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
@ -1092,21 +1092,24 @@ the window or framebuffer is resized.
@subsection window_transparency Window transparency @subsection window_transparency Window transparency
Window framebuffers can be made transparent on a per-pixel per-frame basis with Window framebuffers can be made transparent on a per-pixel per-frame basis with
the [GLFW_TRANSPARENT](@ref GLFW_TRANSPARENT_hint) window hint. the [GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint)
window hint.
@code @code
glfwWindowHint(GLFW_TRANSPARENT, GLFW_TRUE); glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
@endcode @endcode
If supported by the system, the window framebuffer will be composited with the If supported by the system, the window content area will be composited with the
background using the framebuffer per-pixel alpha channel. This requires desktop background using the framebuffer per-pixel alpha channel. This requires desktop
compositing to be enabled on the system. It does not affect window decorations. compositing to be enabled on the system. It does not affect window decorations.
You can check whether the window framebuffer was successfully made transparent You can check whether the window framebuffer was successfully made transparent
with the [GLFW_TRANSPARENT](@ref GLFW_TRANSPARENT_attrib) window attribute. with the
[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib)
window attribute.
@code @code
if (glfwGetWindowAttrib(window, GLFW_TRANSPARENT)) if (glfwGetWindowAttrib(window, GLFW_TRANSPARENT_FRAMEBUFFER))
{ {
// window framebuffer is currently transparent // window framebuffer is currently transparent
} }
@ -1182,10 +1185,11 @@ called topmost or always-on-top. This can be set before creation with the
[GLFW_FLOATING](@ref GLFW_FLOATING_hint) window hint or after with @ref [GLFW_FLOATING](@ref GLFW_FLOATING_hint) window hint or after with @ref
glfwSetWindowAttrib. glfwSetWindowAttrib.
@anchor GLFW_TRANSPARENT_attrib @anchor GLFW_TRANSPARENT_FRAMEBUFFER_attrib
__GLFW_TRANSPARENT__ indicates whether the specified window has a transparent __GLFW_TRANSPARENT_FRAMEBUFFER__ indicates whether the specified window has
framebuffer, i.e. the window contents is composited with the background using a transparent framebuffer, i.e. the window contents is composited with the
the window framebuffer alpha channel. See @ref window_transparency for details. background using the window framebuffer alpha channel. See @ref
window_transparency for details.
@subsubsection window_attribs_ctx Context related attributes @subsubsection window_attribs_ctx Context related attributes

View File

@ -312,7 +312,7 @@ int main(int argc, char *argv[])
} }
glfwWindowHint(GLFW_DEPTH_BITS, 16); glfwWindowHint(GLFW_DEPTH_BITS, 16);
glfwWindowHint(GLFW_TRANSPARENT, GLFW_TRUE); glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL ); window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
if (!window) if (!window)

View File

@ -789,10 +789,11 @@ extern "C" {
#define GLFW_CENTER_CURSOR 0x00020009 #define GLFW_CENTER_CURSOR 0x00020009
/*! @brief Window framebuffer transparency hint and attribute /*! @brief Window framebuffer transparency hint and attribute
* *
* Window framebuffer transparency [window hint](@ref GLFW_TRANSPARENT_hint) * Window framebuffer transparency
* and [window attribute](@ref GLFW_TRANSPARENT_attrib). * [window hint](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) and
* [window attribute](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib).
*/ */
#define GLFW_TRANSPARENT 0x0002000A #define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A
/*! @brief Framebuffer bit depth hint. /*! @brief Framebuffer bit depth hint.
* *

View File

@ -316,7 +316,7 @@ GLFWAPI void glfwWindowHint(int hint, int value)
case GLFW_DOUBLEBUFFER: case GLFW_DOUBLEBUFFER:
_glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE; _glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE;
return; return;
case GLFW_TRANSPARENT: case GLFW_TRANSPARENT_FRAMEBUFFER:
_glfw.hints.framebuffer.transparent = value ? GLFW_TRUE : GLFW_FALSE; _glfw.hints.framebuffer.transparent = value ? GLFW_TRUE : GLFW_FALSE;
return; return;
case GLFW_SAMPLES: case GLFW_SAMPLES:
@ -743,7 +743,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
return _glfwPlatformWindowVisible(window); return _glfwPlatformWindowVisible(window);
case GLFW_MAXIMIZED: case GLFW_MAXIMIZED:
return _glfwPlatformWindowMaximized(window); return _glfwPlatformWindowMaximized(window);
case GLFW_TRANSPARENT: case GLFW_TRANSPARENT_FRAMEBUFFER:
return _glfwPlatformFramebufferTransparent(window); return _glfwPlatformFramebufferTransparent(window);
case GLFW_RESIZABLE: case GLFW_RESIZABLE:
return window->resizable; return window->resizable;