MGL_makeCurrentDC

Make a device context the current device context.

Declaration

MGLDC * MGLAPI MGL_makeCurrentDC(
    MGLDC *dc)

Prototype In

mgraph.h

Parameters

dc

New device context to make the current context

 

Return Value

Previous current device context (possibly NULL).

Description

This function makes the specified device context the current device context. The current device context is the one that is used for all the output rasterizing routines, and when a device context is made current, a copy of the device context is cached internally for maximum speed in the rasterizing code. While a device context is current, changes made to the global state of the current device context are changed in the cached copy only and are not updated in the original device context. When the device context is changed however, the values in the cached device context are flushed back to the original device context to keep it up to date. You can flush the current device context explicitly by passing a NULL for the new current device context.

Because of this caching mechanism, changing the current device context is an expensive operation, so you should try to minimize the need to change the current device context. Normally you will maintain a single device context that will be used for all rasterizing operations, and leave this as your current device context. If the device context specified is already the current device context, this function simply does nothing.

Note:    If the SciTech MGL has been initialised to support multiple display controllers, calling this function will ensure that the display device being accessed by the passed in device context is made the currently active display. If the display controllers can support 'mixed' mode, the secondary displays remain active at the same time as the primrary display and there is no overhead for the switch. Some older display controllers cannot support mixed mode as the VGA compatible resources cannot be disabled, and in this case every call to this function will cause the active display device to be switched.

See Also

MGL_isCurrentDC, MGL_initMultiMonitor

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com