forked from ManalHasan/OOP-Project-Manal-Moiz-Naaseh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstructions.cpp
More file actions
47 lines (39 loc) · 795 Bytes
/
Instructions.cpp
File metadata and controls
47 lines (39 loc) · 795 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
42
43
44
45
46
47
#include "Instruction.hpp"
//constructor
Instructions::Instructions()
{
next = false;
}
//loading the image of background
void Instructions::Initialize(SDL_Renderer* ren)
{
inst.CreateTexture("image/Instructions.png", ren);
}
//checking whether next arrow clicked or not
int Instructions::EventHandling(SDL_Event& e)
{
SDL_PollEvent(&e);
if (e.type == SDL_QUIT)
{
return -1;
}
else if (e.type == SDL_MOUSEBUTTONDOWN && e.motion.x > 690 && e.motion.x < 730 && e.motion.y > 470 && e.motion.y < 490)
{
next = true;
}
return 0;
}
void Instructions::Render(SDL_Renderer* ren)
{
inst.Render(ren);
}
//accessor
bool Instructions::getNext() const
{
return next;
}
//destructor
Instructions::~Instructions()
{
next = false;
}