mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Add ability to check GLFW_TRANSPARENT hint outcome with
`glfwGetWindowAttrib()` To make this possible, in situations where GLFW_TRANSPARENT is requested but failed to match with a FBConfig, the internal framebufer hint is set to GLFW_FALSE. glfwGetWindowAttrib() then relies on the internal `_glfw.framebuffer.hint.transparent` bool.
This commit is contained in:
parent
3b5d58cc46
commit
349f06d632
@ -289,7 +289,9 @@ constraint. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||
|
||||
@anchor GLFW_TRANSPARENT
|
||||
__GLFW_TRANSPARENT__ specifies whether the framebuffer will support transparency
|
||||
in the background. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||
in the background. If transparency is not provided by your driver, GLFW will
|
||||
gracefully fallback to opaque. It is possible to check for this outcome
|
||||
with `glfwGetWindowAttrib()`. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||
|
||||
|
||||
@subsubsection window_hints_mtr Monitor related hints
|
||||
|
@ -318,6 +318,12 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
||||
}
|
||||
}
|
||||
|
||||
if (desired->transparent && closest->transparent != GLFW_TRUE)
|
||||
{
|
||||
// If we couldn't find a transparency match,
|
||||
// update the fb hint for client checking.
|
||||
_glfw.hints.framebuffer.transparent = GLFW_FALSE;
|
||||
}
|
||||
return closest;
|
||||
}
|
||||
|
||||
|
@ -732,6 +732,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib)
|
||||
return window->resizable;
|
||||
case GLFW_DECORATED:
|
||||
return window->decorated;
|
||||
case GLFW_TRANSPARENT:
|
||||
return _glfw.hints.framebuffer.transparent;
|
||||
case GLFW_FLOATING:
|
||||
return window->floating;
|
||||
case GLFW_AUTO_ICONIFY:
|
||||
|
Loading…
Reference in New Issue
Block a user