Homebrew Write to framebuffer help

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 2,863
  • Replies Replies 4
Maybe something like


int fbfd = 0;
// Open the framebuffer for reading and writing
fbfd = open("/dev/fb0", O_RDWR);
if (!fbfd) {
printf("Error: cannot open framebuffer device.\n");
exit(1);
}
// Map the framebuffer to memory
unsigned int * fbp = (unsigned int *)mmap(0, XRES*YRES*4, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);

then fbp is a pointer to the framebuffer memory

EDIT: or just set fbfd to the physical address?
 

Site & Scene News

Popular threads in this forum