-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine.cpp
More file actions
66 lines (53 loc) · 1.54 KB
/
Engine.cpp
File metadata and controls
66 lines (53 loc) · 1.54 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
#include "Engine.h"
Engine::Engine() {
}
bool Engine::Initialize(HINSTANCE instance, std::string title, int width, int height) {
if (!this->renderWindow.Initialize(this, instance, title, width, height))
return false;
if (!GFX.Initialize(this->renderWindow.GetHandle(), width, height))
return false;
return true;
}
bool Engine::HandleMessages() {
return this->renderWindow.HandleMessages();
}
void Engine::Upadate() {
while (!keyboard.IsCharBufferEmpty()) {
unsigned char o1 = keyboard.ReadChar();
//std::string msg1 = "Char: ";
//msg1 += o1;
//msg1 += "\n";
//OutputDebugStringA(msg1.c_str());
}
while (!keyboard.IsEventBufferEmpty()) {
unsigned char o2 = keyboard.ReadChar();
//std::string msg2 = "Char: ";
//msg2 += o2;
//msg2 += "\n";
//OutputDebugStringA(msg2.c_str());
}
// while (!mouse.IsEventBufferEmpty()) {
/* MouseEvent me = mouse.ReadEvent();
if (me.GetType() == MouseEvent::EventType::WheelUp)
OutputDebugStringA("Wheel up");
else if (me.GetType() == MouseEvent::EventType::WheelDown)
OutputDebugStringA("Wheel down");
if (me.GetType() == MouseEvent::EventType::RawMove) {
std::string o3 = "X: ";
o3 += std::to_string(me.GetPositionX());
o3 += ", Y: ";
o3 += std::to_string(me.GetPositionY());
o3 += "\n";
OutputDebugStringA(o3.c_str());
}*/
//std::string o3 = "X: ";
//o3 += std::to_string(me.GetPositionX());
//o3 += ", Y: ";
//o3 += std::to_string(me.GetPositionY());
//o3 += "\n";
//OutputDebugStringA(o3.c_str());
// }
}
void Engine::RenderFrame() {
GFX.RenderFrame();
}