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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
<!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: Allegro Interfacing</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 <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 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="files.html"><span>Files</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('group__allegro.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<h1>Allegro Interfacing</h1> </div>
</div>
<div class="contents">
<h2><a name="member-group"></a>
Allegro Interfacing routines</h2>
<ul>
<li>void <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb">allegro_gl_set_allegro_mode</a> (void)
<dl class="el"><dd class="mdescRight">Prepares for Allegro drawing to the screen. <a href="#ga7ea7ffd9b72d0d0722cbf982b729efdb"></a><br/></dl><li>void <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b">allegro_gl_unset_allegro_mode</a> (void)
<dl class="el"><dd class="mdescRight">Restores previous OpenGL settings. <a href="#ga00fbbee541046767114bf9746ceb6f8b"></a><br/></dl><li>void <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f">allegro_gl_set_projection</a> (void)
<dl class="el"><dd class="mdescRight">Prepares for Allegro drawing to the screen. <a href="#gabaf6024e9d196da357aad02c5dc7589f"></a><br/></dl><li>void <a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447">allegro_gl_unset_projection</a> (void)
<dl class="el"><dd class="mdescRight">Restores previously saved projection. <a href="#ga603f8f3719d02816acdf3dbdcaa1f447"></a><br/></dl></ul>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7ea7ffd9b72d0d0722cbf982b729efdb"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_allegro_mode" ref="ga7ea7ffd9b72d0d0722cbf982b729efdb" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_set_allegro_mode </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Prepares for Allegro drawing to the screen. </p>
<p>Since AllegroGL actually calls OpenGL commands to perform Allegro functions for 2D drawing, some OpenGL capabilities may interfer with those operations In order to obtain the expected results, <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> must be called to disable the depth test, texturing, fog and lighting and set the view matrices to an appropriate state. Call <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> to restore OpenGL in its previous state.</p>
<p>You should encapsulate all Allegro code dealing with the screen in between <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> and <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a>.</p>
<p>If you need to use regular OpenGL commands in between, you may do so, but you can get unexpected results. This is generally not recommended. You should first call <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> to restore the original OpenGL matrices. After that, you may freely call any OpenGL command. Don't forget to call back <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> to switch back to Allegro commands.</p>
<p>AllegroGL saves the current OpenGL state with glPushAttrib so you should make sure that at least one level is available in the attribute stack otherwise the next call to <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> may fail.</p>
<p>Also note that <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> implicitely calls <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> so you do not need to do it yourself.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> </dd>
<dd>
<a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> </dd></dl>
<p>Definition at line <a class="el" href="glvtable_8c_source.html#l02422">2422</a> of file <a class="el" href="glvtable_8c_source.html">glvtable.c</a>.</p>
<p>References <a class="el" href="glvtable_8c_source.html#l02540">allegro_gl_set_projection()</a>.</p>
<p>Referenced by <a class="el" href="gui_8c_source.html#l00058">algl_do_dialog()</a>, <a class="el" href="gui_8c_source.html#l00111">algl_popup_dialog()</a>, and <a class="el" href="gui_8c_source.html#l00477">d_algl_viewport_proc()</a>.</p>
</div>
</div>
<a class="anchor" id="ga00fbbee541046767114bf9746ceb6f8b"></a><!-- doxytag: member="alleggl.h::allegro_gl_unset_allegro_mode" ref="ga00fbbee541046767114bf9746ceb6f8b" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_unset_allegro_mode </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Restores previous OpenGL settings. </p>
<p>Restores the OpenGL state that have saved during the last call of <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a>.</p>
<p>Note that allegro_gl_unset_allegro_mode implicitely calls <a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> so you do not need to do it yourself.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> </dd>
<dd>
<a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> </dd></dl>
<p>Definition at line <a class="el" href="glvtable_8c_source.html#l02491">2491</a> of file <a class="el" href="glvtable_8c_source.html">glvtable.c</a>.</p>
<p>References <a class="el" href="alleggl_8h_source.html#l00395">AGL_KEEP</a>, <a class="el" href="alleggl_8h_source.html#l00396">AGL_RELEASE</a>, and <a class="el" href="glvtable_8c_source.html#l02567">allegro_gl_unset_projection()</a>.</p>
<p>Referenced by <a class="el" href="gui_8c_source.html#l00058">algl_do_dialog()</a>, <a class="el" href="gui_8c_source.html#l00111">algl_popup_dialog()</a>, and <a class="el" href="gui_8c_source.html#l00477">d_algl_viewport_proc()</a>.</p>
</div>
</div>
<a class="anchor" id="gabaf6024e9d196da357aad02c5dc7589f"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_projection" ref="gabaf6024e9d196da357aad02c5dc7589f" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_set_projection </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Prepares for Allegro drawing to the screen. </p>
<p>This function sets the OpenGL projection and modelview matrices so that 2D OpenGL coordinates match the usual Allegro coordinate system.</p>
<p>OpenGL uses a completely different coordinate system than Allegro. So to be able to use Allegro operations on the screen, you first need to properly set up the OpenGL projection and modelview matrices. AllegroGL provides this set of functions to allow proper alignment of OpenGL coordinates with their Allegro counterparts.</p>
<p>Since AllegroGL actually calls OpenGL commands to perform Allegro functions for 2D drawing, some OpenGL capabilities such as texturing or depth testing may interfer with those operations. In order to prevent such inconveniences, you should call <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> instead of <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a></p>
<p><a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> and <a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> are not nestable, which means that you should not call <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> inside another <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> block. Similarly for <a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a>.</p>
<p>Have a look at examp/exalleg.c for an example of combining Allegro drawing commands and OpenGL.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#ga603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> </dd>
<dd>
<a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> </dd></dl>
<p>Definition at line <a class="el" href="glvtable_8c_source.html#l02540">2540</a> of file <a class="el" href="glvtable_8c_source.html">glvtable.c</a>.</p>
<p>Referenced by <a class="el" href="glvtable_8c_source.html#l02422">allegro_gl_set_allegro_mode()</a>.</p>
</div>
</div>
<a class="anchor" id="ga603f8f3719d02816acdf3dbdcaa1f447"></a><!-- doxytag: member="alleggl.h::allegro_gl_unset_projection" ref="ga603f8f3719d02816acdf3dbdcaa1f447" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void allegro_gl_unset_projection </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Restores previously saved projection. </p>
<p>This function returns the projection and modelview matrices to their state before the last <a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> was called.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#gabaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> </dd>
<dd>
<a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> </dd></dl>
<p>Definition at line <a class="el" href="glvtable_8c_source.html#l02567">2567</a> of file <a class="el" href="glvtable_8c_source.html">glvtable.c</a>.</p>
<p>Referenced by <a class="el" href="glvtable_8c_source.html#l02491">allegro_gl_unset_allegro_mode()</a>.</p>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="footer">Generated on Thu May 19 2011 23:20:20 for AllegroGL by 
<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>
|