diff --git a/README.md b/README.md index 679e6c8..bc2bb24 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ $ ./build/ouros ``` For control on debugging: ```bash -$ ./build/ouros --debug 0b00111111 +$ ./build/ouros --debug=0b00111111 ``` where each bit in the mask corresponds to a debug level, in order: unused, unused, fatal, trace, error, warning, notice, and info. `0b1111111` enables all debug messages. diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 99b4567..9d337c2 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -34,8 +34,7 @@ void Engine::exec() { }; VkInstance instance; - VkResult result = vkCreateInstance(&instanceCI, nullptr, &instance); - if(result == VK_SUCCESS) { + if(vkCreateInstance(&instanceCI, nullptr, &instance) == VK_SUCCESS) { utils::debugPrint(__FUNCTION__, __LINE__, "Vulkan instance successfully created.", utils::DebugLevel::Info); } else { utils::debugPrint(__FUNCTION__, __LINE__, "Error creating Vulkan instance", utils::DebugLevel::Error); diff --git a/src/engine/Engine.hpp b/src/engine/Engine.hpp index 8100683..a82459a 100644 --- a/src/engine/Engine.hpp +++ b/src/engine/Engine.hpp @@ -16,6 +16,7 @@ public: private: + // might get rid of this void init(); // TODO: smart pointers probably would be smart diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index 2d8ad4d..5e01151 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -37,7 +37,7 @@ namespace utils { static void debugPrint(const char* function, int line, std::string message, size_t debugLevel) { - if(!(debugMask >> debugLevel)) return; // then ignore this debug level + if(!((debugMask >> debugLevel) & 1)) return; // then ignore this debug level std::cout << "[ " << std::left << std::setw(16) << function << ": " << std::right << std::setw(4) << line << ", " << std::left << std::setw(8) << debugTypeStrings[debugLevel] << " ] " << message << std::endl; // TODO: add timestamps @@ -53,6 +53,7 @@ namespace utils { std::cout << "Unsupported debug key." << std::endl; } debugMask = static_cast(std::stoul(value, nullptr, 2)); // interpret a string as a uint + } } \ No newline at end of file