the correct way to do is use XPutPixel(). color these days if pretty easy color=0/r/g/b
You need a lookuptable for 256 colors (=st2d_8to24table[i] ?) and that should it be. re, wh ________________________________________ Von: xorg <xorg-boun...@lists.x.org> im Auftrag von Sleep <ireallyhates...@yandex.com> Gesendet: Dienstag, 2. Juni 2020 08:28:13 An: xorg@lists.x.org Betreff: Implementing PseudoColor support on TrueColor screens Is there any documentation, article or book on how to convert the colors displayed by a program that was originally written to work on 8 bit screens? The problem I am facing seems to be related to how pixels are represented in the 'data' member of the XImage structure, which results in a squashed image and colors being displayed incorrectly. The only reference I have are two functions in the Quake source code: xlib_rgb24()[1] and st3_fixup()[2], which are used to convert the colors (but I cannot comprehend them because the format is unknown to me), but I found nothing that could make the image fill the window[3] properly. I could use SDL to easily get around this issue but I specifically want to use Xlib. I appreciate any help to learn. [1] <https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/WinQuake/vid_x.c#L156> [2] <https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/WinQuake/vid_x.c#L219> [3] https://postimg.cc/MfRz0Dk7 [4] https://i.postimg.cc/brVdhC3B/doom.png _______________________________________________ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: https://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s _______________________________________________ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: https://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s