File: sfml_test.cpp

package info (click to toggle)
libsfml 2.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 5,784 kB
  • sloc: cpp: 31,651; ansic: 6,399; objc: 653; sh: 199; xml: 30; makefile: 14
file content (25 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main()
{
    // The build test doesn't check any graphics since that would require a
    // display server. We just test some basic Network / System functionality.
    // However when building we can still include the other headers to ensure
    // they compile.

    // Print local IP
    std::cout << "Local IP = " << sf::IpAddress::getLocalAddress().toString()
            << std::endl;

    // Call some time functions from sfml-system
    if ((sf::seconds(5) + sf::milliseconds(1234)).asMilliseconds() != 6234)
        return 1;

    return 0;
}