mirror of
https://github.com/g-truc/glm.git
synced 2024-11-15 14:24:36 +00:00
75 lines
3.1 KiB
HTML
75 lines
3.1 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
|
|
<title>GLM_GTC_type_ptr: Memory layout access</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div! -->
|
|
|
|
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
|
|
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Generated by Doxygen 1.7.6.1 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">GLM_GTC_type_ptr: Memory layout access</div> </div>
|
|
<div class="ingroups"><a class="el" href="a00134.html">GTC Extensions (Stable)</a></div></div><!--header-->
|
|
<div class="contents">
|
|
<p>Handles the interaction between pointers and vector, matrix types. </p>
|
|
<p>This extension defines an overloaded function, glm::value_ptr, which takes any of the <a class="el" href="a00140.html">core template types</a>. It returns a pointer to the memory layout of the object. Matrix types store their values in column-major order.</p>
|
|
<p>This is useful for uploading data to matrices or copying data to buffer objects.</p>
|
|
<p>Example: </p>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <<a class="code" href="a00034.html" title="OpenGL Mathematics (glm.g-truc.net)">glm/glm.hpp</a>></span>
|
|
<span class="preprocessor"> #include <<a class="code" href="a00107.html" title="OpenGL Mathematics (glm.g-truc.net)">glm/gtc/type_ptr.hpp</a>></span>
|
|
|
|
<a class="code" href="a00138.html#ga8a44105c47072f9ea1413f15faa31f64" title="3 components vector of floating-point numbers.">glm::vec3</a> aVector(3);
|
|
<a class="code" href="a00138.html#gade0eb47c01f79384a6f38017ede17446" title="4 columns of 4 components matrix of floating-point numbers.">glm::mat4</a> someMatrix(1.0);
|
|
|
|
glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector));
|
|
glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix));
|
|
</pre></div><p><<a class="el" href="a00107.html" title="OpenGL Mathematics (glm.g-truc.net)">glm/gtc/type_ptr.hpp</a>> need to be included to use these functionalities. </p>
|
|
</div><!-- contents -->
|
|
|
|
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.7.6.1
|
|
</small></address>
|
|
|
|
</body>
|
|
</html>
|