pelya / xserver-xsdl

XSDL - X.Org server ported to Android using SDL.
https://play.google.com/store/apps/details?id=x.org.server
Other
311 stars 55 forks source link

How does the rendering process work? #175

Closed foryoung2018 closed 10 months ago

foryoung2018 commented 10 months ago

I want to delve deeper into the details of this project. I have a grasp of OpenGL and some X11 protocols, but I haven't really found comprehensive information about the rendering data transfer between SDL and X Server. Is the project utilizing the Put Image protocol or Android Shared Memory?

In theory, rendering pixels doesn't necessarily require the SDL library, and basic bitmap drawing should suffice. Is this due to the effectiveness of OpenGL or Android Shared Memory, especially for supporting some X programs?

I look forward to your response. Thank you.

pelya commented 10 months ago

SDL creates a screen buffer in memory. XSDL code copies from X screen buffer to SDL screen buffer each frame, then SDL copies it into OpenGL texture on each SDL_Flip.

Shared memory is for X apps to write directly to X screen buffer.

And XSDL does not support OpenGL for X apps, even though it uses GL ES internally.

On Mon, 15 Jan 2024, 05:56 foryoung2018, @.***> wrote:

I want to delve deeper into the details of this project. I have a grasp of OpenGL and some X11 protocols, but I haven't really found comprehensive information about the rendering data transfer between SDL and X Server. Is the project utilizing the Put Image protocol or Android Shared Memory?

In theory, rendering pixels doesn't necessarily require the SDL library, and basic bitmap drawing should suffice. Is this due to the effectiveness of OpenGL or Android Shared Memory, especially for supporting some X programs?

I look forward to your response. Thank you.

— Reply to this email directly, view it on GitHub https://github.com/pelya/xserver-xsdl/issues/175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABF5QEY2QBEIVF2S7IFLP3YOSSHPAVCNFSM6AAAAABB2UMIZ6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DCMRQGE3TOOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

foryoung2018 commented 10 months ago

Thanks, I cant locate the code about : "XSDL code copies from X screen buffer to SDL screen buffer each frame" Can you tell me?

foryoung2018 commented 10 months ago
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY,
                       stuff->width, stuff->height,
                       stuff->leftPad, stuff->format, tmpImage);

go to where?

pelya commented 10 months ago

https://github.com/pelya/xserver-xsdl/blob/xsdl2/hw/kdrive/sdl/sdl.c

sdlMapFramebuffer sets the X display buffer

sdlShadowUpdate does SDL_flip

On Mon, 15 Jan 2024, 09:24 foryoung2018, @.***> wrote:

(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, stuff->dstX, stuff->dstY, stuff->width, stuff->height, stuff->leftPad, stuff->format, tmpImage);

go to where?

— Reply to this email directly, view it on GitHub https://github.com/pelya/xserver-xsdl/issues/175#issuecomment-1891455808, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABF5QHY7BDU5SLUE24JEGTYOTKRTAVCNFSM6AAAAABB2UMIZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGQ2TKOBQHA . You are receiving this because you commented.Message ID: @.***>