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>Various Graphics Libraries</title>
100  </head>
101  <body>
102<h1>Various CTR Graphics Libraries</h1>
103<h2>Overview</h2>
104    <div class="section">
105      <p>
106CTR graphics are implemented by generating lists of GPU commands and using the lists to operate the GPU. (GPU commands are called <I>3D commands</I> and <I>command requests</I>.) The graphics libraries can be broadly grouped into those that control command lists and those that generate the commands to actually render images.
107</p>
108<p>
109Use the GX (<CODE>nngx</CODE>) library for low-level operations such as controlling command lists or display buffers. No matter what approach you use, you must use this library.</p>
110<p>
111When it comes to generating the 3D rendering commands, however, you can choose between the GL, GD, GR, and NW4C libraries. Alternately, applications can directly generate 3D commands.
112</p><p>
113The following sections describe each command generation method. This information will help you select the best method or combination of methods for your purposes.
114      </p>
115    </div>
116
117<h3> GL Library (DMPGL)</h3>
118    <div class="section">
119      <p>
120This is the CTR basic graphics library. This library offers a rich feature set, including OpenGL ES-compatible API functions, error handling, and state change management. This library entails a heavier processing load than the others, with a substantial CPU load. We recommend not using this library if performance is a concern.
121      </p>
122    </div>
123
124<h3>GD Library</h3>
125    <div class="section">
126      <p>
127This is a lightweight library compared to GL.<br />It provides the same functionality as the GL library, but the API is in a form that is easier for developers to handle. (Note that it is not compatible with GL.)<br /> A certain load on the CPU is required for purposes of internal processing.
128      </p>
129    </div>
130
131<h3>GR Library</h3>
132    <div class="section">
133      <p>
134This graphics library supports the direct generation of 3D commands. This library does not manage states internally, making it faster than the GL or GD libraries and also reducing the amount of memory required. Using it requires detailed knowledge of how to set each GPU register, however, as described in the System API Specifications. It is also more difficult to implement because users must handle error checks and other details.
135      </p>
136    </div>
137
138<h3>NW4C (NintendoWare for CTR)</h3>
139    <div class="section">
140      <p>
141The NW4C library, which serves as Nintendo's application development middleware, handles both graphics <I>and</I> sound. The NW4C graphics features generate internal commands rather than using other graphics libraries. This implementation means that it can be used on its own to achieve optimized performance. See the NintendoWare for CTR package and documentation for details.
142      </p>
143    </div>
144
145<h3>Directly Generating 3D Commands</h3>
146    <div class="section">
147      <p>
148You can directly generate the register write commands applied to the GPU. Generating only the required commands can boost operating speeds. This is the most difficult method to implement, however, because it requires detailed knowledge of how to set each GPU register. (Register settings are explained in the System API Specifications.) We therefore recommend using the GR library, which is implemented to support direct command generation.
149      </p>
150    </div>
151
152<h2>Revision History</h2>
153    <div class="section">
154      <dl class="history">
155        <dt>2011/02/15</dt>
156<dd>Revised text in line with the publication of the GD library.<br /></dd>
157        <dt>2010/09/28</dt>
158<dd>Initial version.<br /></dd>
159      </dl>
160    </div>
161  <hr><p>CONFIDENTIAL</p></body>
162</html>