当前位置: 技术问答>linux和unix
/dev/fb0和/dev/graphic/fb0
来源: 互联网 发布时间:2017-05-08
本文导语: /dev/fb0和/dev/graphic/fb0的区别 | 好像没什么区别,看看这段代码framebuffer/fb_test.c static int get_framebuffer(GGLSurface *fb) { int fd; void *bits; fd = open("/dev/graphics/fb0", O_RDWR); if...
/dev/fb0和/dev/graphic/fb0的区别
|
好像没什么区别,看看这段代码framebuffer/fb_test.c
static int get_framebuffer(GGLSurface *fb)
{
int fd;
void *bits;
fd = open("/dev/graphics/fb0", O_RDWR);
if (fd stride = fi.line_length / (vi.bits_per_pixel >> 3);
fb->data = bits;
fb->format = GGL_PIXEL_FORMAT_RGB_565;
fb++;
fb->version = sizeof(*fb);
fb->width = vi.xres;
fb->height = vi.yres;
fb->stride = fi.line_length / (vi.bits_per_pixel >> 3);
fb->data = (void*) (((unsigned) bits) + vi.yres * vi.xres * 2);
fb->format = GGL_PIXEL_FORMAT_RGB_565;
return fd;
}