-
Notifications
You must be signed in to change notification settings - Fork 0
/
opening.c
54 lines (49 loc) · 1.34 KB
/
opening.c
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
void opening(SDL_Window *window, SDL_Renderer *renderer){
int counter = 0;
openingElement = setElement(
"opening",
IMG_Load("png/abertura.png"),
createRect(0,0,1920,1080),
createRect(0,0,WIDTH,HEIGHT)
);
while( 1 )
{
SDL_Event event;
while(SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
Mix_Quit();
TTF_Quit();
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return;
break;
case SDL_KEYDOWN:
switch (event.key.keysym.scancode)
{
case SDL_SCANCODE_RETURN:
playSound(0);
gameTitle(window, renderer);
return;
break;
}
break;
}
}
counter++;
if (counter > 171)
{
callGameTitle(window, renderer);
return;
break;
}
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, openingElement.Texture, &openingElement.cut, &openingElement.sizeImg);
SDL_RenderPresent(renderer);
SDL_Delay(fps);
}
return;
}