-
Notifications
You must be signed in to change notification settings - Fork 0
/
public.h
54 lines (46 loc) · 910 Bytes
/
public.h
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
44
45
46
47
48
49
50
51
52
53
54
#include <Kinect.h>
#include <Windows.h>
#include <vector>
#include <algorithm>
#include "KinectTools.h"
using namespace std;
#ifndef _PUBLIC_H_
#define _PUBLIC_H_
//typedef vector<Joint> JOINTS;
typedef JOINTS::iterator JOINTP;
typedef vector<JOINTS> JOINTSLIST;
typedef vector<POINT> DRAWLIST;
typedef vector<POINT>::iterator DRAWITE;
class Console //控制台类
{
private:
HANDLE outhandle;
HANDLE inhandle;
public:
bool succeed;
Console() : succeed(false)
{
succeed = AllocConsole();
if (succeed)
{
outhandle = GetStdHandle(STD_OUTPUT_HANDLE);
inhandle = GetStdHandle(STD_INPUT_HANDLE);
}
}
~Console()
{
FreeConsole();
}
DWORD write(string content) //在控制台输出一个字符串
{
if (!succeed) return -1;
DWORD _result = 0;
WriteConsoleA(outhandle, content.c_str(), content.length(), &_result, NULL);
return _result;
}
void pause()
{
system("pause");
}
};
#endif