Skip to content

sro5h/SFML

 
 

Repository files navigation

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;
}

About

Simple and Fast Multimedia Library, raw input implementation

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 84.7%
  • Objective-C++ 6.9%
  • CMake 5.9%
  • Objective-C 2.1%
  • Other 0.4%