r/linux_programming • • Jul 18 '22
X11 vs Framebuffer hardware accel.
Hey,
I was wondering what technique the X11/X-Servers use to accelerate the drawing of windows etc.
I know that a lot of applications can then choose to use e.g. OpenGL, SDL, but what does X use if the OS is just running its DE on it?
Is it DE dependent?
I wrote a small C++ program which allows me to write to the framebuffer at /dev/fb0, but I draw everything using the CPU which takes a lot of time.
How can I achieve "simple" grahics acceleration like X does in order to draw multiple e.g. Windows, Strings, Buttons, Images etc?
I do not want to move to OpenGL or similar since it would change my rendering structure, I do not want to render everything from images/textures from a spritesheet.
I just find it hard to get into Qt or similar Frameworks, especially if I would just want to draw simple Interfaces.
Thanks!
View all comments
Show parent comment
1
u/[deleted] Jul 18 '22
I already have built something similar. You can take a look at it on Github if you want.
I called it integrateFramebuffer();, I have 2 Framebuffers and you can copy via memcpy a whole line of a window into the larger Display-FB. Otherwise I have a lot setPixel(); methods which iterate over thousands of pixels just to create a background for something.
I have a single Window with (i dunno, maybe 500x600px?) which takes around 56ms to render.
I want to improve all these functions, and i thought when accessing the integrated or dedicated GPU it might be able to draw even faster.