-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebug.cpp
38 lines (32 loc) · 1.05 KB
/
Debug.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
#include "stdafx.h"
#include <string>
#include "Debug.h"
void Debug::text (HDC hdc, int x, int y, COLORREF color, std::string string, int number)
{
Debug::text (hdc, x, y, color, string, std::to_string (number));
}
void Debug::text (HDC hdc, int x, int y, COLORREF color, std::string string1, std::string string2)
{
Debug::text (hdc, x, y, color, string1 + string2);
}
void Debug::text (HDC hdc, int x, int y, COLORREF color, std::string string)
{
Debug::text (hdc, x, y, color, string.c_str ());
}
void Debug::text (HDC hdc, int x, int y, COLORREF color, LPCSTR string1, LPCSTR string2)
{
Debug::text (hdc, x, y, color, Debug::string_combine (string1, string2));
}
void Debug::text (HDC hdc, int x, int y, COLORREF color, LPCSTR string)
{
SetTextColor (hdc, color);
TextOutA (hdc, x, y, string, strlen (string));
}
LPCSTR Debug::string_combine (LPCSTR string1, LPCSTR string2)
{
const int max_length = 100;
char new_string[max_length];
strcpy_s (new_string, string1);
strcat_s (new_string, string2);
return new_string;
}