Exemplo n.º 1
0
Arquivo: lissa.c Projeto: OPSF/uClinux
int main(int argc, char *argv[])
{
	int i;
	
	screen_fd = open(device, O_RDWR);
	if (screen_fd == -1) {
		perror("Unable to open frame buffer device /dev/fb0");
		exit(-1);
	}
	
	
	if (ioctl(screen_fd, FBIOGET_VSCREENINFO, &screeninfo)==-1) {
		perror("Unable to retrieve framebuffer information");
		exit(0);
	}
	screen_width = screeninfo.xres_virtual;
	screen_height = screeninfo.yres_virtual;
	
	screen_ptr = mmap(0, screen_height * screen_width / 8, PROT_READ|PROT_WRITE, MAP_SHARED, screen_fd, 0);
	
	if (screen_ptr==MAP_FAILED) {
		perror("Unable to mmap frame buffer");
		close (screen_fd);
		exit (errno);
	}
	
	draw_filled_rectangle(0,0, screen_width-1, screen_height-1, 1);
	draw_filled_rectangle(1,1, screen_width-2, screen_height-2, 0);

	draw_lissajous();

	close(screen_fd);
	
	return 0;
}
Exemplo n.º 2
0
void
draw_filled_rect (ALLEGRO_BITMAP *to, struct rect *r,
                  ALLEGRO_COLOR color)
{
  struct coord nc = r->c;

  if (! cutscene && nc.room != room_view) {
    rect2room (r, room_view, &nc);
    if (nc.room != room_view) return;
  }

  draw_filled_rectangle (to, nc.x, nc.y, nc.x + r->w - 1,
                         nc.y + r->h - 1, color);
}