Closed zschroeder6212 closed 3 years ago
Thanks but this breaks the tests: python3 vfb.py
The problem is the 1 bit color:
# fbset -g 640 480 640 480 1
# ./framebuffer-vncserver
Initializing framebuffer device /dev/fb0...
Floating point exception (core dumped)
bits_per_pixel / 8 = 0
fb_xres = fix_scrinfo.line_length / (var_scrinfo.bits_per_pixel / 8);
That should fix it.
Sorry, that still only works on 32 bit color.
That works.
Thanks.
The current implementation uses the screen resolution retrieved from the fb_var_screeninfo struct which doesn't always match the width of the frame buffer. I fixed the issue by calculating the width of the frame buffer using the line length, which is more accurate.
Before: After: