Function


mgiAppInit

Initialize the application

Syntax

#include <mgi/App.h>
void mgiAppInit(   const u32 frame_latency,
                   const u32 gfx_length,
                   const u32 frame_resource_size,
                   const u32 instance_queue_size,
                   const u32 max_modules,
                   const u32 transform_buffer_size,
                   void *user_data )

Arguments

frame_latency
frame_latency is determined by NuSystem.
Double buffer: frame_latency = 2
Triple buffer: frame_latency = 3
gfx_length
gfx_length is the size of the gfx buffer, and the actual capacity of the gfx buffer is
frame_latency * gfx_length * sizeof( Gfx ).
frame_resource_size
frame_resource_size sets the frame resource capacity of the scene.
Frame resource is the temporary storage area used for rendering each frame, and is discarded when frame rendering is completed. For example, it is suitable for recording Mtx and dynamical Vtx.
instance_queue_size
instance_queue_size sets the maximum number of queues necessary during hierarchy evaluation.
max_modules
max_modules sets the maximum number of modules used by the application.
transform_buffer_size
transform_buffer_size sets the maximum capacity of the coordinate conversion buffer needed during hierarchy evaluation.

Description


mgiAppMainLoop

Enters the main loop.

Syntax

#include <mgi/App.h>
void mgiAppMainLoop( void )

Description

Enters the main loop. This loop does not end.

mgiAppAddRenderJob

Adds a render job.

Syntax

#include <mgi/App.h>
void mgiAppAddRenderJob( MgiJob *job_ptr )

Description

Adds a render job.
A render job only executes the frame after rendering has been completed.
Render jobs are executed in the order that they were added.

See Also

MgiJob

mgiAppInsertRenderJob

Inserts a render job in front of a job which has already been added.

Syntax

#include <mgi/App.h>
void mgiAppInsertRenderJob( MgiJob *new_job_ptr, MgiJob *job_ptr )

Description

Inserts a render job in front of a job which has already been added.

mgiAppRemoveRenderJob

Cancels a render job.

Syntax

#include <mgi/App.h>
void mgiAppRemoveRenderJob( MgiJob *job_ptr )

Description

Cancels a render job.

mgiAppAddFrameJob

Adds a frame job.

Syntax

#include <mgi/App.h>
void mgiAppAddFrameJob( MgiJob *job_ptr )

Description

Adds a frame job. A frame job executes each frame even if rendering is not completed. Frame jobs are executed in the order that they were added.

mgiAppInsertFrameJob

Inserts a frame job in front of a job which has already been added.

Syntax

#include <mgi/App.h>
void mgiAppInsertFrameJob( MgiJob *new_job_ptr, MgiJob *job_ptr )

Description

Inserts a frame job in front of a job which has already been added.

mgiAppRemoveFrameJob

Cancels a frame job.

Syntax

#include <mgi/App.h>
void mgiAppRemoveFrameJob( MgiJob *job_ptr )

Description

Cancels a frame job.

Global Variables



gMgiApp

This is the actual application itself.

Syntax

#include <mgi/App.h>
MgiApp gMgiApp

Description

This is the actual application itself.
A pointer to MgiApp is not specified in the argument of mgpApp*() because
all functions access this global variable.

See Also

MgiApp

Macros



_mgiAppAddCharacter

Adds an MgiCharacter job as a render job.

Syntax

#include <mgi/App.h>
_mgiAppAddCharacter( char_ptr )

Description

Adds an MgiCharacter job as a render job.

_mgiAppGetHierarchy

Returns a pointer to the scene hierarchy.

Syntax

#include <mgi/App.h>
_mgiAppGetHierarchy( )

Description

Returns a pointer to the scene hierarchy.

_mgiAppGetScene

Returns a pointer to the scene.

Syntax

#include <mgi/App.h>
_mgiAppGetScene( )

Description

Returns a pointer to the scene.

Structure



MgiApp


#include <mgi/App.h>
typedef struct _MgiApp
{
    MgiJobList          frame_job_list;
    MgiJobList          render_job_list;

    MhcScene            hierarchy;
    MrnScene            render_scene;
    MrnScreen           screen;

    u32                 gfx_length;
    Gfx                 **gfx_array;
    u32                 current_gfx;
    Gfx                 *current_gfx_ptr;

    u32                 is_perfbar_enable;
    u32                 render_microcode;

    u32                 frame_latency;
    u32                 frame_count;
    u32                 frame_rate;

    int                 number_of_controllers;
    u16                 *last_button;
    struct st_ContData  *cont_data;

    void                *user_data;
} MgiApp;

See Also

MhcScene MrnScene