split NazaraImgui.hpp into multiples files to speed up compilation
This commit is contained in:
parent
41c6439b90
commit
1accd86a9c
|
|
@ -7,6 +7,8 @@
|
|||
#include <Nazara/Renderer/GpuSwitch.hpp>
|
||||
#include <Nazara/Renderer/WindowSwapchain.hpp>
|
||||
|
||||
#include <NazaraImgui/ImguiHandler.hpp>
|
||||
#include <NazaraImgui/ImguiWidgets.hpp>
|
||||
#include <NazaraImgui/NazaraImgui.hpp>
|
||||
|
||||
NAZARA_REQUEST_DEDICATED_GPU()
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
#include <Nazara/Renderer.hpp>
|
||||
#include <Nazara/Utility.hpp>
|
||||
|
||||
#include <NazaraImgui/ImguiHandler.hpp>
|
||||
#include <NazaraImgui/ImguiWidgets.hpp>
|
||||
#include <NazaraImgui/NazaraImgui.hpp>
|
||||
|
||||
NAZARA_REQUEST_DEDICATED_GPU()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
ImguiHandler.hpp
|
||||
Inherit from this base class for your Imgui code to be called by the Imgui renderer
|
||||
*/
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
struct ImguiHandler
|
||||
{
|
||||
public:
|
||||
virtual void OnRenderImgui() = 0;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <NazaraImgui/Config.hpp>
|
||||
|
||||
#include <Nazara/Math/Rect.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class Texture;
|
||||
}
|
||||
|
||||
namespace ImGui
|
||||
{
|
||||
// custom ImGui widgets for Nazara
|
||||
|
||||
// Image overloads
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Vector2f& size, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Rectf& textureRect, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Vector2f& size, const Nz::Rectf& textureRect, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
|
||||
// ImageButton overloads
|
||||
NAZARA_IMGUI_API bool ImageButton(const Nz::Texture* texture, const int framePadding = -1, const Nz::Color& bgColor = Nz::Color(0, 0, 0, 0), const Nz::Color& tintColor = Nz::Color::White());
|
||||
NAZARA_IMGUI_API bool ImageButton(const Nz::Texture* texture, const Nz::Vector2f& size, const int framePadding = -1, const Nz::Color& bgColor = Nz::Color(0, 0, 0, 0), const Nz::Color& tintColor = Nz::Color::White());
|
||||
|
||||
// Draw_list overloads. All positions are in relative coordinates (relative to top-left of the current window)
|
||||
NAZARA_IMGUI_API void DrawLine(const Nz::Vector2f& a, const Nz::Vector2f& b, const Nz::Color& col, float thickness = 1.0f);
|
||||
NAZARA_IMGUI_API void DrawRect(const Nz::Rectf& rect, const Nz::Color& color, float rounding = 0.0f, int rounding_corners = 0x0F, float thickness = 1.0f);
|
||||
NAZARA_IMGUI_API void DrawRectFilled(const Nz::Rectf& rect, const Nz::Color& color, float rounding = 0.0f, int rounding_corners = 0x0F);
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <Nazara/Core/ModuleBase.hpp>
|
||||
#include <Nazara/Graphics/Graphics.hpp>
|
||||
#include <Nazara/Math/Rect.hpp>
|
||||
#include <NazaraImgui/Config.hpp>
|
||||
#include <NazaraImgui/ImguiDrawer.hpp>
|
||||
|
||||
|
|
@ -19,11 +18,7 @@ namespace Nz
|
|||
class Window;
|
||||
class WindowEventHandler;
|
||||
|
||||
struct ImguiHandler
|
||||
{
|
||||
public:
|
||||
virtual void OnRenderImgui() = 0;
|
||||
};
|
||||
struct ImguiHandler;
|
||||
|
||||
class NAZARA_IMGUI_API Imgui : public Nz::ModuleBase<Imgui>
|
||||
{
|
||||
|
|
@ -91,23 +86,6 @@ namespace Nz
|
|||
|
||||
namespace ImGui
|
||||
{
|
||||
// custom ImGui widgets for Nazara
|
||||
|
||||
// Image overloads
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Vector2f& size, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Rectf& textureRect, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
NAZARA_IMGUI_API void Image(const Nz::Texture* texture, const Nz::Vector2f& size, const Nz::Rectf& textureRect, const Nz::Color& tintColor = Nz::Color::White(), const Nz::Color& borderColor = Nz::Color(0, 0, 0, 0));
|
||||
|
||||
// ImageButton overloads
|
||||
NAZARA_IMGUI_API bool ImageButton(const Nz::Texture* texture, const int framePadding = -1, const Nz::Color& bgColor = Nz::Color(0,0,0,0), const Nz::Color& tintColor = Nz::Color::White());
|
||||
NAZARA_IMGUI_API bool ImageButton(const Nz::Texture* texture, const Nz::Vector2f& size, const int framePadding = -1, const Nz::Color& bgColor = Nz::Color(0,0,0,0), const Nz::Color& tintColor = Nz::Color::White());
|
||||
|
||||
// Draw_list overloads. All positions are in relative coordinates (relative to top-left of the current window)
|
||||
NAZARA_IMGUI_API void DrawLine(const Nz::Vector2f& a, const Nz::Vector2f& b, const Nz::Color& col, float thickness = 1.0f);
|
||||
NAZARA_IMGUI_API void DrawRect(const Nz::Rectf& rect, const Nz::Color& color, float rounding = 0.0f, int rounding_corners = 0x0F, float thickness = 1.0f);
|
||||
NAZARA_IMGUI_API void DrawRectFilled(const Nz::Rectf& rect, const Nz::Color& color, float rounding = 0.0f, int rounding_corners = 0x0F);
|
||||
|
||||
inline void EnsureContextOnThisThread()
|
||||
{
|
||||
auto* context = Nz::Imgui::GetCurrentContext();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#include <NazaraImgui/NazaraImgui.hpp>
|
||||
#include <NazaraImgui/ImguiPipelinePass.hpp>
|
||||
#include <NazaraImgui/ImguiDrawer.hpp>
|
||||
#include <NazaraImgui/ImguiHandler.hpp>
|
||||
#include <NazaraImgui/ImguiWidgets.hpp>
|
||||
|
||||
#include <Nazara/Core/DynLib.hpp>
|
||||
#include <Nazara/Core/Log.hpp>
|
||||
|
|
|
|||
Loading…
Reference in New Issue