Register
handmade.network»Wiki»Tutorial/A tour through Xlib and related technologies
#21930 alfred Dec. 1, 2019, 9:08 p.m.

In Part 0 for window attributes you define a colormap like this

1
windowAttr.colormap = XCreateColormap(display, root, visinfo.visual, AllocNone);

What is the point of this colormap? From Xlib documentation in chapter 6 it explains colormap as "Each X window has an associated colormap that provides a level of indirection between pixel values and colors displayed on the screen." But in this tutorial this indirection is never used, all colors are added by directly writing to a memory buffer. So can this attribute be set to NULL or does it have some other use?