U E D R , A S I H C RSS

0 Player Project/프레임버퍼사용법

우리 보드 기준 (320x240x16bit)


~cpp
#include <io.h>
#include <fcntl.h>
...
#include <linux/fb.h>
#include <sys/mman.h>
...

int main()
{
   int fd;
   unsigned short *data;

   fb0 = open("/dev/fb0", O_RDWR);
   data = (unsigned short*)mmap(0, 320 * 240 * 2, PROT_READ | PROT_WRITE, MAP_SHARED, fb0, 0);

   data[x + y * 320] = RGB;   // (x,y)에 RGB 찍기

   munmap(data, 320 * 240 * 2);
   close(fb0);

   return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:05
Processing time 0.0127 sec