nw::lyt::Drawer Class

Syntax

class Drawer : public nw::font::RectDrawer

Description

High-speed drawing class.

This class draws layouts at high-speed.

Use this class in place of Layout::Draw().

  nwlyt::Drawer drawer(graphicsResource);

pLayout->Animate();
pLayout->CalculateMtx(drawInfo);

// GL setting made by the user.
InitGX();

drawer.DrawBegin(drawInfo);
drawer.Draw(pLayout, drawInfo);
drawer.DrawEnd(drawInfo);

// Restores the coherency of the DMPGL state.
nngxUpdateState(NN_GX_STATE_ALL);

The GL settings below are left up to the user (are not set by the lyt library).

・Culling
・Scissoring
・Stencil test
・Masking
・Polygon offset
・Depth test
・Early depth test
・Frame buffer object

For details on how to make these settings, check the simple demo source code. (The setting method is complicated because Drawer does not use standard GL functions.)

When the drawing function Drawer is executed, integrity of the DMPGL state is lost.

After using Drawer, be sure to call the nngxUpdateState function before using GL functions.

Member Functions

Constructors and Destructors
Drawer Constructor.
Initialization / Post-processing
Initialize Performs initialization.
V Finalize Releases, or finalizes.
Rendering
DrawBegin Starts drawing.
Draw Draws the layout.
DrawEnd Ends drawing.
Other
FlushBuffer Writes out the buffer contents.
SetProjectionMtx Sets the projection matrix.(Inherited from RectDrawer.
SetViewMtxForText Sets the view matrix for the text.(Inherited from RectDrawer.
SetParallax Sets the parallax parameters.(Inherited from RectDrawer.
BuildTextCommand Creates drawing commands the text.(Inherited from RectDrawer.
S GetVertexBufferCommandBufferSize Gets the size of the vertex buffer or command buffer required by RectDrawer.(Inherited from RectDrawer.
S GetVertexBufferData Gets data in the vertex buffer for use by RectDrawer.(Inherited from RectDrawer.
S GetVertexBufferSize Gets the size of the vertex buffer required by RectDrawer.(Inherited from RectDrawer.
S GetCommandBufferSize Gets the size of the stream buffer required by RectDrawer.(Inherited from RectDrawer.

Class Hierarchy

nw::font::RectDrawer
  nw::lyt::Drawer

Revision History

2010/09/24
Eliminated the need to call nngxUpdateState() after Drawer initialization.
2010/05/14
Initial version. Replaced the DrawManager function.

CONFIDENTIAL