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    <title>CreateTexture2DResource</title>
8  </head>
9  <body>
10    <h1><CODE>nn::gd::CTR::Resource::CreateTexture2DResource</CODE> Member Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14static <a href="../../../../nnResult/Overview.html">nnResult</a> CreateTexture2DResource(
15     const <a href="../../../../nn/gd/CTR/Texture2DResourceDescription/Overview.html">Texture2DResourceDescription</a> * description,
16     const void * initialData,
17     <span>gdBool</span> autoGenerateMipMapsFromData,
18     Texture2DResource ** texture2DResource
19);
20</pre>
21    </div>
22    <h2>Arguments</h2>
23    <div class="section">
24      <table class="arguments">
25        <thead>
26          <tr>
27            <td width="15" />
28            <th>Name</th>
29            <td>Description</td>
30          </tr>
31        </thead>
32        <tr>
33          <td>in</td>
34          <th>description</th>
35          <td>Specifies the descriptor for creating a 2D texture resource.</td>
36        </tr>
37        <tr>
38          <td>in</td>
39          <th>initialData</th>
40          <td>Specifies the initialization data for the texture resource. Specify <CODE>NULL </CODE> if there is no initialization data. If there is mipmap data, all of the levels need to be specified, so set <B>autoGenerateMipMapsFromData</B> to GD_FALSE.  If you are using automatically created mipmaps, specify only the top level of mipmap data.  The initialization data must be created in LAYOUT_BLOCK_8 mode. (<CODE><a href="../../../../nn/gd/CTR/Resource/Helper/ConvertTextureResourceToNativeFormat.html">Helper::ConvertTextureResourceToNativeFormat</a></CODE> or<CODE><a href="../../../../nn/gd/CTR/Resource/Helper/ConvertCompressedTextureResourceToNativeFormat.html">Helper::ConvertCompressedTextureResourceToNativeFormat</a></CODE>) <br /></td>
41        </tr>
42        <tr>
43          <td>in</td>
44          <th>autoGenerateMipMapsFromData</th>
45          <td>Specify to enable/disable automatic creation of mipmaps.</td>
46        </tr>
47        <tr>
48          <td>out</td>
49          <th>texture2DResource</th>
50          <td>Specifies the address storing the created 2D texture resource.</td>
51        </tr> </table>
52    </div>
53    <h2>Return Values</h2>
54    <div class="section">Returns the result of the operation. <br />
55      <table class="arguments">
56        <thead>
57          <tr>
58            <th>Value</th>
59            <td>Description</td>
60          </tr>
61        </thead>
62        <tr>
63          <th><CODE>ResultSuccess</CODE></th>
64          <td>Process was successful.</td>
65        </tr>
66        <tr>
67          <th>ResultNullParameter</th>
68          <td><CODE>NULL </CODE>was specified for <B>description </B>or <B>texture2DResource</B>.</td>
69        </tr>
70        <tr>
71          <th>ResultInvalidTextureResolution</th>
72          <td><CODE>O</CODE> was specified for either <B>m_Width</B> or<B> m_Height</B> of <CODE><a href="../../../../nn/gd/CTR/Texture2DResourceDescription/Overview.html">Texture2DResourceDescription</a></CODE>. The result is also returned if the layout is LAYOUT_BLOCK_32 and the size in not correctly aligned. Also, this result is returned if a mipmap cannot be created for the given size of <B>m_Width</B> or<B> m_Height</B> for <CODE><a href="../../../../nn/gd/CTR/Texture2DResourceDescription/Overview.html">Texture2DResourceDescription</a></CODE>. The specified size must be a power of 2.</td>
73        </tr>
74        <tr>
75          <th>ResultInvalidTextureMipLevelIndex</th>
76          <td>The mipmap level index is invalid. </td>
77        </tr>
78        <tr>
79          <th>ResultInvalidMemoryLayout</th>
80          <td>Memory layout is not correct. This result is also returned if initialization data has been specified but the memory layout is not <span>Memory::LAYOUT_BLOCK_8</span>.</td>
81        </tr>
82        <tr>
83          <th>ResultInvalidMemoryLocation</th>
84          <td>The memory type is not valid.</td>
85        </tr>
86        <tr>
87          <th>ResultInvalidTextureFormat</th>
88          <td>Invalid pixel format. This result is also returned if the initialization data is in ETC format and mipmaps cannot be automatically created.</td>
89        </tr>
90        <tr>
91          <th>ResultOutOfMemory</th>
92          <td>Cannot obtain memory for the resource</td>
93        </tr>
94        <tr>
95          <th>ResultOutOfMemoryExt</th>
96          <td>Cannot obtain memory for the data.</td>
97        </tr>
98      </table> </div>
99    <h2>Description</h2>
100    <div class="section">
101      <p>Creates a 2D texture resource.</p><!-- write here --></div>
102    <h2>See Also</h2>
103    <div class="section">
104      <p class="reference"><a href="../../../../nn/gd/CTR/Texture2DResourceDescription/Overview.html">Texture2DResourceDescription</a><br /><a href="../../../../nn/gd/CTR/Resource/Helper/ConvertTextureResourceToNativeFormat.html">Helper::ConvertTextureResourceToNativeFormat</a><br /><a href="../../../../nn/gd/CTR/Resource/Helper/ConvertCompressedTextureResourceToNativeFormat.html">Helper::ConvertCompressedTextureResourceToNativeFormat</a><br /> </p>
105    </div>
106    <h2>Revision History</h2>
107    <div class="section">
108      <dl class="history">
109        <dt>2011/02/17</dt>
110        <dd>Initial version.<br />
111        </dd>
112      </dl>
113    </div>
114  <hr><p>CONFIDENTIAL</p></body>
115</html>