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 <!-- 9 span.static_style 10 { 11 font-size : 8pt; 12 color : white; 13 font-weight : bold; 14 background : #44f; 15 border-left : solid 1px #aaf; 16 border-top : solid 1px #aaf; 17 border-right : solid 1px #00c; 18 border-bottom : solid 1px #00c; 19 padding-left : 2px; 20 padding-right : 2px; 21 } 22 23 span.virtual_style 24 { 25 font-size : 8pt; 26 color : white; 27 font-weight : bold; 28 background : #0a0; 29 border-left : solid 1px #0f0; 30 border-top : solid 1px #0f0; 31 border-right : solid 1px #060; 32 border-bottom : solid 1px #060; 33 padding-left : 2px; 34 padding-right : 2px; 35 } 36 37 span.protected_style 38 { 39 font-size : 8pt; 40 color : white; 41 font-weight : bold; 42 background : #444; 43 border-left : solid 1px #ccc; 44 border-top : solid 1px #ccc; 45 border-right : solid 1px #222; 46 border-bottom : solid 1px #222; 47 padding-left : 2px; 48 padding-right : 2px; 49 } 50 table.table, table.table td, table.table th 51 { 52 border-collapse: collapse; 53 background-color: white; 54 } 55 56 table.table 57 { 58 width: auto; 59 margin: 1em; 60 position : static; 61 font-family : Arial; 62 } 63 64 table.table td, table.table th 65 { 66 padding: 0.2em; 67 } 68 69 table.table td.number, table.table th.number 70 { 71 text-align: right; 72 } 73 74 table.table tbody tr th 75 { 76 text-align: left; 77 font-weight: normal; 78 width: auto; 79 } 80 81 table.table thead tr th, 82 table.table tbody tr th.category 83 { 84 padding: 0 0.2em; 85 } 86 87 table.table caption 88 { 89 font-weight: bold; 90 padding: 0.4em; 91 } 92 table.table th 93 { 94 font-weight : bold; 95 background : #acf; 96 } 97 --> 98 </style> 99 <title>Restoring GPU Register Settings</title> 100 </head> 101 <body> 102 <h1>Restoring GPU Register Settings</h1> 103 <h2>Overview</h2> 104 <div class="section"> 105 <p> 106You need to restore the state of GPU register settings, or reset them, immediately after returning from the HOME Menu or an applet, or when switching from one graphics library to another. 107 </p> 108 <p> 109This is because the GPU register settings that the library assumes and the actual state of the settings differ when there is a library that generates commands based on the difference from when it was previously generated, such as the GL library. 110 </p> 111 </div> 112 113 <h3>Returning to the Application from an Applet (including the HOME Menu)</h3> 114 <div class="section"> 115 <p> 116When rendering by switching between multiple graphics libraries as discussed below, after returning, conform to the method of the library that was used first. 117 </p> 118 <h4>When the Application uses GL</h4> 119 <div class="section"> 120 <p> 121By calling the <CODE><a href="../nn_gx/nngxUpdateState.html">nngxUpdateState</a> (NN_GX_STATE_ALL)</CODE> function, when the next <CODE>Draw</CODE> is executed, all commands will be generated. 122 </p> 123 <p> 124Then, by calling the <a href="../nn_gx/nngxValidateState.html"><CODE>nngxValidateState</CODE></a> function, you can generate all functions then and there, but unless they are bound to a command list and <font color="red">program objects are set</font> (see Note), caution is needed as an error code will be generated. <B>Note:</B> Introduced from CTR-SDK 4.2 onward. 125 </p> 126 </div> 127 <h4>When the Application uses GD</h4> 128 <div class="section"> 129 <p> 130By calling the <CODE><a href="../nn/gd/CTR/System/ForceDirty.html">nn::gd::System::ForceDirty</a> (nn::gd::MODULE_ALL)</CODE> function, when the next <CODE>Draw</CODE> is executed, all commands will be generated. 131 </p> 132 </div> 133 134 <h4>When the Application uses GR</h4> 135 <div class="section"> 136 <p> 137Since settings information is not maintained within the GR library, there is no API to restore the settings.<br /> When performing the next render, call the function needed to generate all the needed commands. <br /> 138 Or, use a command buffer that includes all the needed commands. </p> 139 </div> 140 141 <h4>Using Application-Specific Libraries</h4> 142 <div class="section"> 143 <p> 144Reset all necessary registers for the first render after returning. <br /> 145 If that library does not maintain settings information internally, handle it as indicated for the GR library. </p> 146 </div> 147 </div> 148 149 <h3>When Switching from Another Graphics Library to the Library Used</h3> 150 <div class="section"> 151 <p> 152Switching among multiple graphic libraries is like when you are rendering one frame. <br /> 153 Other graphic libraries include the CTR Face Library. </p> 154 <p> 155It is possible to handle it in basically the same way as when returning from an applet. <br /> 156 The volume of commands for register restoration increases with frequent switching of libraries, so try to keep the number of switches to a minimum. </p> 157 </div> 158 159 <h3>Other Information</h3> 160 <div class="section"> 161 <p> 162From CTR-SDK 4.2 on, the <CODE>nngxGetInitializationCommand</CODE> function, which can get initialization commands generated by the <CODE>nngxInitialize</CODE> function, has been made public. 163 </p> 164 <p> 165When there is an issue with rendering not working correctly when returning from an applet, confirm whether the behavior changes when initialization commands are executed after the return. 166 </p> 167 </div> 168 169 <h2>Revision History</h2> 170 <div class="section"> 171 <dl class="history"> 172 <dt>2012/05/28</dt> 173 <dd>Initial version. <br /> </dd> 174 </dl> 175 </div> 176 <hr><p>CONFIDENTIAL</p></body> 177</html>