-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEngine.h
More file actions
42 lines (32 loc) · 659 Bytes
/
Engine.h
File metadata and controls
42 lines (32 loc) · 659 Bytes
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
#pragma once
#include "resource.h"
#include "Point2D.h"
#include "Snake.h"
#include "Food.h"
#define RESOLUTION_X 800
#define RESOLUTION_Y 600
#define FRAME_SLEEP 100
#define CELL_SIZE 20
class Engine
{
public:
Engine();
~Engine();
HRESULT InitializeD2D(HWND m_hwnd);
void KeyUp(WPARAM wParam);
void Reset();
void Logic(double elapsedTime);
HRESULT Draw();
private:
ID2D1Factory* m_pDirect2dFactory;
ID2D1HwndRenderTarget* m_pRenderTarget;
IDWriteFactory* m_pDWriteFactory;
IDWriteTextFormat* m_pTextFormat;
ID2D1SolidColorBrush* m_pWhiteBrush;
Snake* snake;
Food* food;
int score;
int highScore;
bool playing;
bool keyPressed;
};