/SFML

Simple and Fast Multimedia Library, raw input implementation

Primary LanguageC++OtherNOASSERTION

SFML logo

SFML — Simple and Fast Multimedia Library, raw input implementation

This repository includes a raw input implementation for Linux and Windows (hornta's work). It would be nice if somebody could work out an implementation for OSX.

Installation

Refer to the official installation instructions.

Usage

#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
        sf::RenderWindow window(sf::VideoMode(400, 400), "Test");

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                window.close();
                        }
                        else if (event.type == sf::Event::MouseMovedRaw)
                        {
                                std::cout << "Motion: x = ";
                                std::cout << event.mouseMoveRaw.dx;
                                std::cout << ", y = ";
                                std::cout << event.mouseMoveRaw.dy;
                                std::cout << std::endl;
                        }
                }

                window.clear();
                window.display();
        }

        return EXIT_SUCCESS;
}