1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 22 span.virtual_style 23 { 24 font-size : 8pt; 25 color : white; 26 font-weight : bold; 27 background : #0a0; 28 border-left : solid 1px #0f0; 29 border-top : solid 1px #0f0; 30 border-right : solid 1px #060; 31 border-bottom : solid 1px #060; 32 padding-left : 2px; 33 padding-right : 2px; 34 } 35 36 span.protected_style 37 { 38 font-size : 8pt; 39 color : white; 40 font-weight : bold; 41 background : #444; 42 border-left : solid 1px #ccc; 43 border-top : solid 1px #ccc; 44 border-right : solid 1px #222; 45 border-bottom : solid 1px #222; 46 padding-left : 2px; 47 padding-right : 2px; 48 } 49 --></style> 50 <title>nn::gr::CTR::CommandBufferJumpHelper</title> 51 </head> 52 <body> 53 <h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/gr/Overview.html">gr</a>::<a href="../../../../nn/gr/CTR/Overview.html">CTR</a>::CommandBufferJumpHelper</CODE> Class</h1> 54 <h2>Syntax</h2> 55 <div class="section"> 56 <pre class="definition">class CommandBufferJumpHelper</pre> 57 </div> 58 <h2>Description</h2> 59 <div class="section"> 60 <p>This class aids in the generation of a series of commands to jump to a different command buffer and then return to the original command buffer.</p><p> 61 The <CODE>CommandBufferJumpHelper</CODE> class aids in the creation of a series of commands to allow command buffer jumping by using the GR library. 62 </p><p> 63 Before you make the command buffer into a subroutine, add a channel 1 kick command at the end of the buffer.<br /> The following pseudocode demonstrates how to use this class. 64<pre> 65void Draw() 66{ 67 bit32* command; 68 nngxGetCmdlistParameteri( NN_GX_CMDLIST_CURRENT_BUFADDR, reinterpret_cast<GLint*>( &command ) ); 69 70 // Specify the start address of the command buffer. 71 nn::gr::CommandBufferJumpHelper cbjh(command); 72 73 // Add the render command (example). 74 nn::gr::Texture texture; 75 texture.unit0.texType = PICA_DATA_TEXTURE0_SAMPLER_TYPE_TEXTURE_2D; 76 ... // Parameter settings for other textures. 77 78 // Generate commands with the nn::gr::Texture class, and then reset the address. 79 cbjh.Put( texture.MakeCommand(cbjh.GetCurrentPtr())); 80 81 // Add the command to jump to the subroutine. 82 /* 83 Specify subAddr as the start address of the command buffer to make into a subroutine, and subSize as the size of that buffer. 84 The addition of the kick command, adjustment of the command buffer size, and similar tasks are all performed in the <CODE>Jump</CODE> function. 85 */ 86 cbjh.Jump(subAddr, subSize); 87 88 ... // Add the render command. 89 90 // Before adding the segmentation command, synchronize the pointer to the write destination of the command buffer. 91 nngxMoveCommandbufferPointer( cbjh.GetSize() ); 92 93 // Add the segmentation command. 94 /* 95 Because this class maintains the command buffer size from the start of the command buffer to the first jump, 96 it should be fine to specify that value. 97 */ 98 nngxFlush3DCommandPartially( cbjh.GetSizeToFirstJump() ); 99 100 // Writes the buffer size from the first jump command to the segmentation command. 101 nngxGetCmdlistParameteri( NN_GX_CMDLIST_CURRENT_BUFADDR, reinterpret_cast<GLint*>( &command ) ); 102 cbjh.FinalizeJump(command); 103} 104</pre></p></div> 105 <a name="function" id="function"> 106 <h2>Member Functions</h2> 107 <div class="section"> 108 <table class="members"> 109 <tr> 110 <td width="100"> </td> 111 <th> 112 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/CommandBufferJumpHelper.html"><CODE>CommandBufferJumpHelper</CODE></a> 113 </th> 114 <td>Constructor.</td> 115 </tr> 116 <tr> 117 <td width="100"> </td> 118 <th> 119 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/~CommandBufferJumpHelper.html"><CODE>~CommandBufferJumpHelper</CODE></a> 120 </th> 121 <td>Destructor.</td> 122 </tr> 123 <tr> 124 <td width="100"> </td> 125 <th> 126 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/GetSize.html"><CODE>GetSize</CODE></a> 127 </th> 128 <td>Gets the size of the created command.</td> 129 </tr> 130 <tr> 131 <td width="100"> </td> 132 <th> 133 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/GetSizeToFirstJump.html"><CODE>GetSizeToFirstJump</CODE></a> 134 </th> 135 <td>Gets the size from the start of the command buffer to the first jump command.</td> 136 </tr> 137 <tr> 138 <td width="100"> </td> 139 <th> 140 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/GetStartPtr.html"><CODE>GetStartPtr</CODE></a> 141 </th> 142 <td>Gets the starting address of the command buffer.</td> 143 </tr> 144 <tr> 145 <td width="100"> </td> 146 <th> 147 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/GetCurrentPtr.html"><CODE>GetCurrentPtr</CODE></a> 148 </th> 149 <td>Gets the address of the write destination of the next command.</td> 150 </tr> 151 <tr> 152 <td width="100"> </td> 153 <th> 154 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/Put.html"><CODE>Put</CODE></a> 155 </th> 156 <td>Sets the address of the write destination of the next command in the specified address.</td> 157 </tr> 158 <tr> 159 <td width="100"> </td> 160 <th> 161 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/CopyFrom.html"><CODE>CopyFrom</CODE></a> 162 </th> 163 <td>Copies and writes the command in the specified range.</td> 164 </tr> 165 <tr> 166 <td width="100"> </td> 167 <th> 168 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/Jump.html"><CODE>Jump</CODE></a> 169 </th> 170 <td>Generates a series of commands to jump to a different command buffer.</td> 171 </tr> 172 <tr> 173 <td width="100"> </td> 174 <th> 175 <a href="../../../../nn/gr/CTR/CommandBufferJumpHelper/FinalizeJump.html"><CODE>FinalizeJump</CODE></a> 176 </th> 177 <td>Completes the process of jumping to a command buffer by using the <CODE>Jump</CODE> function.</td> 178 </tr> </table> 179 </div> 180 </a> 181 <h2>See Also</h2> 182 <div class="section"> 183 <p class="reference"><a href="../../../../nn/gr/CTR/AddDummyDataForCommandBuffer.html"><CODE>nn::gr::CTR::AddDummyDataForCommandBuffer</CODE></a><br /> </p> 184 </div> 185 <h2>Revision History</h2> 186 <div class="section"> 187 <dl class="history"> 188 <dt>2012/06/26</dt> 189 <dd>Initial version.<br /> 190 </dd> 191 </dl> 192 </div> 193 <hr><p>CONFIDENTIAL</p></body> 194</html>