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

Author Topic: [MAC OS X-SFML2] No mouse moved events while pressing mouse  (Read 2826 times)

0 Members and 1 Guest are viewing this topic.

AdrianM

  • Newbie
  • *
  • Posts: 43
    • View Profile
[MAC OS X-SFML2] No mouse moved events while pressing mouse
« on: December 03, 2010, 08:15:12 pm »
This little piece of code won't print anything while pressing either mouse buttons and moving the mouse, why is that?

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <map>
#include <math.h>



////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Shader");

    // Create a clock to measure the total time elapsed
    sf::Clock clock;

    // Start the game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();

            if (event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (event.Key.Code == sf::Key::Escape)
                    window.Close();
            }

if (event.Type == sf::Event::MouseMoved)
{
printf("%d %d\n", event.MouseMove.X, event.MouseMove.Y);
}
        }

        // Finally, display the rendered frame on screen
        window.Display();
    }

    return EXIT_SUCCESS;
}

Drektar

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
[MAC OS X-SFML2] No mouse moved events while pressing mouse
« Reply #1 on: December 03, 2010, 10:54:52 pm »
For me it's working... I just need to add this
Code: [Select]
#include <stdio.h>

Edit: I just see the title of the subject... I'm not working with MAC.
But the code is working on Linux and Windows

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
[MAC OS X-SFML2] No mouse moved events while pressing mouse
« Reply #2 on: December 03, 2010, 11:10:34 pm »
Ok, thank you for you report. Will be fixed ASAP.  :wink:
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
[MAC OS X-SFML2] No mouse moved events while pressing mouse
« Reply #3 on: December 03, 2010, 11:32:02 pm »
Should be fine now. Could you check again ?
SFML / OS X developer

AdrianM

  • Newbie
  • *
  • Posts: 43
    • View Profile
[MAC OS X-SFML2] No mouse moved events while pressing mouse
« Reply #4 on: December 04, 2010, 11:12:14 am »
It works now as expected! Thanks!