adding nesting to debug logs

This commit is contained in:
2024-11-05 12:49:21 +01:00
parent 4ae7bd0420
commit eaf5be3061
16 changed files with 42 additions and 9 deletions

View File

@@ -30,11 +30,16 @@ namespace mlx
static void Report(LogType type, std::string message);
static void Report(LogType type, unsigned int line, std::string_view file, std::string_view function, std::string message);
static void BeginSection();
static void EndSection();
~Logs() = delete;
private:
static std::uint32_t s_nesting;
};
#if defined(DEBUG)
#ifdef DEBUG
template<typename... Args>
void Assert(bool cond, unsigned int line, std::string_view file, std::string_view function, std::string message, const Args&... args);
#else

View File

@@ -102,7 +102,7 @@ namespace mlx
}
}
#if defined(DEBUG)
#ifdef DEBUG
template<typename... Args>
void Assert(bool cond, unsigned int line, std::string_view file, std::string_view function, std::string message, const Args&... args)
{

View File

@@ -33,13 +33,11 @@ namespace mlx
inline const Vec4f& GetClearColor() const noexcept { return m_clear_color; }
[[nodiscard]] MLX_FORCEINLINE const std::vector<std::shared_ptr<Drawable>>& GetDrawables() const noexcept { return m_drawables; }
[[nodiscard]] MLX_FORCEINLINE ViewerData& GetViewerData() noexcept { return m_viewer_data; }
~Scene() = default;
private:
std::vector<std::shared_ptr<Drawable>> m_drawables;
ViewerData m_viewer_data;
std::shared_ptr<Font> p_bound_font;
Vec4f m_clear_color = { 0.0f, 0.0f, 0.0f, 1.0f };
};