blob: 41e3560daa1bfa6254f21ff85c0195d95bb50d40 (
plain)
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
|
#define FBGL_IMPLEMENTATION
#include "fbgl.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> // for usleep
#include <stdint.h>
int main(int argc, char *argv[])
{
fbgl_t fb;
fbgl_init("/dev/fb0", &fb);
fbgl_set_bg(&fb, 0xFFFFFF);
fbgl_psf1_font_t *font = fbgl_load_psf1_font(argv[1]);
fbgl_render_psf1_text(&fb, font, "hello, fbgl", 100, 100, 0x000000);
size_t framerate = 30 * 30;
for(size_t i = 0; i < framerate; i++) {
usleep(50000);
}
fbgl_destroy_psf1_font(font);
fbgl_destroy(&fb);
return 0;
}
|