Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetNextWindowBgAlpha on docking branch #4629

Open
pp9999 opened this issue Oct 5, 2021 · 1 comment
Open

SetNextWindowBgAlpha on docking branch #4629

pp9999 opened this issue Oct 5, 2021 · 1 comment

Comments

@pp9999
Copy link

pp9999 commented Oct 5, 2021

Version/Branch of Dear ImGui:
Version: 1.83
Branch: docking

Back-end/Renderer/Compiler/OS
Windows 10
Microsoft Visual Studio Community 2019
Windows SDK: 10.0.18362.0
Platform toolset: v142
C++ standard: C++17
C: C17
Directx9.
Code.

ImGui::SetNextWindowSize(ImVec2(rs.right - rs.left, rs.bottom - rs.top)); ImGui::SetNextWindowPos(ImVec2(rs.left, rs.top + NewPositon)); ImGui::SetNextWindowBgAlpha(0.f); ImGui::Begin("Bug", 0, ImGuiWindowFlags_NoDecoration); ImGui::End();

It is docking branch. I want to set window background clear with SetNextWindowBgAlpha. For some reason it does not work. It works normaly. But soon as I set
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; and
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) { ImGui::UpdatePlatformWindows(); ImGui::RenderPlatformWindowsDefault(); }
It don't. It displays that "Bug" window as black box.
Edit:
I has 2 windows created. So tried to apply SetNextWindowBgAlpha to first window and it worked! For first window. Second one is still black.
branxh1
Edit: Noticed that "Bug" window goes clear when I reduce its size to fit into sizes declared in CreateWindowEx!
I am thinking that code that allows creating docking branch windows anywhere on windows desktop is different from my CreateWindowEx. Mine uses WS_EX_TOPMOST | WS_EX_LAYERED

@ocornut
Copy link
Owner

ocornut commented Jan 4, 2022

Hello,

You didn't specify which backends you are using which makes it hard to help you.

To start I think you can hack/modify your backend code and see how you can get the desired result.
When it works, sharing that code would be useful and we can decide how to correctly expose it.
Generally this ties to finishing/formalizing the work on #2766

You can also save platform_io.Platform_CreateWindow and platform_io.Platform_UpdateWindow, redirect them to your own code which will call the original backend code and apply extra modifications too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants