File: math_8c.html

package info (click to toggle)
allegro4.4 2%3A4.4.2-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,920 kB
  • ctags: 39,951
  • sloc: ansic: 164,225; asm: 17,620; cpp: 3,848; objc: 1,687; sh: 1,131; python: 676; pascal: 179; makefile: 48; perl: 29; lisp: 1
file content (160 lines) | stat: -rw-r--r-- 7,635 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!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"/>
<title>AllegroGL: math.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="alleggl.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">AllegroGL&#160;<span id="projectnumber">0.4.4</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('math_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a>  </div>
  <div class="headertitle">
<h1>math.c File Reference</h1>  </div>
</div>
<div class="contents">

<p>Converting mathematical structures from Allegro to OpenGL.  
<a href="#_details">More...</a></p>
<div class="textblock"><code>#include &lt;math.h&gt;</code><br/>
<code>#include &lt;allegro.h&gt;</code><br/>
<code>#include &quot;alleggl.h&quot;</code><br/>
<code>#include &quot;allglint.h&quot;</code><br/>
</div>
<p><a href="math_8c_source.html">Go to the source code of this file.</a></p>
<h2><a name="define-members"></a>
Defines</h2>
<ul>
<li><a class="anchor" id="ae71449b1cc6e6250b91f539153a7a0d3"></a><!-- doxytag: member="math.c::M_PI" ref="ae71449b1cc6e6250b91f539153a7a0d3" args="" -->
#define <b>M_PI</b>&#160;&#160;&#160;3.14159265358979323846
<li><a class="anchor" id="a33706d38f2836132b07580c38541b0ba"></a><!-- doxytag: member="math.c::ALGL_NOCONV" ref="a33706d38f2836132b07580c38541b0ba" args="(x)" -->
#define <b>ALGL_NOCONV</b>(x)&#160;&#160;&#160;x
<li>#define <b>TRANSLATE_AL_TO_GL</b>(al_type, gl_type, convertor)
<li><a class="anchor" id="a779175036d19925ff6aa6469c2926b00"></a><!-- doxytag: member="math.c::RAD_2_DEG" ref="a779175036d19925ff6aa6469c2926b00" args="(a)" -->
#define <b>RAD_2_DEG</b>(a)&#160;&#160;&#160;((a) * 180 / M_PI)
</ul>
<h2><a name="func-members"></a>
Functions</h2>
<tr><td colspan="2"><div class="groupHeader">Matrix conversion routines</div></td></tr>
<ul>
<li>void <a class="el" href="group__math.html#ga4cf4f453cb3f95a1e7e861a7401b4a8d">allegro_gl_MATRIX_to_GLfloat</a> (MATRIX *m, GLfloat gl[16])
<dl class="el"><dd class="mdescRight">Converts an Allegro fixed-point matrix to an array of floats suitable for OpenGL's matrix operations.  <a href="group__math.html#ga4cf4f453cb3f95a1e7e861a7401b4a8d"></a><br/></dl><li>void <a class="el" href="group__math.html#gaee6cb48f8e3e70abecc6c282a8ea1edc">allegro_gl_MATRIX_to_GLdouble</a> (MATRIX *m, GLdouble gl[16])
<dl class="el"><dd class="mdescRight">Converts an Allegro fixed-point matrix to an array of doubles suitable for OpenGL's matrix operations.  <a href="group__math.html#gaee6cb48f8e3e70abecc6c282a8ea1edc"></a><br/></dl><li>void <a class="el" href="group__math.html#gae8e0ee18b9aeca955402be16de6ca79d">allegro_gl_MATRIX_f_to_GLfloat</a> (MATRIX_f *m, GLfloat gl[16])
<dl class="el"><dd class="mdescRight">Converts an Allegro floating-point matrix to an array of floats suitable for OpenGL's matrix operations.  <a href="group__math.html#gae8e0ee18b9aeca955402be16de6ca79d"></a><br/></dl><li>void <a class="el" href="group__math.html#gab93f3588ea08b048f418023aa76cb3fc">allegro_gl_MATRIX_f_to_GLdouble</a> (MATRIX_f *m, GLdouble gl[16])
<dl class="el"><dd class="mdescRight">Converts an Allegro floating-point matrix to an array of doubles suitable for OpenGL's matrix operations.  <a href="group__math.html#gab93f3588ea08b048f418023aa76cb3fc"></a><br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Converting mathematical structures from Allegro to OpenGL. </p>
<p>This file provides routines to make Allegro matrices from GL-style matrices, and vice versa. This also provides a QUAT to glRotate converter.</p>
<p>Note that Allegro matrices can only store affine transformations. </p>

<p>Definition in file <a class="el" href="math_8c_source.html">math.c</a>.</p>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="a25e8baba5630176200a8cfa8a6fdd1e0"></a><!-- doxytag: member="math.c::TRANSLATE_AL_TO_GL" ref="a25e8baba5630176200a8cfa8a6fdd1e0" args="(al_type, gl_type, convertor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TRANSLATE_AL_TO_GL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">al_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">gl_type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">convertor&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordtype">void</span> allegro_gl_##al_type##_to_##gl_type (al_type *m, gl_type gl[16]) \
    { \
        <span class="keywordtype">int</span> col, row; \
        <span class="keywordflow">for</span> (col = 0; col &lt; 3; col++) \
            <span class="keywordflow">for</span> (row = 0; row &lt; 3; row++) \
                gl[col*4+row] = convertor (m-&gt;v[col][row]); \
        <span class="keywordflow">for</span> (row = 0; row &lt; 3; row++) \
            gl[12+row] = convertor (m-&gt;t[row]); \
        <span class="keywordflow">for</span> (col = 0; col &lt; 3; col++) \
            gl[4*col + 3] = 0; \
        gl[15] = 1; \
    }
</pre></div>
<p>Definition at line <a class="el" href="math_8c_source.html#l00028">28</a> of file <a class="el" href="math_8c_source.html">math.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="math_8c.html">math.c</a>      </li>
      <li class="footer">Generated on Thu May 19 2011 23:20:20 for AllegroGL by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>