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