mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-03-04 04:56:36 +00:00
fixing put pixel, adding scene change checker
This commit is contained in:
@@ -13,10 +13,7 @@ namespace mlx
|
||||
// TODO : re-enable render targets
|
||||
m_renderer.Init(nullptr);
|
||||
m_scene_renderer.Init(m_renderer);
|
||||
|
||||
SceneDescriptor descriptor{};
|
||||
descriptor.renderer = &m_renderer;
|
||||
p_scene = std::make_unique<Scene>(std::move(descriptor));
|
||||
p_scene = std::make_unique<Scene>();
|
||||
}
|
||||
|
||||
GraphicsSupport::GraphicsSupport(std::size_t w, std::size_t h, std::string title, int id) :
|
||||
@@ -28,10 +25,7 @@ namespace mlx
|
||||
MLX_PROFILE_FUNCTION();
|
||||
m_renderer.Init(p_window.get());
|
||||
m_scene_renderer.Init(m_renderer);
|
||||
|
||||
SceneDescriptor descriptor{};
|
||||
descriptor.renderer = &m_renderer;
|
||||
p_scene = std::make_unique<Scene>(std::move(descriptor));
|
||||
p_scene = std::make_unique<Scene>();
|
||||
}
|
||||
|
||||
void GraphicsSupport::Render() noexcept
|
||||
@@ -39,6 +33,7 @@ namespace mlx
|
||||
MLX_PROFILE_FUNCTION();
|
||||
if(m_renderer.BeginFrame())
|
||||
{
|
||||
m_draw_layer = 0;
|
||||
m_scene_renderer.Render(*p_scene, m_renderer);
|
||||
m_renderer.EndFrame();
|
||||
}
|
||||
@@ -47,7 +42,7 @@ namespace mlx
|
||||
// dump memory to file every two seconds
|
||||
using namespace std::chrono_literals;
|
||||
static std::int64_t timer = static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count());
|
||||
if(std::chrono::duration<std::uint64_t>{static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count()) - timer} >= 1s)
|
||||
if(std::chrono::duration<std::uint64_t>{ static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count()) - timer } >= 1s)
|
||||
{
|
||||
RenderCore::Get().GetAllocator().DumpMemoryToJson();
|
||||
timer = static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count());
|
||||
|
||||
Reference in New Issue
Block a user