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

Author Topic: MouseMoved event doesn't work in release mode  (Read 1962 times)

0 Members and 2 Guests are viewing this topic.

monkey3

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
MouseMoved event doesn't work in release mode
« 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.
« Last Edit: September 05, 2015, 05:13:08 pm by monkey3 »


monkey3

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: MouseMoved event doesn't work in release mode
« Reply #2 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.
« Last Edit: September 05, 2015, 06:51:11 pm by monkey3 »

monkey3

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: MouseMoved event doesn't work in release mode
« Reply #3 on: September 05, 2015, 05:02:10 pm »
A new thing: When I scroll mousewheel, Left MouseButtonPressed works. Interesting.
« Last Edit: September 05, 2015, 06:48:55 pm by monkey3 »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: MouseMoved event doesn't work in release mode
« Reply #4 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

monkey3

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
Re: MouseMoved event doesn't work in release mode
« Reply #5 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.

 

anything