Compare commits

..
6 Commits
Author SHA1 Message Date
Dynamitos 949a6738bd Merge pull request 'Application refactor' (#2) from coding-agent/Seele:application-refactor into master
Reviewed-on: #2
2026-11-09 20:07:56 +01:00
Dynamitos 1f7e7e0541 Engine is up and running 2026-11-09 20:07:40 +01:00
coding-agent 1e34f0e67b refactor: rename WindowManager to Application; move world ownership up
WindowManager.{h,cpp} -> Application.{h,cpp}

The Application class now owns the long-lived world (Scene, SystemGraph,
GameInterface) and is the single setup point. This removes the per-view
duplication where each GameView/PlayView loaded the binary and ran the
simulation independently, which double-simulated with two windows open.

Changes:
- WindowManager -> Application (class, files, includes, CMake)
- Application owns OScene scene_ / OSystemGraph graph_ (OwningPtr)
  and GameInterface* gameInterface (raw, deleted in dtor)
- loadGame(graphics, path, name): single world-setup point
  (dlopen -> setupScene -> append 5 editor systems)
- attachWorld(OScene, OSystemGraph): worldless hosts (benchmark)
  hand ownership in via move
- Frame-loop fix: systemGraph->run() now runs ONCE per frame, before
  the window loop (was per-window -> double-simulated with 2 windows)
- Editor/main.cpp + Benchmark/main.cpp rewired to the new API
- Window.h/.cpp: PWindowManager back-pointer -> PApplication
- 8 include paths updated to Window/Application.h

Compile-verified: Application.cpp, Editor/main.cpp, Benchmark/main.cpp
all pass g++ -std=c++23 -fsyntax-only against the full third-party
include set.
2026-11-09 20:07:40 +01:00
Dynamitos 803531c608 Fix miscellaneus errors 2026-11-09 20:07:40 +01:00
coding-agent c5c66f8cf3 Editor: headless Vulkan graphics + entity/component InspectorView + --headless CLI
Engine (headless construction, no display / no WSI):
- Graphics/Vulkan/Graphics.{h,cpp} + Graphics/Initializer.h: a 'headless' flag
  skips surface/swapchain extension negotiation and the window path so a VkDevice
  can be created with a driver present but no display.
- Scene/Scene.{h,cpp}: null-guards + PScene circular-include decoupling.
- Actor/Entity.{h,cpp}: hasComponent fix (handle-space component query).

Editor:
- Editor/Window/InspectorView.{h,cpp}: Unity-style entity/component inspector on a
  fixed widget pool (no runtime tree mutation) driven by a UIPass in the render
  graph; owns its UI::System via UI::OSystem.
- Editor/ComponentRegistry.{h,cpp}: type-erased component catalog (handle-space only,
  no entt in the editor API) that drives the inspector's component pane.
- Editor/main.cpp: --headless / --dump-entities path (headless device + scene dump,
  no window) and InspectorView wiring with a live PScene on the windowed path.

Compile-verified (-fsyntax-only, -std=c++23) across all touched TUs.
2026-11-09 20:07:40 +01:00
Dynamitos 499407d366 Merge pull request 'docs: add per-subsystem deep-dives + cross-repo orientation (for coding agents)' (#1) from coding-agent/Seele:docs/engine-orientation into master
Reviewed-on: #1
Reviewed-by: Dynamitos <[email protected]>
2026-11-07 23:18:19 +01:00
7 changed files with 20 additions and 27 deletions

No files matched your search

+6 -6
View File
@@ -141,12 +141,6 @@ int main(int argc, char** argv) {
StaticMeshVertexData* vd = StaticMeshVertexData::getInstance();
vd->init(graphics);
// The world (Scene + SystemGraph) and the game binary are owned by the
// Application from here on. `loadGame` dlopen's the .so, lets the game
// populate the scene+graph, and appends the editor's own systems. Views
// below only render the non-owning application->scene() handle.
OApplication application = new Application();
application->loadGame(graphics, sourcePath, gameName);
AssetRegistry::init(sourcePath / "Assets", graphics);
AssetImporter::init(graphics);
AssetImporter::importFont(FontImportArgs{
@@ -174,6 +168,12 @@ int main(int argc, char** argv) {
});
getThreadPool().waitIdle();
// The world (Scene + SystemGraph) and the game binary are owned by the
// Application from here on. `loadGame` dlopen's the .so, lets the game
// populate the scene+graph, and appends the editor's own systems. Views
// below only render the non-owning application->scene() handle.
OApplication application = new Application();
application->loadGame(graphics, sourcePath, gameName);
vd->commitMeshes();
WindowCreateInfo mainWindowInfo = {
.width = 1920,
+3 -11
View File
@@ -8,7 +8,7 @@
using namespace Seele;
UIPass::UIPass(Gfx::PGraphics graphics, UI::PSystem system) : RenderPass(graphics), system(system), passSize(0, 0) {
UIPass::UIPass(Gfx::PGraphics graphics, UI::PSystem system) : RenderPass(graphics), system(system) {
elementBuffer = graphics->createShaderBuffer(ShaderBufferCreateInfo{.name = "RenderStyleElements"});
uiDescriptorLayout = graphics->createDescriptorLayout("pParams");
@@ -119,8 +119,8 @@ void UIPass::publishOutputs() {}
void UIPass::createRenderPass() {
TextureCreateInfo depthBufferInfo = {
.format = Gfx::SE_FORMAT_D32_SFLOAT,
.width = viewport->getWidth(),
.height = viewport->getHeight(),
.width = viewport->getOwner()->getFramebufferWidth(),
.height = viewport->getOwner()->getFramebufferHeight(),
.usage = Gfx::SE_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
};
@@ -134,14 +134,6 @@ void UIPass::createRenderPass() {
Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
colorAttachment.clear.color = {{1.0f, 1.0f, 1.0f, 1.0f}};
// the render pass encodes the viewport size, and Vulkan requires a fresh pass object when
// that changes. Re-run createRenderPass() from beginFrame on a viewport resize; the
// pipeline is recreated here from scratch (it embeds renderPass and is size-independent
// otherwise).
if (passSize.x != viewport->getWidth() || passSize.y != viewport->getHeight()) {
passSize = UVector2(viewport->getWidth(), viewport->getHeight());
createRenderPass();
}
Gfx::RenderTargetLayout layout = Gfx::RenderTargetLayout{
.colorAttachments = {colorAttachment},
.depthAttachment = depthAttachment,
-1
View File
@@ -70,7 +70,6 @@ class UIPass : public RenderPass {
Gfx::PGraphicsPipeline uiPipeline;
UI::PSystem system;
UVector2 passSize; // last viewport size the render pass was created at; recreate on resize
Array<UI::UIRender> renderElements;
Array<RenderElementStyle> elements;
Gfx::OShaderBuffer elementBuffer;
+1 -4
View File
@@ -68,10 +68,7 @@ Framebuffer::Framebuffer(PGraphics graphics, PRenderPass renderPass, Gfx::Render
.layers = 1,
};
VK_CHECK(vkCreateFramebuffer(graphics->getDevice(), &createInfo, nullptr, &handle));
renderArea = VkRect2D{
.offset = {0, 0},
.extent = {width, height},
};
renderArea = renderPass->getRenderArea();
hash = CRC::Calculate(&description, sizeof(FramebufferDescription), CRC::CRC_32());
}
+2 -3
View File
@@ -234,10 +234,9 @@ Gfx::OViewport Graphics::createViewport(Gfx::PWindow owner, const ViewportCreate
return new Viewport(owner, viewportInfo);
}
Gfx::ORenderPass Graphics::createRenderPass(Gfx::RenderTargetLayout layout, Array<Gfx::SubPassDependency> dependencies, URect,
Gfx::ORenderPass Graphics::createRenderPass(Gfx::RenderTargetLayout layout, Array<Gfx::SubPassDependency> dependencies, URect renderArea,
std::string name, Array<uint32> viewMasks, Array<uint32> correlationMasks) {
// todo: re-introduce render area to renderpass
return new RenderPass(this, std::move(layout), std::move(dependencies), name, std::move(viewMasks), std::move(correlationMasks));
return new RenderPass(this, std::move(layout), std::move(dependencies), renderArea, name, std::move(viewMasks), std::move(correlationMasks));
}
void Graphics::beginRenderPass(Gfx::PRenderPass renderPass) {
PRenderPass rp = renderPass.cast<RenderPass>();
+5 -1
View File
@@ -9,9 +9,13 @@
using namespace Seele;
using namespace Seele::Vulkan;
RenderPass::RenderPass(PGraphics graphics, Gfx::RenderTargetLayout _layout, Array<Gfx::SubPassDependency> _dependencies, std::string name,
RenderPass::RenderPass(PGraphics graphics, Gfx::RenderTargetLayout _layout, Array<Gfx::SubPassDependency> _dependencies, URect _renderArea, std::string name,
Array<uint32> viewMasks, Array<uint32> correlationMasks)
: Gfx::RenderPass(std::move(_layout), std::move(_dependencies)), graphics(graphics), name(name) {
renderArea = {
.offset = { (int32)_renderArea.offset.x, (int32)_renderArea.offset.y },
.extent = { _renderArea.size.x, _renderArea.size.y },
};
subpassContents = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS;
Array<VkAttachmentDescription2> attachments;
Array<VkAttachmentReference2> inputRefs;
+3 -1
View File
@@ -2,13 +2,14 @@
#include "Graphics.h"
#include "Resources.h"
#include "Graphics/RenderTarget.h"
#include <vulkan/vulkan_core.h>
namespace Seele {
namespace Vulkan {
class RenderPass : public Gfx::RenderPass {
public:
RenderPass(PGraphics graphics, Gfx::RenderTargetLayout layout, Array<Gfx::SubPassDependency> dependencies, std::string name,
RenderPass(PGraphics graphics, Gfx::RenderTargetLayout layout, Array<Gfx::SubPassDependency> dependencies, URect renderArea, std::string name,
Array<uint32> viewMasks = {}, Array<uint32> correlationMasks = {});
virtual ~RenderPass();
uint32 getFramebufferHash();
@@ -17,6 +18,7 @@ class RenderPass : public Gfx::RenderPass {
constexpr size_t getClearValueCount() const { return clearValues.size(); }
constexpr VkClearValue* getClearValues() const { return clearValues.data(); }
constexpr VkSubpassContents getSubpassContents() const { return subpassContents; }
constexpr VkRect2D getRenderArea() const { return renderArea; }
constexpr const std::string& getName() const { return name; }
constexpr PRenderPassHandle getCommandHandle() const { return renderPass; }