File: csfml_test.c

package info (click to toggle)
libcsfml 2.5-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,672 kB
  • sloc: cpp: 5,591; ansic: 2,193; sh: 16; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 778 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
26
27
28
29
#include <stdio.h>
#include <SFML/Audio.h>
#include <SFML/Graphics.h>
#include <SFML/Network.h>
#include <SFML/OpenGL.h>
#include <SFML/System.h>
#include <SFML/Window.h>

int main(void)
{
    // 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.

    char buf[16];
    sfIpAddress local_addr;

    // Print local IP
    local_addr = sfIpAddress_getLocalAddress();
    sfIpAddress_toString(local_addr, buf);
    printf("Local IP = %s\n", buf);

    // Call some time functions from sfml-system
    if (sfTime_asMilliseconds(sfSeconds(5)) != 5000)
        return 1;

    return 0;
}