Function
Initializes the application.
#include <mgk/App.h>
void mgkAppInit( const u32 frame_latency,
const u32 gfx_length,
const u32 frame_resource_size,
const u32 instance_queue_size,
const u32 transform_buffer_size,
const u32 max_objs,
MgkObj *obj_array,
void *user_data )
- frame_latency
- frame_latency is decided, depending upon NuSystem
When Double buffer, frame_latency = 2
When Triple buffer, frame_latency = 3
- gfx_length
- gfx_length is the size of gfx buffer, and the actual volume of gfx buffer is
frame_latency * gfx_length * sizeof( Gfx )
- frame_resource_size
- frame_resource_size sets the capacity of frame resource in scene
Frame resource is a temporary storage area for rendering each frame, which will
be destroyed everytime frame rendering completes. It is good for Mtx or dynamic
Vtx.
- instance_queue_size
- instance_queue_size sets maximum number of queue needed for hierarchy evaluation
- max_obj
- max_obj sets maximum number of objects that the application uses
- transform_buffer_size
- transform_buffer_size sets maximum size of buffer needed for coordinate conversion
for hierarchy evaluation
Initializes the application.
MgkObj
Initialized rendering groups
#include <mgk/App.h>
void mgkAppInitGroups( void )
Initialized rendering groups
Evaluates the hierarchy structure
#include <mgk/App.h>
void mgkAppEvalAll( void )
Evaluates the hierarchy structure
Generates Gfx
#include <mgk/App.h>
Gfx *mgkAppDraw( void )
Generates Gfx
The application instance.
#include <mgk/App.h>
MgkApp gMgkApp
The application instance.
Pointer to MgkApp has not been added to the arguments of mgpApp*( )
because every function has access to this global variable.
MgkApp
Returns pointer to hierarchy of Scene
#include <mgk/App.h>
_mgkAppGetHierarchy( )
Returns pointer to hierarchy of Scene
Returns pointer to Scene
#include <mgk/App.h>
_mgkAppGetScene( )
Returns pointer to Scene
Returns pointer to Screen
#include <mgk/App.h>
_mgkAppGetScreen( )
Returns pointer to Screen
Declares beginning of a frame.
#include <mgk/App.h>
_mgkAppBeginFrame( )
Declares beginning of a frame.
Evaluating hierarchy and generating Gfx are performed between
BeginFrame() and EndFrame(). Conversely, switching screen modes
must not be done between those two functions.
Declares end of a frame.
#include <mgk/App.h>
_mgkAppEndFrame( )
Declares end of a frame.
Returns frame count
#include <mgk/App.h>
_mgkAppGetFrameCount( )
Returns frame count
typedef struct _MgkApp
{
u32 number_of_objs;
struct _MgkObj *obj_array;
struct _MgkObj *active_camera_ptr;
void *user_data;
} MgkApp;
MgkObj