| MIL 10 Reference
| Customize Help
| Save Settings

MgraAlloc



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Previous
Synopsis
Allocate a graphics context.
Syntax
MIL_ID MgraAlloc(
MIL_ID SysId, //in
MIL_ID *ContextGraIdPtr //out
)
Description

This function allocates a graphics context on the specified system. A graphics context is required to use MIL graphics to perform annotations. Whenever an annotation is done, graphics context settings are inherited by the graphics. Different contexts can coexist; use their identifier to specify which to use or change. When a graphics context is no longer required, you should release its memory, using MgraFree().

To modify or inquire graphics context settings, use MgraControl() and MgraInquire().

Note that, upon allocation of an application, a default graphics context is automatically allocated. Rather than using MgraAlloc() to allocate a graphics context, you can use this default graphics context, by specifying M_DEFAULT wherever a graphics context identifier is required. Note that there is a different default graphics context for each thread.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SysId INQ

Specifies the system on which to allocate the graphics context.

This parameter should be set to one of the following values:

function map For specifying the system
CollapseValue Description
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Collapse MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

ContextGraIdPtr

Specifies the address of the variable in which the graphics context identifier is to be written. Since the MgraAlloc() function also returns the buffer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.

Return value
The returned value is the graphics context identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT HOST