-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro.cpp
More file actions
executable file
·62 lines (44 loc) · 1.08 KB
/
intro.cpp
File metadata and controls
executable file
·62 lines (44 loc) · 1.08 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
#include "intro.h"
extern int draw;
static void button_start_event(kiss_button *button, SDL_Event *e, int *draw,
std::function<void()> callback)
{
//int draw = 1;
if (kiss_button_event(button, e, draw)) {
callback();
}
}
bool Intro::Init(GameEngine* game)
{
button1 = {0};
kiss_window* window = (game->GetRend()->GetWindow());
int center = game->GetRend()->GetWidth()/2;
kiss_label_new(&hello, window, "Press Any Button!", center,
200);
return true;
}
void Intro::Update(GameEngine* game)
{
}
void Intro::HandleEvents(GameEngine* game)
{
SDL_PollEvent(&event);
// kiss_window_event(rend->GetWindow(), &event, &draw);
switch(event.type){
case SDL_KEYDOWN:
break;
case SDL_KEYUP:
game->PopState();
break;
case SDL_TEXTINPUT:
break;
case SDL_QUIT:
game->Quit();
break;
}
}
void Intro::Draw(std::shared_ptr<RenderManager>& rend)
{
// kiss_window_draw(&rend.GetWindow(), rend->GetSDLRenderer());
kiss_label_draw(&hello, rend->GetSDLRenderer());
}