-
Notifications
You must be signed in to change notification settings - Fork 0
/
Log.cpp
43 lines (33 loc) · 839 Bytes
/
Log.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "stdafx.h"
#include <iostream>
void Log::InfoVector(XMVECTOR& vec, std::string name) {
XMFLOAT4 f;
XMStoreFloat4(&f, vec);
Info("Vector \"" + name + "\":");
Info("x = " + STR(f.x));
Info("y = " + STR(f.y));
Info("z = " + STR(f.z));
Info("w = " + STR(f.w));
}
void Log::Info(std::string message) {
Info(std::wstring(message.begin(), message.end()));
}
void Log::Info(std::wstring message) {
// Output to console
OutputDebugString(message.c_str());
OutputDebugString(L"\n");
}
void Log::Error(std::string message) {
Error(std::wstring(message.begin(), message.end()));
}
void Log::Error(std::wstring message) {
// output to message box
OutputDebugString(message.c_str());
OutputDebugString(L"\n");
MessageBox(
nullptr,
message.c_str(),
L"ERROR",
MB_OK | MB_ICONERROR
);
}