sro5h / SFML

Simple and Fast Multimedia Library, raw input implementation

Home Page:http://www.sfml-dev.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

http://www.sfml-dev.org/

License:Other


Languages

Language:C++ 84.7%Language:Objective-C++ 6.9%Language:CMake 5.9%Language:Objective-C 2.1%Language:Shell 0.2%Language:Makefile 0.2%