From f1d55148c98bcac539da68b7b3ca299886851ad0 Mon Sep 17 00:00:00 2001 From: lukasx999 <116069013+lukasx999@users.noreply.github.com> Date: Mon, 2 Jun 2025 01:14:33 +0200 Subject: [PATCH] added loglevel to window constructor --- include/Window.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/Window.hpp b/include/Window.hpp index 54fe00f7..1ec89203 100644 --- a/include/Window.hpp +++ b/include/Window.hpp @@ -27,14 +27,15 @@ class Window { * @param height The height of the window. * @param title The desired title of the window. * @param flags The ConfigFlags to set prior to initializing the window. See SetConfigFlags for more details. + * @param logLevel The the current threshold (minimum) log level * * @see ::SetConfigFlags() * @see ConfigFlags * * @throws raylib::RaylibException Thrown if the window failed to initiate. */ - Window(int width, int height, const std::string& title = "raylib", unsigned int flags = 0) { - Init(width, height, title, flags); + Window(int width, int height, const std::string& title = "raylib", unsigned int flags = 0, TraceLogLevel logLevel = LOG_ALL) { + Init(width, height, title, flags, logLevel); } /** @@ -55,10 +56,11 @@ class Window { * * @throws raylib::RaylibException Thrown if the window failed to initiate. */ - static void Init(int width = 800, int height = 450, const std::string& title = "raylib", unsigned int flags = 0) { + static void Init(int width = 800, int height = 450, const std::string& title = "raylib", unsigned int flags = 0, TraceLogLevel logLevel = LOG_ALL) { if (flags != 0) { ::SetConfigFlags(flags); } + ::SetTraceLogLevel(logLevel); ::InitWindow(width, height, title.c_str()); if (!::IsWindowReady()) { throw RaylibException("Failed to create Window");