-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainLobby.cpp
74 lines (57 loc) · 1.07 KB
/
MainLobby.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "stdafx.h"
#include "MainLobby.h"
MainLobby::MainLobby() : mSelect(false)
{
}
MainLobby::~MainLobby()
{
}
void MainLobby::InitD3D(HWND hWnd)
{
Frame::InitD3D(hWnd);
CreateWICTextureFromFile(mspDevice.Get(), L"Images\\Lobby.jpg", NULL, mspTexture.ReleaseAndGetAddressOf());
}
void MainLobby::Update(float dt)
{
Frame::Update(dt);
}
void MainLobby::Render()
{
Frame::Render();
RECT r = { 0,0,mScreenWidth,mScreenHeight };
XMFLOAT2 pos = { 0,0 };
mspSpriteBatch->Begin();
mspSpriteBatch->Draw(mspTexture.Get(),pos);
mspSpriteBatch->End();
}
int MainLobby::LobbyGameLoop()
{
MSG msg;
while (true)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if (msg.message == WM_QUIT) { break; }
}
else
{
if (!mbPaused)
{
Frame::KeyboardTracker.Update(mspKeyboard->GetState());
Frame::MouseTracker.Update(mspMouse->GetState());
Update(mTimer.DeltaTime());
BeginRender();
Render();
EndRender();
}
else
{
Sleep(100);
}
}
}
ClearD3D();
return msg.wParam;
}