issue using SDL2 with Events

Hey guys!
I am using SDL2 lib now with code::blocks!
But i had an issue.
I was creating a game but when i run it, it doesn't work, it tells me that the game does not respond.
I don't know why.. because on another last project it works perfectly.
It is in a game loop: here it is the code please help me:
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
//main game loop
bool Done=false;
SDL_Event* Event;
While(Done==false)
{
//Game content for rendering ecc.
while (SDL_PollEvent(Event)==1)
{
switch((*Event).type)
{
Case SDL_Keydown:
switch((*Event).button.button)
{
case SDLK_RIGHT:
// Here it happens something when the user presses the right arrow key
break;
}
break;
case SDL_WINDOWEVENT:
switch((*Event).window.event)
{
case SDL_WINDOWEVENT_CLOSE:
Done=true;
//This closes the program
break;
}
break;
}
}
//render istruction
}
return 0;

Please help, for closing the window it works, but i added the instruction for pressing a key and it doesn't works... I don't know why!! Please help
Topic archived. No new replies allowed.