[t:/]$ 지식_

리눅스 프레임버퍼 기본정보 얻는 코드. Linux Framebuffer.

2009/10/07
#include <stdio.h>
#include <unistd.h> 
#include <fcntl.h> 
#include <sys/ioctl.h> 
#include <linux/fb.h> 

main()
{
    int fd;
    int ret;
    struct fb_var_screeninfo fbvar;
    struct fb_fix_screeninfo fbfix;

    fd = open("/dev/fb0", O_RDWR);
    ret = ioctl(fd, FBIOGET_VSCREENINFO, &fbvar);
    ret = ioctl(fd, FBIOGET_FSCREENINFO, &fbfix);

    printf("x res      : %d\n", fbvar.xres);
    printf("y res      : %d\n", fbvar.yres);
    printf("x res virt : %d\n", fbvar.xres_virtual);
    printf("y res virt : %d\n", fbvar.yres_virtual);
    printf("bpp        : %d\n", fbvar.bits_per_pixel);
    printf("base       : %x\n", fbfix.smem_start);

    printf("buffer mem len : %d\n", fbfix.smem_len);

    close(fd);
}

별 거 없음.









[t:/] is not "technology - root". dawnsea, rss