This document is a collection of notes regarding the use of NintendoWare for CTR (henceforth called NW4C) together with DMPGL.
To improve the performance of NW4C, from version 0.7.0 there are commands directly generated without using DMPGL for interpretation by the GPU. For this reason, you must follow set procedures when using NW4C and DMPGL.
If you need more information about using DMPGL together with directly generated commands, see the following documentation:
If you need more information about the direct generation of commands, see the following documentation, which is included in the CTR-SDK:
glBindFramebuffer( GL_FRAMEBUFFER, renderTarget->GetBufferObject()
glClear(mask);
States are updated when DMPGL is called after the drawing of NW4C graphics, layouts and fonts.
Drawing graphics, layouts and fonts
nngxUpdateState(NN_GX_STATE_ALL);
Drawing with DMPGL
After DMPGL is called, the state is validated when drawing NW4C graphics, NW4C layouts or NW4C fonts.
nngxValidateState(NN_GX_STATE_ALL, false);
Drawing graphics, layouts and fonts
States are reset before drawing of graphics.
RenderContext::ResetState();
Drawing graphics
Before drawing a layout (or font), be sure to first set all parameters not set for layouts (or fonts), such as polygon culling and depth testing.
For details on how to set parameters not set for layouts (or fonts), see the Reference Manual entry for the nw::lyt::Drawer class. Also, see the layout demo sample for specific examples of making settings.
Culling polygon faces and depth test settings
Draw layout (or font)
while (true)
{
RenderContext::ResetState();
Drawing graphics
Culling polygon faces, depth test settings, and so on
Drawing layouts
}
while (true)
{
RenderContext::ResetState();
Drawing graphics
nngxUpdateState(NN_GX_STATE_ALL)
Drawing with DMPGL
}
while (true)
{
Culling polygon faces, depth test settings, and so on
Drawing layouts
RenderContext::ResetState();
Drawing graphics
}
while (true)
{
Culling polygon faces, depth test settings, and so on
Drawing layouts
nngxUpdateState(NN_GX_STATE_ALL);
Drawing with DMPGL
}
while (true)
{
nngxUpdateState(NN_GX_STATE_ALL);
Drawing with DMPGL
RenderContext::ResetState();
Drawing graphics
}
while (true)
{
nngxUpdateState(NN_GX_STATE_ALL);
Drawing with DMPGL
Culling polygon faces, depth test settings, and so on
Drawing layouts
}
CONFIDENTIAL