mirror of
https://github.com/glfw/glfw.git
synced 2026-09-23 00:59:48 +00:00
Add glfwGetWindowOpacity and glfwSetWindowOpacity
This adds support for setting the opacity of the whole window, including any decorations. Fixes #1089.
This commit is contained in:
@@ -2837,6 +2837,62 @@ GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int
|
||||
*/
|
||||
GLFWAPI void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
|
||||
|
||||
/*! @brief Returns the opacity of the whole window.
|
||||
*
|
||||
* This function returns the opacity of the window, including any decorations.
|
||||
*
|
||||
* The opacity (or alpha) value is a positive finite number between zero and
|
||||
* one, where zero is fully transparent and one is fully opaque. If the system
|
||||
* does not support whole window transparency, this function always returns one.
|
||||
*
|
||||
* The initial opacity value for newly created windows is one.
|
||||
*
|
||||
* @param[in] window The window to query.
|
||||
* @return The opacity value of the specified window.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @sa @ref window_transparency
|
||||
* @sa @ref glfwSetWindowOpacity
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup window
|
||||
*/
|
||||
GLFWAPI float glfwGetWindowOpacity(GLFWwindow* window);
|
||||
|
||||
/*! @brief Sets the opacity of the whole window.
|
||||
*
|
||||
* This function sets the opacity of the window, including any decorations.
|
||||
*
|
||||
* The opacity (or alpha) value is a positive finite number between zero and
|
||||
* one, where zero is fully transparent and one is fully opaque.
|
||||
*
|
||||
* The initial opacity value for newly created windows is one.
|
||||
*
|
||||
* A window created with framebuffer transparency may not use whole window
|
||||
* transparency. The results of doing this are undefined.
|
||||
*
|
||||
* @param[in] window The window to set the opacity for.
|
||||
* @param[in] opacity The desired opacity of the specified window.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @sa @ref window_transparency
|
||||
* @sa @ref glfwGetWindowOpacity
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup window
|
||||
*/
|
||||
GLFWAPI void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
|
||||
|
||||
/*! @brief Iconifies the specified window.
|
||||
*
|
||||
* This function iconifies (minimizes) the specified window if it was
|
||||
|
||||
Reference in New Issue
Block a user