eobish

view src/main.c @ 3:e32bdd5fb622

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 18 Jan 2015 05:51:51 +0200
parents src/main.cc@cdbcae5b3b98
children ce0548d24918
line source
1 #include <stdio.h>
2 #include "fblib.h"
4 static void display();
6 int main(int argc, char **argv)
7 {
8 if(fb_init(320, 240, 8) == -1) {
9 return 1;
10 }
11 fb_set_palette_entry(1, 255, 0, 0);
13 for(;;) {
14 if(fb_process_events() == -1) {
15 break;
16 }
17 display();
18 }
20 done:
21 fb_shutdown();
22 return 0;
23 }
25 void display()
26 {
27 int i;
28 int width = fb_get_width();
29 int height = fb_get_height();
30 unsigned char *pixels = (unsigned char*)fb_begin_frame();
32 for(i=0; i<width * height; i++) {
33 *pixels++ = 1;
34 }
36 fb_end_frame();
37 }