Paint Pixels to Screen via Linux FrameBuffer

前端 未结 7 1785
谎友^
谎友^ 2020-12-01 00:56

I was recently struck by a curious idea to take input from /dev/urandom, convert relevant characters to random integers, and use those integers as the rgb/x-y values for pix

7条回答
  •  隐瞒了意图╮
    2020-12-01 01:36

    When I used this program to write full screen it had crashed that is due screen size calculation is wrong.

    // Figure out the size of the screen in bytes     
    screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
    

    This supposed to be:

    /* Calculate the size of the screen in bytes */   
    screensize = vinfo.xres_virtual * vinfo.yres_virtual * (vinfo.bits_per_pixel / 8);
    

提交回复
热议问题