# MGL Library Overview

This document contains the reference manual for the SciTech MGL Graphics Library and associated supplemental libraries. Please consult the MGL Getting Started and Programmer’s Guide for more information on programming with the SciTech MGL.

All functions in the SciTech MGL work with an MGL device context (MGLDC), which can either be a specific device context passed to the function, or the currently active device context. All routines that take a specific MGLDC pointer, don’t work with the values in the currently active device context, which means that these routines can be used to update a different device context than the currently active one. However if the device context passed is actually the currently active context, all the changes made to the specific device context will also be made to the currently active context as well.

Most of the routines in SciTech MGL are bound to the currently active device context, which can be changed with the MGL_makeCurrentDC function. When a context is made the currently active context, the values in the device context are cached in a special global data area for speed. Hence you should not change the values in a device context directly if that context is currently active, but should use the proper MGL functions to do so. When the active device context is changed to a new device context, the values in the currently cached device context are then flushed back to the original device context.

Because there is a lot of copying going on when changing active device context, this is something that you would not normally do between drawing individual primitives. Normally you will have one main device context for all your drawing output (either a memory device context or a display device context) that you will be drawing into, and this context will generally not change. The SciTech MGL will however not perform any copying if you attempt to set the active device context to the same device context. You can also set the active device context to nothing, by passing a NULL to MGL_makeCurrentDC.

Related Sub-Topics

Environment detection and initialization

Device context creation and management

Device context information and manipulation

Color and palette manipulation

Viewport and clip rectangle manipulation

Double buffering support

Device clearing

Direct frame buffer access functions

Pixel plotting

Line drawing and clipping

Polyline and pixel drawing

Polygon drawing

Rectangle drawing

Ellipse drawing

Text attribute manipulation

Text drawing

Wide character text drawing

BitBlt support

Bitmap drawing support

Monochrome bitmap manipulation

Lightweight offscreen buffer support

Region management

Region algebra

RGB to 8/15/16 bit halftone dithering routines

Font loading and unloading functions

Obsolete bitmap font loading functions

Mouse cursor resource loading and unloading

Icon resource loading and unloading

Windows BMP bitmap loading, unloading and saving

PCX bitmap loading, unloading and saving

JPEG bitmap loading, unloading and saving

PNG bitmap loading, unloading and saving

Random number generation routines

Rectangle and Point manipulation

Window manager functions

OpenGL binding functions

Event handling

Mouse handling

Game Framework

Sprite Manager

Platform Specific: Windows

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