1. With Quake classic textures (256 shades of brown) or even Half-Life independent palette per texture, you can apply the gamma (and/or contrast) to the color table prior to upload. You cannot do this with a 24-bit image ... at least not reasonably as far as I know because such a table would be rather large (16 MB) and possibly slow/awkward to apply to replacement textures due to large size.
2. Hardware gamma. (Affects entire screen).
3. What modern DarkPlaces does with a shader.
Btw ... I have noticed in every engine that uses #2 (all of the OpenGL ones except DarkPlaces since it uses #3) ---- if I ALT-TAB out of fullscreen and then back into Quake, the hardware gamma correction resets a few seconds later to system defaults (ATI Radion Mobility) on both Windows and the Mac.
I'm trying devise a way to intercept this brightness change, as it irritates me. I've noticed it is associated with ChangeDisplaySettings.