Compare commits
6 Commits
c0a51732d0
...
54c43c7600
| Author | SHA1 | Date |
|---|---|---|
|
|
54c43c7600 | |
|
|
eccddc2871 | |
|
|
785f814e15 | |
|
|
2156fdce4f | |
|
|
120ba7dcd7 | |
|
|
fa10201d69 |
|
|
@ -2,8 +2,8 @@
|
||||||
#include <Nazara/Core/Application.hpp>
|
#include <Nazara/Core/Application.hpp>
|
||||||
#include <Nazara/Core/Clock.hpp>
|
#include <Nazara/Core/Clock.hpp>
|
||||||
#include <Nazara/Graphics/Graphics.hpp>
|
#include <Nazara/Graphics/Graphics.hpp>
|
||||||
#include <Nazara/Platform/AppWindowingComponent.hpp>
|
|
||||||
#include <Nazara/Platform/Platform.hpp>
|
#include <Nazara/Platform/Platform.hpp>
|
||||||
|
#include <Nazara/Platform/WindowingAppComponent.hpp>
|
||||||
#include <Nazara/Renderer/GpuSwitch.hpp>
|
#include <Nazara/Renderer/GpuSwitch.hpp>
|
||||||
#include <Nazara/Renderer/WindowSwapchain.hpp>
|
#include <Nazara/Renderer/WindowSwapchain.hpp>
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ int WinMain(int argc, char* argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Nz::Application<Nz::Graphics, Nz::Imgui> nazara(argc, argv);
|
Nz::Application<Nz::Graphics, Nz::Imgui> nazara(argc, argv);
|
||||||
auto& windowing = nazara.AddComponent<Nz::AppWindowingComponent>();
|
auto& windowing = nazara.AddComponent<Nz::WindowingAppComponent>();
|
||||||
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
|
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
|
||||||
|
|
||||||
std::string windowTitle = "Nazara Imgui Demo";
|
std::string windowTitle = "Nazara Imgui Demo";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
#include <Nazara/Graphics.hpp>
|
#include <Nazara/Graphics.hpp>
|
||||||
#include <Nazara/Platform.hpp>
|
#include <Nazara/Platform.hpp>
|
||||||
#include <Nazara/Renderer.hpp>
|
#include <Nazara/Renderer.hpp>
|
||||||
#include <Nazara/Utility.hpp>
|
|
||||||
|
|
||||||
#include <NazaraImgui/ImguiHandler.hpp>
|
#include <NazaraImgui/ImguiHandler.hpp>
|
||||||
#include <NazaraImgui/ImguiWidgets.hpp>
|
#include <NazaraImgui/ImguiWidgets.hpp>
|
||||||
|
|
@ -41,10 +40,10 @@ int WinMain(int argc, char* argv[])
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Nz::Application<Nz::Graphics, Nz::Imgui> nazara(argc, argv);
|
Nz::Application<Nz::Graphics, Nz::Imgui> nazara(argc, argv);
|
||||||
auto& windowing = nazara.AddComponent<Nz::AppWindowingComponent>();
|
auto& windowing = nazara.AddComponent<Nz::WindowingAppComponent>();
|
||||||
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
|
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
|
||||||
|
|
||||||
auto& ecs = nazara.AddComponent<Nz::AppEntitySystemComponent>();
|
auto& ecs = nazara.AddComponent<Nz::EntitySystemAppComponent>();
|
||||||
auto& world = ecs.AddWorld<Nz::EnttWorld>();
|
auto& world = ecs.AddWorld<Nz::EnttWorld>();
|
||||||
|
|
||||||
auto& renderer = world.AddSystem<Nz::RenderSystem>();
|
auto& renderer = world.AddSystem<Nz::RenderSystem>();
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
#include <NazaraImgui/NazaraImgui.hpp>
|
#include <NazaraImgui/NazaraImgui.hpp>
|
||||||
|
|
||||||
|
#include <Nazara/Core/VertexStruct.hpp>
|
||||||
#include <Nazara/Renderer/CommandBufferBuilder.hpp>
|
#include <Nazara/Renderer/CommandBufferBuilder.hpp>
|
||||||
#include <Nazara/Renderer/RenderDevice.hpp>
|
#include <Nazara/Renderer/RenderDevice.hpp>
|
||||||
#include <Nazara/Renderer/RenderFrame.hpp>
|
#include <Nazara/Renderer/RenderFrame.hpp>
|
||||||
#include <Nazara/Renderer/UploadPool.hpp>
|
#include <Nazara/Renderer/UploadPool.hpp>
|
||||||
#include <Nazara/Utility/VertexStruct.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
#include <NZSL/Parser.hpp>
|
#include <NZSL/Parser.hpp>
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ namespace Nz
|
||||||
|
|
||||||
FramePass& ImguiPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
FramePass& ImguiPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
||||||
{
|
{
|
||||||
if (inputOuputs.inputCount != 1)
|
if (inputOuputs.inputAttachments.size() != 1)
|
||||||
throw std::runtime_error("one input expected");
|
throw std::runtime_error("one input expected");
|
||||||
|
|
||||||
if (inputOuputs.outputCount != 1)
|
if (inputOuputs.outputAttachments.size() != 1)
|
||||||
throw std::runtime_error("one output expected");
|
throw std::runtime_error("one output expected");
|
||||||
|
|
||||||
FramePass& imguiPass = frameGraph.AddPass("Imgui pass");
|
FramePass& imguiPass = frameGraph.AddPass("Imgui pass");
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,13 @@ namespace Nz
|
||||||
int fb_height = static_cast<int>(io.DisplaySize.y * io.DisplayFramebufferScale.y);
|
int fb_height = static_cast<int>(io.DisplaySize.y * io.DisplayFramebufferScale.y);
|
||||||
Nz::Recti renderRect(0, 0, fb_width, fb_height);
|
Nz::Recti renderRect(0, 0, fb_width, fb_height);
|
||||||
|
|
||||||
|
Nz::CommandBufferBuilder::ClearValues clearValues[2] = {
|
||||||
|
{ .color = Nz::Color::Black() },
|
||||||
|
{ .depth = 1.f }
|
||||||
|
};
|
||||||
|
|
||||||
builder.BeginDebugRegion("ImGui", Nz::Color::Green());
|
builder.BeginDebugRegion("ImGui", Nz::Color::Green());
|
||||||
builder.BeginRenderPass(renderTarget->GetFramebuffer(frame.GetImageIndex()), renderTarget->GetRenderPass(), renderRect);
|
builder.BeginRenderPass(renderTarget->GetFramebuffer(frame.GetImageIndex()), renderTarget->GetRenderPass(), renderRect, clearValues, 2);
|
||||||
m_imguiDrawer.Draw(builder);
|
m_imguiDrawer.Draw(builder);
|
||||||
builder.EndRenderPass();
|
builder.EndRenderPass();
|
||||||
builder.EndDebugRegion();
|
builder.EndDebugRegion();
|
||||||
|
|
@ -355,8 +360,8 @@ namespace Nz
|
||||||
texParams.height = height;
|
texParams.height = height;
|
||||||
texParams.pixelFormat = Nz::PixelFormat::RGBA8;
|
texParams.pixelFormat = Nz::PixelFormat::RGBA8;
|
||||||
texParams.type = Nz::ImageType::E2D;
|
texParams.type = Nz::ImageType::E2D;
|
||||||
m_fontTexture = renderDevice->InstantiateTexture(texParams);
|
m_fontTexture = renderDevice->InstantiateTexture(texParams, pixels, true);
|
||||||
m_fontTexture->Update(pixels, width, height);
|
m_fontTexture->UpdateDebugName("FontTexture");
|
||||||
|
|
||||||
ImTextureID textureID = m_fontTexture.get();
|
ImTextureID textureID = m_fontTexture.get();
|
||||||
io.Fonts->TexID = textureID;
|
io.Fonts->TexID = textureID;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ add_requires("nazaraengine", { alias = "nazara", debug = is_mode("debug") })
|
||||||
add_requires("imgui v1.87-docking", { alias = "imgui" })
|
add_requires("imgui v1.87-docking", { alias = "imgui" })
|
||||||
|
|
||||||
add_includedirs("include", "src")
|
add_includedirs("include", "src")
|
||||||
|
set_exceptions("cxx")
|
||||||
set_languages("c89", "c++20")
|
set_languages("c89", "c++20")
|
||||||
set_rundir("./bin/$(plat)_$(arch)_$(mode)")
|
set_rundir("./bin/$(plat)_$(arch)_$(mode)")
|
||||||
set_targetdir("./bin/$(plat)_$(arch)_$(mode)")
|
set_targetdir("./bin/$(plat)_$(arch)_$(mode)")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue