AlephNot
AlephNot

Reputation: 148

Blurring Background (Acrylic Effect) in GLFW/OpenGL Window

How do I make the window background display a blurred version all windows below it (similar to the Windows Acrylic Effect).

  1. The DWM BlurBehind is not working and seems to be deprecated.
  2. I cant find any official documentation for SetWindowCompositionAttribute nor any c++ version of the same

Is there any way to use SetWindowCompositionAttribute with a GLFW window ? Or alternatively Render the whole window (effectively screen capture) to a frame buffer and then manually apply the blur? What is the viability of such a method for a lightweight application?

Upvotes: 3

Views: 862

Answers (1)

GLFW itself does not support such a feature, however, there is an open issue for it.

You can write platform specific code with GLFW. GLFW provides functions to retrieve the underlying platform specific constructs.

Something like this might work (version 3.4):

if (glfwGetPlatform() == GLFW_PLATFORM_WIN32) {
    HWND nativeWindow = glfwGetWin32Window(window);

    const HRESULT returnCode = DwmSetWindowAttribute(
        nativeWindow,
        ...,
        ...,
        ...
    );
}

Upvotes: 1

Related Questions