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 - nikoloz

Pages: [1]
1
Window / Re: pollEvent takes too long to respond on keyRelease Event
« on: March 12, 2018, 03:20:29 pm »
Thank you.

2
Window / Re: pollEvent takes too long to respond on keyRelease Event
« on: March 12, 2018, 03:03:48 pm »
I've got another event loop in the source.cpp file, I'll provide a code snippet here: https://codepad.co/snippet/np8kumZc#   

I copied the multiplayer_game.cpp event loop in the source.cpp main while loop to test and it worked perfect. I guess it has something to do with the fact that I'm passing a pointer to the window object in the multiplayer_game.cpp, I just don't understand why or how it affects the program.

3
Window / pollEvent takes too long to respond on keyRelease Event
« on: March 11, 2018, 03:36:13 pm »
I have a multiplayer_game class in my game, which is responsible for playing that game between two players. After pressing the Escape button, I want to go instantly back to the choose_player window, where you can choose the game mode(singleplayer/multiplayer). To do that, I'm using this code :

        sf::Event event;

   while (window->pollEvent(event))
   {
      if ((event.type == sf::Event::KeyReleased) && (event.key.code == sf::Keyboard::Escape))
      {
         coreState.SetState(new choose_player);
      }
   }
       
       The problem is, hitting the escape button doesn't always respond (most of the time it takes me back to the choose_player mode,but  sometimes several pressing on the escape is necessary).


Pages: [1]