This commit is contained in:
Jiga228
2025-10-18 16:39:43 +07:00
parent 450b3839c6
commit d79258e191
6 changed files with 23 additions and 17 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ unsigned int ModelManager::FNV1aHash(const char* buf)
void ModelManager::OnDestroySometimeModelCaller(const std::string& name)
{
Log("Free model: " + name);
Loging::Log("Free model: " + name);
OnDestroySometimeModel.Call(name);
}
@@ -76,7 +76,7 @@ ModelManager::StaticModel* ModelManager::LoadModel(const std::string& name)
return counter->second.model;
}
Log("Load new model: " + name);
Loging::Log("Load new model: " + name);
std::vector<Voxel> model_data;
// Load model_data
+2 -2
View File
@@ -27,7 +27,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
std::string msg = "validation layer: ";
msg += pCallbackData->pMessage;
Log(msg);
Loging::Log(msg);
return VK_FALSE;
}
@@ -338,7 +338,7 @@ void RenderEngine::pick_physical_device()
physical_device_ = device;
VkPhysicalDeviceProperties device_properties;
vkGetPhysicalDeviceProperties(physical_device_, &device_properties);
Log("Using device: " + std::string(device_properties.deviceName));
Loging::Log("Using device: " + std::string(device_properties.deviceName));
break;
}
}
+6 -6
View File
@@ -6,34 +6,34 @@
std::mutex mOutput;
#ifdef _DEBUG
void Log(const char* msg)
void Loging::Log(const char* msg)
{
std::lock_guard lock(mOutput);
std::cout << msg << '\n';
}
void Log(const std::string& msg)
void Loging::Log(const std::string& msg)
{
std::lock_guard lock(mOutput);
std::cout << msg << '\n';
}
#else
void Log(const char* msg)
void Loging::Log(const char* msg)
{
}
void Log(const std::string& msg)
void Loging::Log(const std::string& msg)
{
}
#endif
void Message(const char* msg)
void Loging::Message(const char* msg)
{
std::lock_guard lock(mOutput);
std::cout << msg << '\n';
}
void Message(const std::string& msg)
void Loging::Message(const std::string& msg)
{
std::lock_guard lock(mOutput);
std::cout << msg << '\n';
+7 -4
View File
@@ -2,8 +2,11 @@
#include <string>
void Log(const char* msg);
void Log(const std::string& msg);
namespace Loging
{
void Log(const char* msg);
void Log(const std::string& msg);
void Message(const char* msg);
void Message(const std::string& msg);
void Message(const char* msg);
void Message(const std::string& msg);
}