adding hidden bindings

This commit is contained in:
2025-03-13 00:39:01 +01:00
parent 2345cf4417
commit 093dabcbbb
4 changed files with 106 additions and 0 deletions

View File

@@ -32,16 +32,29 @@ namespace mlx
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
inline void AddPreRenderHook(void(*f)(VkCommandBuffer, void*), void* param);
[[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; }
[[nodiscard]] MLX_FORCEINLINE Renderer& GetRenderer() { return m_renderer; }
[[nodiscard]] MLX_FORCEINLINE Scene& GetScene() { return *p_scene; }
~GraphicsSupport();
private:
struct Hook
{
std::function<void(VkCommandBuffer, void*)> fn;
void* param;
Hook(std::function<void(VkCommandBuffer, void*)> fn, void* param) : fn(fn), param(param) {}
};
private:
Renderer m_renderer;
SceneRenderer m_scene_renderer;
PutPixelManager m_put_pixel_manager;
std::vector<Hook> m_hooks;
std::shared_ptr<Window> p_window;
std::unique_ptr<Scene> p_scene;

View File

@@ -8,4 +8,9 @@ namespace mlx
MLX_PROFILE_FUNCTION();
p_scene->TryEraseSpriteFromTexture(texture);
}
void GraphicsSupport::AddPreRenderHook(void(*f)(VkCommandBuffer, void*), void* param)
{
m_hooks.emplace_back(f, param);
}
}