把这个程序运行下字符终端下到分辨率就出来了。
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <math.h>
int w,h ,bpp;
int *fbmem;
int main(int argc , char *argv[])
{
int fd;
struct fb_var_screeninfo fb_var;
fd = open("/dev/fb0",O_RDWR);
//
//screen w , h , bpp
//get screen information
ioctl (fd,FBIOGET_VSCREENINFO,&fb_var);
w = fb_var.xres;
h = fb_var.yres;
bpp = fb_var.bits_per_pixel;
printf ("Framebuffer %d*%d-%dbpp\n",w,h,bpp);
//fbmem = Framebuffer address
fbmem = mmap (0,w*h*bpp/8,PROT_WRITE|PROT_READ,
MAP_SHARED,fd,0);
//y = 10,x = 200, color = 0xF800;
return 0;
}
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <math.h>
int w,h ,bpp;
int *fbmem;
int main(int argc , char *argv[])
{
int fd;
struct fb_var_screeninfo fb_var;
fd = open("/dev/fb0",O_RDWR);
//
//screen w , h , bpp
//get screen information
ioctl (fd,FBIOGET_VSCREENINFO,&fb_var);
w = fb_var.xres;
h = fb_var.yres;
bpp = fb_var.bits_per_pixel;
printf ("Framebuffer %d*%d-%dbpp\n",w,h,bpp);
//fbmem = Framebuffer address
fbmem = mmap (0,w*h*bpp/8,PROT_WRITE|PROT_READ,
MAP_SHARED,fd,0);
//y = 10,x = 200, color = 0xF800;
return 0;
}