Function
Initialize the application
#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 )
- 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.
Enters the main loop.
#include <mgi/App.h>
void mgiAppMainLoop( void )
Enters the main loop. This loop does not end.
Adds a render job.
#include <mgi/App.h>
void mgiAppAddRenderJob( MgiJob *job_ptr )
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.
MgiJob
Inserts a render job in front of a job which has already been added.
#include <mgi/App.h>
void mgiAppInsertRenderJob( MgiJob *new_job_ptr, MgiJob *job_ptr )
Inserts a render job in front of a job which has already been added.
Cancels a render job.
#include <mgi/App.h>
void mgiAppRemoveRenderJob( MgiJob *job_ptr )
Cancels a render job.
Adds a frame job.
#include <mgi/App.h>
void mgiAppAddFrameJob( MgiJob *job_ptr )
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.
Inserts a frame job in front of a job which has already been added.
#include <mgi/App.h>
void mgiAppInsertFrameJob( MgiJob *new_job_ptr, MgiJob *job_ptr )
Inserts a frame job in front of a job which has already been added.
Cancels a frame job.
#include <mgi/App.h>
void mgiAppRemoveFrameJob( MgiJob *job_ptr )
Cancels a frame job.
This is the actual application itself.
#include <mgi/App.h>
MgiApp gMgiApp
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.
MgiApp
Adds an MgiCharacter job as a render job.
#include <mgi/App.h>
_mgiAppAddCharacter( char_ptr )
Adds an MgiCharacter job as a render job.
Returns a pointer to the scene hierarchy.
#include <mgi/App.h>
_mgiAppGetHierarchy( )
Returns a pointer to the scene hierarchy.
Returns a pointer to the scene.
#include <mgi/App.h>
_mgiAppGetScene( )
Returns a pointer to the scene.
#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;
MhcScene
MrnScene