# NNS_G2dGetNewOamManagerInstance

## Syntax

      #include <nnsys/g2d/g2d_Oam.h>

      BOOL NNS_G2dGetNewOamManagerInstance
      (
          NNSG2dOamManagerInstance*   pMan,
          u16                         fromOBJ,
          u16                         numOBJ,
          u16                         fromAffine,
          u16                         numAffine,
          NNSG2dOamType               type
      );

## Arguments

`pMan` | [OUT] OAM manager entity
`fromOBJ` | [IN] OAM management region-start index
`numOBJ` | [IN] Number of OAM attributes to use (must be a non-zero value)
`fromAffine` | [IN] Affine parameter management region-start index
`numAffine` | [IN] Number of affine parameters to use (zero is also valid)
`type` | [IN] OAM type

## Return Values

Success or failure.

## Description

Initializes the OAM Manager entity. This function must be called before making use of the OAM Manager itself.
The `NNS_G2dGetNewOamManagerInstanceAsFastTransferMode` function is also available. It initializes an OAM Manager capable of fast buffer transfers.
The definition of the enumerator `NNSG2dOamType` that shows the OAM type to manage is shown below.
``

    typedef enum NNSG2dOamType
    {
        NNS_G2D_OAMTYPE_MAIN = 0,               // OAM of the main 2D graphics engine
        NNS_G2D_OAMTYPE_SUB,                    // OAM of the sub 2D graphics engine
        NNS_G2D_OAMTYPE_SOFTWAREEMULATION,      // Emulation that uses the 3D Graphics Engine
        NNS_G2D_OAMTYPE_INVALID,                // Invalid type
        NNS_G2D_OAMTYPE_MAX

    }NNSG2dOamType;

When `NNS_G2D_OAMTYPE_SOFTWAREEMULATION` is specified, render processing is performed with software sprites by using the 3D graphics engine.
The `NNS_G2dGetNewOamManagerInstanceAsFastTransferMode` function combines the processes that used to be executed by calling the two prior functions `NNS_G2dGetNewManagerInstance` and `NNS_G2dInitManagerInstanceAffine`. To maintain compatibility these two other functions still exist, but you should make use of this new function for new applications.

## See Also

``NNS_G2dGetNewOamManagerInstanceAsFastTransferMode`
`NNS_G2dGetNewManagerInstance`
`NNS_G2dInitManagerInstanceAffine``

## Revision History

2004/08/02 Initial version.

CONFIDENTIAL