Skip to content
Snippets Groups Projects
Commit d492138b authored by Christian Mattes's avatar Christian Mattes
Browse files

Made multiple imguis possible

parent 078da71f
Branches
No related tags found
No related merge requests found
......@@ -112,6 +112,7 @@ void VRImgui::update(const glm::mat4 &screenPose,
vmouse.z *= mHeight * pixels_per_meter;
mVMouse = vmouse;
mImgui->makeCurrent();
auto& io = ::ImGui::GetIO();
if (pointer.y > -0.1f && pointer.y < 0.1f) {
......@@ -153,7 +154,7 @@ bool VRImgui::visible() const
bool VRImgui::enabled() const
{
return mCurrentOpacity > 0.5f && mTargetOpacity > 0.5f;
return !mBlocked && mCurrentOpacity > 0.5f && mTargetOpacity > 0.5f;
}
} // namespace vr
......
......@@ -47,9 +47,11 @@ class VRImgui {
/// you can skip recording widgets if this returns false
bool visible() const;
/// returns true if the ImGui is accepting input (due to fading state)
/// returns true if the ImGui is accepting input (due to fading state, or being blocked)
bool enabled() const;
void setBlocked(bool val) { mBlocked = val; };
protected:
SharedGraphicsPipeline mPipeline;
SharedDescriptorSet mDescriptor;
......@@ -57,6 +59,7 @@ class VRImgui {
float mCurrentOpacity = 1.0f, mTargetOpacity = 1.0f;
glm::mat4 mPose;
glm::vec3 mVMouse;
bool mBlocked = false;
imgui::UniqueImGui mImgui;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment