gpt4 book ai didi

c++ - 如何直接写入linux framebuffer?

转载 作者:IT王子 更新时间:2023-10-29 00:23:42 37 4
gpt4 key购买 nike

如何直接写入linux framebuffer?

最佳答案

查看 FBIOPUT_VSCREENINFO、ioctl 和 mmap

(我有代码但不在这台电脑上,抱歉)

编辑:这应该让你开始

  //open file descriptor and get info
inf fdScreen = open( "devicename", O_RDWR );
fb_var_screeninfo varInfo;
ioctl( fdScreen, FBIOGET_VSCREENINFO, &varInfo );

//set resolution/dpi/color depth/.. in varInfo, then write it back
ioctl( fdScreen, FBIOPUT_VSCREENINFO, &varInfo );

//get writable screen memory; unsigned short here for 16bit color
unsigned short* display = mmap( 0, nScreenSize,
PROT_READ | PROT_WRITE, MAP_SHARED, fdScreen, 0 );

关于c++ - 如何直接写入linux framebuffer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1527039/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com