SFML community forums
Help => Window => Topic started by: AdrianM 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?
////////////////////////////////////////////////////////////
// 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;
}
-
For me it's working... I just need to add this
#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
-
Ok, thank you for you report. Will be fixed ASAP. :wink:
-
Should be fine now. Could you check again ?
-
It works now as expected! Thanks!