Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Build directories
build*/
5 changes: 5 additions & 0 deletions src/rocky/vsg/ecs/WidgetSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#include <rocky/Rendering.h>
#include <rocky/ecs/Widget.h>
#include <rocky/ecs/Visibility.h>

#ifdef ROCKY_HAS_IMGUI
#include <imgui.h>
#endif

using namespace ROCKY_NAMESPACE;

Expand Down Expand Up @@ -59,6 +62,7 @@ WidgetSystemNode::WidgetSystemNode(Registry& in_registry) :
void
WidgetSystemNode::initialize(VSGContext& context)
{
#ifdef ROCKY_HAS_IMGUI
// register me as a gui rendering callback.
auto recorder = [this](detail::RenderingState& rs, void* imguiContext)
{
Expand Down Expand Up @@ -114,6 +118,7 @@ WidgetSystemNode::initialize(VSGContext& context)
};

context->guiRecorders.emplace_back(recorder);
#endif // ROCKY_HAS_IMGUI
}

void
Expand Down
4 changes: 4 additions & 0 deletions src/rocky/vsg/imgui/ImGuiIntegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <rocky/Callbacks.h>
#include <rocky/vsg/imgui/SendEventsToImGui.h>
#include <rocky/vsg/imgui/RenderImGui.h>

#ifdef ROCKY_HAS_IMGUI
#include <imgui.h>

/**
Expand Down Expand Up @@ -162,3 +164,5 @@ namespace ROCKY_NAMESPACE
};
}
}

#endif // ROCKY_HAS_IMGUI
3 changes: 3 additions & 0 deletions src/rocky/vsg/imgui/RenderImGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</editor-fold> */
#include <rocky/vsg/Common.h>

#ifdef ROCKY_HAS_IMGUI
#include <imgui.h>
#include <functional>

Expand Down Expand Up @@ -98,3 +99,5 @@ namespace ROCKY_NAMESPACE
// temporary workaround for Dear ImGui's nonexistent sRGB awareness
//extern void ImGuiStyle_sRGB_to_linear(ImGuiStyle& style);
}

#endif // ROCKY_HAS_IMGUI
6 changes: 5 additions & 1 deletion src/rocky/vsg/imgui/SendEventsToImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</editor-fold> */

#include "SendEventsToImGui.h"

#ifdef ROCKY_HAS_IMGUI
#include <imgui.h>

#include <vsg/ui/KeyEvent.h>
Expand Down Expand Up @@ -309,4 +311,6 @@ void SendEventsToImGui::apply(vsg::FrameEvent& /*frame*/)
io.DeltaTime = std::chrono::duration_cast<std::chrono::duration<float>>(t1 - t0).count();

t0 = t1;
}
}

#endif // ROCKY_HAS_IMGUI
4 changes: 4 additions & 0 deletions src/rocky/vsg/imgui/SendEventsToImGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <chrono>
#include <vsg/core/Visitor.h>
#include <vsg/ui/KeyEvent.h>

#ifdef ROCKY_HAS_IMGUI
#include <imgui.h>

namespace ROCKY_NAMESPACE
Expand Down Expand Up @@ -59,3 +61,5 @@ namespace ROCKY_NAMESPACE
};
}

#endif // ROCKY_HAS_IMGUI