by mh » Thu Nov 08, 2012 6:09 pm
Software mode Q1 and Q2 can use DirectDraw surfaces for their backbuffers. With DirectDraw support falling off, this is useful functionality to have, but at the same time both engines also had a GDI surfaces option which was also adequately fast.
It needs to be noted that in both cases neither engine used DirectDraw or GDI in the traditional manner. Instead they would create one surface at startup, and a typical frame would consist of Locking the surface, then running the absolutely standard software rendering codepath, writing to the surface memory instead of to system memory. That avoids the performance problems normally associated with using GDI, but may cause performance problems with DirectDraw if anything needs to read from Locked surface memory.
For Q1 and Q2, particularly as we have the source code for both, it would be of greater benefit to just port the DirectDraw code to D3D8 or 9, both of which encompass the DirectDraw functionality required, in addition to more standard 3D rendering. So the code would create a D3D8 or 9 device with a lockable backbuffer, Lock that and write to it instead.
For other games where we don't have source code and where they use DirectDraw, something like this is appropriate. I would have personally implemented it on D3D9 rather than GL2 though, for more robust driver support.