Supported Browsers Home   
MGL_createMemoryDC Previous   
MGL_createScrollingDC Next   
External Functions Up   

MGL_createOffscreenDC

Creates a new offscreen display device context.

Declaration

MGLDC * MGLAPI MGL_createOffscreenDC(
    MGLDC *dc,
    int width,
    int height)

Prototype In

mgraph.h

Parameters

dc

MGL display or windowed device context to create offscreen DC from

width

Width of the offscreen device context to create

height

Height of the offscreen device context to create

 

Return Value

Pointer to the newly created offscreen device context, NULL if not valid.

Description

Creates a new offscreen display device context for rendering to offscreen video memory when running in hardware accelerated video modes. You must have already created a valid display device context before this function is called, otherwise this function will return NULL. Also if the display device does not support hardware accelerated offscreen display memory, this function will also return NULL. Finally if there is no more available offscreen display memory to fullfill the request, this function will fail. See the MGL_result error code for more information if the function failed.

An offscreen device context can be used just like any other MGL device context, so you can copy data around with MGL_bitBlt, or draw on the device context using any of the MGL rendering functions. If you simply want to store bitmaps in offscreen memory for fast blitting, you should instead create the bitmaps as MGL buffers with the MGL_createBuffer function. MGL buffers are similar to offscreen device contexts, except they can only be used for blitting and cannot be used as a rendering target. MGL buffers also use a lot less system memory resources than a full offscreen DC.

See Also

MGL_createMemoryDC, MGL_createScrollingDisplayDC, MGL_createStereoDisplayDC, MGL_createDisplayDC, MGL_destroyDC, MGL_createBuffer

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