SFML community forums

Help => General => Topic started by: monkey3 on September 05, 2015, 04:14:59 pm

Title: MouseMoved event doesn't work in release mode
Post by: monkey3 on September 05, 2015, 04:14:59 pm
Hello brothers and sisters.

My problem is basically like in the title. In debug mode there is no problem about this. It works good. But in release mode ...

When I click mouse (right or left or middle) MouseMoved event works.

And there is an error on console screen in release mode:

Quote
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 2.0 ; depth bits = 0 ; stencil bits = 0 ; AA level =0 ; core = false ; debug = false
Created: version = 3.1 ; depth bits = 0 ; stencil bits = 0 ; AA level =0 ; core = false ; debug = false

I did not change context settings.
Title: Re: MouseMoved event doesn't work in release mode
Post by: Jesper Juhl on September 05, 2015, 04:36:26 pm
http://en.sfml-dev.org/forums/index.php?topic=18923.msg136213#msg136213
Title: Re: MouseMoved event doesn't work in release mode
Post by: monkey3 on September 05, 2015, 04:58:29 pm
I don't know what should I paste here exactly. But here are the events:

while(Window.pollEvent(event))
   {
      if(event.type==sf::Event::Closed)
         Window.close();

      if(event.type==sf::Event::KeyPressed)
      {
         if(event.key.code == sf::Keyboard::Escape)
            return 1;
      }
           
     
      if(event.type==sf::Event::MouseButtonPressed)
      {
         switch(event.mouseButton.button)
         {
         case sf::Mouse::Left:
            player.newBullet(new Pistol(player.position,sf::Vector2f(event.mouseButton.x,event.mouseButton.y),player.speed,player.radius));
            break;
         case sf::Mouse::Right:
            player.newBullet(new Shotgun(player.position,sf::Vector2f(event.mouseButton.x,event.mouseButton.y),player.speed,player.radius));
            break;
         }
         cout<<"button";
      }

      if(event.type==sf::Event::MouseMoved)
      {
         player.computeAim(sf::Vector2f(sf::Mouse::getPosition(Window)));
         cout<<"move";
      }
   }


And MouseButtonPressed event doesn't work too.
Title: Re: MouseMoved event doesn't work in release mode
Post by: monkey3 on September 05, 2015, 05:02:10 pm
A new thing: When I scroll mousewheel, Left MouseButtonPressed works. Interesting.
Title: Re: MouseMoved event doesn't work in release mode
Post by: Hapax on September 05, 2015, 07:19:02 pm
Make sure you are using the exact same built libraries to match the includes and libs.
For instance, if you are using the latest downloaded source, the built libraries that you link should also be built from that version of the source.
Mixing, say, the latest source for the includes and libs with downloaded release libraries for 2.3.1, can cause this sort of error.

If you have multiple versions, you need to make sure that the included libraries are updated (the libraries you copy across to the same folder/directory when you dynamically link) to match the version you are including.
Title: Re: MouseMoved event doesn't work in release mode
Post by: monkey3 on September 05, 2015, 09:11:44 pm
Thank you very much Hapax.
I was using sfml-2.2 includes but sfml-2.3 libs. I fixed this and there is no problem now.
Thanks for everyone's attention.