| Home
| Previous
| Next
| Up

MGL_createWindowedDC

Create a new windowed device context.

Declaration

MGLDC * MGLAPI MGL_createWindowedDC(
MGL_HWND hwnd)

Prototype In

mglwin.h

Parameters

hwnd | Window handle with which to associate new device context

Return Value

Pointer to the allocated windowed device context, or NULL if not enough memory.

Description

Creates a new windowed device context for drawing information into a window on the Windows desktop. When you create a Windowed device context, you associate it with a standard Windows HWND for the window that you wish MGL to display it's output on. Windowed device contexts are special device contexts in that you cannot directly access the surface for the device, nor can you actually use the MGL rasterizing functions to draw on the device surface. The only rasterizing functions supported are the MGL_bitBlt and MGL_stretchBlt for blt'ing data from memory device contexts to the window on the desktop.

However in order to change the color palette values for the data copied to the window, you must use the MGL palette functions on the windowed display device context. Note that MGL automatically takes care of creating a proper Windows identity palette for the windowed device context, so as long as you program the same palette values for the windowed device and the memory device you should get the maximum performance blt'ing speed.

See Also

MGL_createMemoryDC, MGL_createDisplayDC, MGL_destroyDC, MGL_setWinDC, MGL_activatePalette

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