Fix miscellaneus errors

This commit is contained in:
Dynamitos committed 2026-11-09 20:07:40 +01:00
1 parent c5c66f8cf3
commit 803531c608
17 files changed
+146 -88

No files matched your search

+85 -32
View File
@@ -1,5 +1,27 @@
import lldb import lldb
def _member(valobj, name):
# GetChildMemberWithName does not search base classes reliably across
# LLDB versions; walk base classes explicitly, mirroring the working
# gdb _base_cast/_member in Seele.py.
child = valobj.GetChildMemberWithName(name)
if child.IsValid():
return child
t = valobj.GetType()
seen = set()
while t.IsValid() and t not in seen:
seen.add(t)
for i in range(t.GetNumBases()):
base = t.GetBaseClass(i)
if base.IsValid():
sub = valobj.GetBaseClassWithName(base.GetName())
if sub.IsValid():
child = sub.GetChildMemberWithName(name)
if child.IsValid():
return child
t = t.GetBaseClass(0) if t.GetNumBases() > 0 else None
return None
def Array_SummaryProvider(valobj, internal_dict): def Array_SummaryProvider(valobj, internal_dict):
size = valobj.GetChildMemberWithName('arraySize').GetValueAsUnsigned(0) size = valobj.GetChildMemberWithName('arraySize').GetValueAsUnsigned(0)
return f"Array(size={size})" return f"Array(size={size})"
@@ -65,8 +87,8 @@ class ListSyntheticProvider:
return True return True
def Tree_SummaryProvider(valobj, internal_dict): def Tree_SummaryProvider(valobj, internal_dict):
size = valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(valobj, '_size')
return f"Tree(size={size})" return f"Tree(size={size.GetValueAsUnsigned(0) if size and size.IsValid() else '?'})"
class TreeSyntheticProvider: class TreeSyntheticProvider:
def __init__(self, valobj, internal_dict): def __init__(self, valobj, internal_dict):
@@ -87,28 +109,35 @@ class TreeSyntheticProvider:
return None return None
# Collect all nodes via in-order traversal, then return the one at `index` # Collect all nodes via in-order traversal, then return the one at `index`
nodes = [] nodes = []
self._collect(self.root, nodes) if self.root and self.root.IsValid():
self._collect(self.root, nodes)
if index >= len(nodes): if index >= len(nodes):
return None return None
return nodes[index].GetChildMemberWithName('data') data = nodes[index].GetChildMemberWithName('data')
return data if data.IsValid() else None
def _collect(self, node, out): def _collect(self, node, out):
if not node.IsValid(): if not node.IsValid():
return return
self._collect(node.GetChildMemberWithName('leftChild'), out) left = node.GetChildMemberWithName('leftChild')
if left.IsValid():
self._collect(left.Dereference(), out)
out.append(node) out.append(node)
self._collect(node.GetChildMemberWithName('rightChild'), out) right = node.GetChildMemberWithName('rightChild')
if right.IsValid():
self._collect(right.Dereference(), out)
def update(self): def update(self):
self.root = self.valobj.GetChildMemberWithName('root') self.root = _member(self.valobj, 'root')
self.size = self.valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(self.valobj, '_size')
self.size = size.GetValueAsUnsigned(0) if size and size.IsValid() else 0
def has_children(self): def has_children(self):
return True return self.size > 0
def Set_SummaryProvider(valobj, internal_dict): def Set_SummaryProvider(valobj, internal_dict):
size = valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(valobj, '_size')
return f"Set(size={size})" return f"Set(size={size.GetValueAsUnsigned(0) if size and size.IsValid() else '?'})"
class SetSyntheticProvider: class SetSyntheticProvider:
def __init__(self, valobj, internal_dict): def __init__(self, valobj, internal_dict):
@@ -128,28 +157,39 @@ class SetSyntheticProvider:
if index < 0 or index >= self.size: if index < 0 or index >= self.size:
return None return None
nodes = [] nodes = []
self._collect(self.root, nodes) # Start from pseudoRoot: the splay tree's actual structure is
# connected via pseudoRoot.leftChild, not the `root` pointer.
if self.pseudoRoot and self.pseudoRoot.IsValid():
left = self.pseudoRoot.GetChildMemberWithName('leftChild')
if left.IsValid():
self._collect(left.Dereference(), nodes)
if index >= len(nodes): if index >= len(nodes):
return None return None
return nodes[index].GetChildMemberWithName('data') data = nodes[index].GetChildMemberWithName('data')
return data if data.IsValid() else None
def _collect(self, node, out): def _collect(self, node, out):
if not node.IsValid(): if not node.IsValid():
return return
self._collect(node.GetChildMemberWithName('leftChild'), out) left = node.GetChildMemberWithName('leftChild')
if left.IsValid():
self._collect(left.Dereference(), out)
out.append(node) out.append(node)
self._collect(node.GetChildMemberWithName('rightChild'), out) right = node.GetChildMemberWithName('rightChild')
if right.IsValid():
self._collect(right.Dereference(), out)
def update(self): def update(self):
self.root = self.valobj.GetChildMemberWithName('root') self.pseudoRoot = _member(self.valobj, 'pseudoRoot')
self.size = self.valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(self.valobj, '_size')
self.size = size.GetValueAsUnsigned(0) if size and size.IsValid() else 0
def has_children(self): def has_children(self):
return True return self.size > 0
def Map_SummaryProvider(valobj, internal_dict): def Map_SummaryProvider(valobj, internal_dict):
size = valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(valobj, '_size')
return f"Map(size={size})" return f"Map(size={size.GetValueAsUnsigned(0) if size and size.IsValid() else '?'})"
class MapSyntheticProvider: class MapSyntheticProvider:
def __init__(self, valobj, internal_dict): def __init__(self, valobj, internal_dict):
@@ -169,24 +209,37 @@ class MapSyntheticProvider:
if index < 0 or index >= self.size: if index < 0 or index >= self.size:
return None return None
nodes = [] nodes = []
self._collect(self.root, nodes) # Start from pseudoRoot: the splay tree's actual structure is
# connected via pseudoRoot.leftChild, not the `root` pointer.
if self.pseudoRoot and self.pseudoRoot.IsValid():
left = self.pseudoRoot.GetChildMemberWithName('leftChild')
if left.IsValid():
self._collect(left.Dereference(), nodes)
if index >= len(nodes): if index >= len(nodes):
return None return None
return nodes[index].GetChildMemberWithName('data') # Map stores Pair<K, V> in node.data; return the pair so the
# debugger can show key/value members (Pair is a plain struct).
data = nodes[index].GetChildMemberWithName('data')
return data if data.IsValid() else None
def _collect(self, node, out): def _collect(self, node, out):
if not node.IsValid(): if not node.IsValid():
return return
self._collect(node.GetChildMemberWithName('leftChild'), out) left = node.GetChildMemberWithName('leftChild')
if left.IsValid():
self._collect(left.Dereference(), out)
out.append(node) out.append(node)
self._collect(node.GetChildMemberWithName('rightChild'), out) right = node.GetChildMemberWithName('rightChild')
if right.IsValid():
self._collect(right.Dereference(), out)
def update(self): def update(self):
self.root = self.valobj.GetChildMemberWithName('root') self.pseudoRoot = _member(self.valobj, 'pseudoRoot')
self.size = self.valobj.GetChildMemberWithName('_size').GetValueAsUnsigned(0) size = _member(self.valobj, '_size')
self.size = size.GetValueAsUnsigned(0) if size and size.IsValid() else 0
def has_children(self): def has_children(self):
return True return self.size > 0
def Vector_SummaryProvider(valobj, internal_dict): def Vector_SummaryProvider(valobj, internal_dict):
# Get the template parameters to determine vector length # Get the template parameters to determine vector length
+3 -1
View File
@@ -359,7 +359,9 @@ struct CookTorrance : IBRDF
const float MAX_REFLECTION_LOD = 4; const float MAX_REFLECTION_LOD = 4;
float3 prefilteredColor = pLightEnv.prefilteredMap.SampleLevel(pLightEnv.irradianceSampler, r, roughness * MAX_REFLECTION_LOD).xyz; float3 prefilteredColor = pLightEnv.prefilteredMap.SampleLevel(pLightEnv.irradianceSampler, r, roughness * MAX_REFLECTION_LOD).xyz;
float2 envBRDF = pLightEnv.brdfLUT.Sample(pLightEnv.lutSampler, float2(max(dot(normal, viewDir_WS), 0), roughness)).rg; // brdfLUT has no mip levels and is indexed analytically (N·V, roughness) with no screen
// derivatives, so implicit LOD is unavailable (GLCompute/Ray) and meaningless: use level 0.
float2 envBRDF = pLightEnv.brdfLUT.SampleLevel(pLightEnv.lutSampler, float2(max(dot(normal, viewDir_WS), 0), roughness), 0).rg;
float3 specular = prefilteredColor * (F * envBRDF.x + envBRDF.y); float3 specular = prefilteredColor * (F * envBRDF.x + envBRDF.y);
return (k_d * diffuse + specular) * ambientOcclusion; return (k_d * diffuse + specular) * ambientOcclusion;
+1 -1
View File
@@ -68,7 +68,7 @@ struct DrawCallOffsets
}; };
#ifdef RAY_TRACING #ifdef RAY_TRACING
// Shader record buffers are accessed via a different mechanism and don't use descriptor set bindings // Shader record buffers are accessed via a different mechanism and don't use descriptor set bindings
layout(set = 15, shaderRecordEXT) layout(shaderRecordEXT)
#else #else
layout(push_constant) layout(push_constant)
#endif #endif
+2 -1
View File
@@ -7,6 +7,7 @@ void miss(inout RayPayload p)
// p.shading.normal = -WorldRayDirection(); // p.shading.normal = -WorldRayDirection();
// p.shading.normalLight = -WorldRayDirection(); // p.shading.normalLight = -WorldRayDirection();
// p.material.color = float4(0, 0, 0, 0); // p.material.color = float4(0, 0, 0, 0);
p.light = float3(pRayTracingParams.skyBox.Sample(pRayTracingParams.skyBoxSampler, WorldRayDirection()).xyz); // miss shaders (GLCompute) can't do ImplicitLod (mip) sampling; use a fixed level
p.light = float3(pRayTracingParams.skyBox.SampleLevel(pRayTracingParams.skyBoxSampler, WorldRayDirection(), 0).xyz);
p.hit = false; p.hit = false;
} }
+3 -2
View File
@@ -1,12 +1,13 @@
#include "PlayView.h" #include "PlayView.h"
#include "Scene/Scene.h"
#include "Window/Window.h" #include "Window/Window.h"
#include <fmt/format.h> #include <fmt/format.h>
#include <fstream> #include <fstream>
using namespace Seele; using namespace Seele;
PlayView::PlayView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::string dllPath, bool useMeshCulling) PlayView::PlayView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo, bool useMeshCulling)
: GameView(graphics, window, createInfo, dllPath) { : GameView(graphics, window, scene, createInfo) {
getGlobals().useDepthCulling = useMeshCulling; getGlobals().useDepthCulling = useMeshCulling;
renderTimestamp = graphics->createTimestampQuery(2, "RenderTimestamp"); renderTimestamp = graphics->createTimestampQuery(2, "RenderTimestamp");
queryThread = std::thread([&]() { queryThread = std::thread([&]() {
+1 -1
View File
@@ -4,7 +4,7 @@
namespace Seele { namespace Seele {
class PlayView : public GameView { class PlayView : public GameView {
public: public:
PlayView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::string dllPath, bool useMeshCulling); PlayView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo, bool useMeshCulling);
virtual ~PlayView(); virtual ~PlayView();
virtual void beginUpdate() override; virtual void beginUpdate() override;
virtual void update() override; virtual void update() override;
+1 -1
View File
@@ -49,7 +49,7 @@ int main(int argc, char** argv) {
.offset = {0, 0}, .offset = {0, 0},
}, },
}; };
OGameView sceneView = new PlayView(graphics, window, sceneViewInfo, binaryPath.generic_string(), useDepthCulling); OGameView sceneView = new PlayView(graphics, window, new Scene(graphics), sceneViewInfo, useDepthCulling);
sceneView->setFocused(); sceneView->setFocused();
while (windowManager->isActive()) { while (windowManager->isActive()) {
+3 -1
View File
@@ -3,4 +3,6 @@ add_subdirectory(Window/)
target_sources(Editor target_sources(Editor
PRIVATE PRIVATE
main.cpp) main.cpp
ComponentRegistry.h
ComponentRegistry.cpp)
+2 -2
View File
@@ -7,8 +7,8 @@
using namespace Seele; using namespace Seele;
using namespace Seele::Editor; using namespace Seele::Editor;
PlayView::PlayView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::filesystem::path dllPath) PlayView::PlayView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo)
: GameView(graphics, window, createInfo, dllPath) {} : GameView(graphics, window, scene, createInfo) {}
PlayView::~PlayView() {} PlayView::~PlayView() {}
+1 -1
View File
@@ -5,7 +5,7 @@ namespace Seele {
namespace Editor { namespace Editor {
class PlayView : public GameView { class PlayView : public GameView {
public: public:
PlayView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::filesystem::path dllPath); PlayView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo);
virtual ~PlayView(); virtual ~PlayView();
virtual void beginUpdate() override; virtual void beginUpdate() override;
virtual void update() override; virtual void update() override;
+26 -13
View File
@@ -10,7 +10,12 @@
#include "Material/Material.h" #include "Material/Material.h"
#include "Graphics/Vulkan/Graphics.h" #include "Graphics/Vulkan/Graphics.h"
#include "Graphics/StaticMeshVertexData.h" #include "Graphics/StaticMeshVertexData.h"
#include "System/SystemGraph.h"
#include "Window/PlayView.h" #include "Window/PlayView.h"
#include "System/CameraUpdater.h"
#include "System/FluidUpdater.h"
#include "System/LightGather.h"
#include "System/MeshUpdater.h"
#include "Window/WindowManager.h" #include "Window/WindowManager.h"
#include "Window/InspectorView.h" #include "Window/InspectorView.h"
#include "Scene/Scene.h" // OScene/Scene - the InspectorView's entity pane needs a live scene #include "Scene/Scene.h" // OScene/Scene - the InspectorView's entity pane needs a live scene
@@ -136,7 +141,18 @@ int main(int argc, char** argv) {
StaticMeshVertexData* vd = StaticMeshVertexData::getInstance(); StaticMeshVertexData* vd = StaticMeshVertexData::getInstance();
vd->init(graphics); vd->init(graphics);
OWindowManager windowManager = new WindowManager(); GameInterface gameInterface(binaryPath);
OScene scene = new Scene(graphics);
gameInterface.reload();
OSystemGraph systemGraph = new SystemGraph();
gameInterface.getGame()->setupScene(scene, systemGraph);
systemGraph->addSystem(new System::KeyboardInput(scene));
systemGraph->addSystem(new System::FluidUpdater(scene));
systemGraph->addSystem(new System::LightGather(scene));
systemGraph->addSystem(new System::MeshUpdater(scene));
systemGraph->addSystem(new System::CameraUpdater(scene));
OWindowManager windowManager = new WindowManager(systemGraph);
AssetRegistry::init(sourcePath / "Assets", graphics); AssetRegistry::init(sourcePath / "Assets", graphics);
AssetImporter::init(graphics); AssetImporter::init(graphics);
AssetImporter::importFont(FontImportArgs{ AssetImporter::importFont(FontImportArgs{
@@ -172,18 +188,15 @@ int main(int argc, char** argv) {
.preferredFormat = Gfx::SE_FORMAT_B8G8R8A8_SRGB, .preferredFormat = Gfx::SE_FORMAT_B8G8R8A8_SRGB,
}; };
auto window = windowManager->addWindow(graphics, mainWindowInfo); auto window = windowManager->addWindow(graphics, mainWindowInfo);
// ViewportCreateInfo sceneViewInfo = { ViewportCreateInfo sceneViewInfo = {
// .dimensions = .dimensions =
// { {
// .size = {1920, 1080}, .size = {1920, 1080},
// .offset = {0, 0}, .offset = {0, 0},
// }, },
// }; };
// OGameView sceneView = new Editor::PlayView(graphics, window, sceneViewInfo, binaryPath); OGameView sceneView = new Editor::PlayView(graphics, window, scene, sceneViewInfo);
// sceneView->setFocused(); sceneView->setFocused();
// The windowed editor path has no pre-existing scene; the InspectorView's entity
// pane needs one to enumerate. Create a fresh Scene on the live (windowed) device.
OScene scene = new Scene(graphics);
OInspectorView inspectorView = new Editor::InspectorView(graphics, window, OInspectorView inspectorView = new Editor::InspectorView(graphics, window,
ViewportCreateInfo{ ViewportCreateInfo{
.dimensions = .dimensions =
@@ -142,6 +142,10 @@ void UIPass::createRenderPass() {
passSize = UVector2(viewport->getWidth(), viewport->getHeight()); passSize = UVector2(viewport->getWidth(), viewport->getHeight());
createRenderPass(); createRenderPass();
} }
Gfx::RenderTargetLayout layout = Gfx::RenderTargetLayout{
.colorAttachments = {colorAttachment},
.depthAttachment = depthAttachment,
};
Array<Gfx::SubPassDependency> dependency = { Array<Gfx::SubPassDependency> dependency = {
{ {
.srcSubpass = ~0U, .srcSubpass = ~0U,
+1 -1
View File
@@ -1009,7 +1009,7 @@ void Graphics::pickPhysicalDevice() {
shaderFloatControls = true; shaderFloatControls = true;
} }
} }
rayTracingEnabled = rayTracingPipelineSupport && accelerationStructureSupport && hostOperationsSupport && deviceAddressSupport && rayTracingEnabled = false && rayTracingPipelineSupport && accelerationStructureSupport && hostOperationsSupport && deviceAddressSupport &&
descriptorIndexingSupport && spirv14Support && shaderFloatControls; descriptorIndexingSupport && spirv14Support && shaderFloatControls;
} }
+4 -25
View File
@@ -4,25 +4,18 @@
#include "Graphics/RenderPass/BasePass.h" #include "Graphics/RenderPass/BasePass.h"
#include "Graphics/RenderPass/CachedDepthPass.h" #include "Graphics/RenderPass/CachedDepthPass.h"
#include "Graphics/RenderPass/DepthCullingPass.h" #include "Graphics/RenderPass/DepthCullingPass.h"
#include "Graphics/RenderPass/FluidRenderPass.h"
#include "Graphics/RenderPass/LightCullingPass.h" #include "Graphics/RenderPass/LightCullingPass.h"
#include "Graphics/RenderPass/RayTracingPass.h" #include "Graphics/RenderPass/RayTracingPass.h"
#include "Graphics/RenderPass/ShadowPass.h" #include "Graphics/RenderPass/ShadowPass.h"
#include "Graphics/RenderPass/SimulationComputePass.h"
#include "Graphics/RenderPass/SurfaceExtractPass.h"
#include "Graphics/RenderPass/ToneMappingPass.h" #include "Graphics/RenderPass/ToneMappingPass.h"
#include "Graphics/RenderPass/VisibilityPass.h" #include "Graphics/RenderPass/VisibilityPass.h"
#include "System/CameraUpdater.h"
#include "System/FluidUpdater.h"
#include "System/LightGather.h"
#include "System/MeshUpdater.h"
#include "Window/Window.h" #include "Window/Window.h"
#include "Scene/LightEnvironment.h" #include "Scene/LightEnvironment.h"
using namespace Seele; using namespace Seele;
GameView::GameView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::filesystem::path dllPath) GameView::GameView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo)
: View(graphics, window, createInfo, "Game"), graphics(graphics), scene(new Scene(graphics)), gameInterface(dllPath) { : View(graphics, window, createInfo, "Game"), graphics(graphics), scene(scene) {
reloadGame(); reloadGame();
renderGraph.addPass(new CachedDepthPass(graphics, scene)); renderGraph.addPass(new CachedDepthPass(graphics, scene));
renderGraph.addPass(new DepthCullingPass(graphics, scene)); renderGraph.addPass(new DepthCullingPass(graphics, scene));
@@ -56,7 +49,6 @@ void GameView::update() {
for (VertexData* vd : VertexData::getList()) { for (VertexData* vd : VertexData::getList()) {
vd->resetMeshData(); vd->resetMeshData();
} }
systemGraph->run(updateTime);
scene->update(updateTime); scene->update(updateTime);
for (VertexData* vd : VertexData::getList()) { for (VertexData* vd : VertexData::getList()) {
vd->createDescriptors(); vd->createDescriptors();
@@ -94,29 +86,16 @@ void GameView::applyArea(URect) {
} }
void GameView::reloadGame() { void GameView::reloadGame() {
gameInterface.reload();
systemGraph = new SystemGraph();
gameInterface.getGame()->setupScene(scene, systemGraph);
System::OKeyboardInput keyInput = new System::KeyboardInput(scene);
keyboardSystem = keyInput;
systemGraph->addSystem(std::move(keyInput));
systemGraph->addSystem(new System::FluidUpdater(scene));
systemGraph->addSystem(new System::LightGather(scene));
systemGraph->addSystem(new System::MeshUpdater(scene));
systemGraph->addSystem(new System::CameraUpdater(scene));
} }
void GameView::keyCallback(KeyCode code, InputAction action, KeyModifierFlags modifier) { void GameView::keyCallback(KeyCode code, InputAction action, KeyModifierFlags modifier) {
keyboardSystem->keyCallback(code, action, modifier);
} }
void GameView::mouseMoveCallback(double xPos, double yPos) { keyboardSystem->mouseCallback(xPos, yPos); } void GameView::mouseMoveCallback(double xPos, double yPos) { }
void GameView::mouseButtonCallback(MouseButton button, InputAction action, KeyModifierFlags modifier) { void GameView::mouseButtonCallback(MouseButton button, InputAction action, KeyModifierFlags modifier) {
keyboardSystem->mouseButtonCallback(button, action, modifier);
} }
void GameView::scrollCallback(double xScroll, double yScroll) { keyboardSystem->scrollCallback(xScroll, yScroll); } void GameView::scrollCallback(double xScroll, double yScroll) { }
void GameView::fileCallback(int, const char**) {} void GameView::fileCallback(int, const char**) {}
+2 -4
View File
@@ -12,7 +12,7 @@
namespace Seele { namespace Seele {
class GameView : public View { class GameView : public View {
public: public:
GameView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo& createInfo, std::filesystem::path dllPath); GameView(Gfx::PGraphics graphics, PWindow window, PScene scene, const ViewportCreateInfo& createInfo);
virtual ~GameView(); virtual ~GameView();
virtual void beginUpdate() override; virtual void beginUpdate() override;
virtual void update() override; virtual void update() override;
@@ -26,12 +26,10 @@ class GameView : public View {
protected: protected:
virtual void applyArea(URect rect) override; virtual void applyArea(URect rect) override;
Gfx::PGraphics graphics; Gfx::PGraphics graphics;
OScene scene; PScene scene;
GameInterface gameInterface;
RenderGraph renderGraph; RenderGraph renderGraph;
RenderGraph rayTracingGraph; RenderGraph rayTracingGraph;
OSystemGraph systemGraph;
System::PKeyboardInput keyboardSystem; System::PKeyboardInput keyboardSystem;
float updateTime = 0; float updateTime = 0;
+4 -1
View File
@@ -1,9 +1,11 @@
#include "WindowManager.h" #include "WindowManager.h"
#include "Graphics/Enums.h"
#include "Graphics/Graphics.h" #include "Graphics/Graphics.h"
#include "System/SystemGraph.h"
using namespace Seele; using namespace Seele;
WindowManager::WindowManager() {} WindowManager::WindowManager(PSystemGraph systemGraph) : systemGraph(systemGraph) {}
WindowManager::~WindowManager() {} WindowManager::~WindowManager() {}
@@ -18,6 +20,7 @@ void WindowManager::render() {
window->pollInputs(); window->pollInputs();
if (window->isPaused()) if (window->isPaused())
continue; continue;
systemGraph->run(Gfx::getCurrentFrameDelta());
window->render(); window->render();
} }
} }
+3 -1
View File
@@ -1,12 +1,13 @@
#pragma once #pragma once
#include "Containers/Array.h" #include "Containers/Array.h"
#include "System/SystemGraph.h"
#include "Window.h" #include "Window.h"
namespace Seele { namespace Seele {
DECLARE_NAME_REF(Gfx, Graphics) DECLARE_NAME_REF(Gfx, Graphics)
class WindowManager { class WindowManager {
public: public:
WindowManager(); WindowManager(PSystemGraph systemGraph);
~WindowManager(); ~WindowManager();
OWindow addWindow(Gfx::PGraphics graphics, const WindowCreateInfo& createInfo); OWindow addWindow(Gfx::PGraphics graphics, const WindowCreateInfo& createInfo);
void render(); void render();
@@ -15,6 +16,7 @@ class WindowManager {
private: private:
Array<PWindow> windows; Array<PWindow> windows;
PSystemGraph systemGraph;
}; };
DEFINE_REF(WindowManager) DEFINE_REF(WindowManager)
} // namespace Seele } // namespace Seele