Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lockandstrike

Pages: 1 2 [3]
31
General / Re: Help with a switch statement
« on: August 06, 2013, 05:52:31 pm »
Ok than tell if this would work as well:

...
switch(event.type){
case sf::Event::Closed:

Window.close();
break;

case sf::Event::KeyPressed:
if(event == sf::Keyboard::Escape){
Window.close();
}
break;
}

32
General / [SOLVED] Help with a switch statement
« on: August 06, 2013, 05:06:49 pm »
So here is the thing. I'm starting to learn SFML and although i know C++ there are somethings that i still don't possess total knowledge of. So here the part of my code where I need help:

...
switch (event.type || event.key.code ){

case sf::Keyboard::Escape:
case sf::Event::Closed:

Window.close();
break;
}
...
 

But when i run the program with this code it doesn't allow me to close it neither with the close button neither with the escape key.
Any help would be appreciated.

Pages: 1 2 [3]