# NNS_G3dRenderObjSetCallBack

## C Specification

      #include <nnsys/g3d/kernel.h>

      void
      NNS_G3dRenderObjSetCallBack(
      NNSG3dRenderObj* pRenderObj,
      NNSG3dSbcCallBackFunc func,
      u8* pCmd,
      u8 cmd,
      NNSG3dSbcCallBacktiming timing
      );

## Arguments

pRenderObj | Pointer to the `NNSG3dRenderObj` structure
func | Pointer to the callback function to register
pCmd | Pointer to the SBC command that calls the callback function. Currently, this command is not valid. However, it is included for compatibility with the arguments of previous versions.
cmd | SBC command that calls the callback function
timing | Timing of calling the callback function

## Return Values

None.

## Description

Registers the callback function that can cut in while the `NNS_G3dDraw` function is running. For the callback process, the callback function is executed at the timing in the command designated by `timing` when the SBC command designated by `cmd` is executed. `timing` can be chosen from the three types shown below, and is set for each SBC command. The timing can be selected from one of the following three types, and is configured for each SBC command: For details, see the reference materials for SBC and callbacks.

    typedef enum
    {
    NNS_G3D_SBC_CALLBACK_timing _A = 0x00,
    NNS_G3D_SBC_CALLBACK_timing _B = 0x01,
    NNS_G3D_SBC_CALLBACK_timing _C = 0x02
    }
    NNSG3dSbcCallBacktiming ;

The registered callback process can be deleted by using the `NNS_G3dRenderObjResetCallBack` function. When you want to register multiple callback functions, set the callback function using the `NNS_G3dRSSetCallBack` function in the function registered with the `NNS_G3dRenderObjSetInitFunc` function.

## See Also

`NNS_G3dRenderObjResetCallBack`, `NNS_G3dRenderObjSetUserPtr`, `NNSG3dSbcCallBackFunc`

## Revision History

10/15/2004 Revised description in accordance with changes to the method.
08/02/2004 Initial version.