[comp.windows.x] What is the correct way to allocate a GC in an server extension?

keith@expo.lcs.mit.EDU (Keith Packard) (04/26/91)

> I do not seem to get the ops field initialized if I call
> CreateScratchGC.

The ops field should contain a legitimate pointer on return from
CreateScratchGC, but you must check the serial number of the GC vs the Drawable
- when they don't match, call ValidateGC to set ops correctly for any
rendering.  Otherwise you'll end up using the wrong rendering functions.  Check
out other uses of CreateScratchGC (the screen saver code and much of the mi
code are good examples).

jason@tfs.COM (Jason P. Venner) (04/26/91)

I do not seem to get the ops field initialized if I call
CreateScratchGC.

Jason