Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 8ffe23af9b6e2265bcac8526648e8186 > files > 121

alleggl-devel-0.4.3-8.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AllegroGL: Allegro Interfacing</title>
<link href="alleggl.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>Allegro Interfacing</h1><h2>Allegro Interfacing routines</h2>
<ul>
<li>void <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb">allegro_gl_set_allegro_mode</a> (void)
<dl class="el"><dd class="mdescRight">Prepares for Allegro drawing to the screen.  <a href="#g7ea7ffd9b72d0d0722cbf982b729efdb"></a><br></dl><li>void <a class="el" href="group__allegro.html#g00fbbee541046767114bf9746ceb6f8b">allegro_gl_unset_allegro_mode</a> (void)
<dl class="el"><dd class="mdescRight">Restores previous OpenGL settings.  <a href="#g00fbbee541046767114bf9746ceb6f8b"></a><br></dl><li>void <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f">allegro_gl_set_projection</a> (void)
<dl class="el"><dd class="mdescRight">Prepares for Allegro drawing to the screen.  <a href="#gbaf6024e9d196da357aad02c5dc7589f"></a><br></dl><li>void <a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447">allegro_gl_unset_projection</a> (void)
<dl class="el"><dd class="mdescRight">Restores previously saved projection.  <a href="#g603f8f3719d02816acdf3dbdcaa1f447"></a><br></dl></ul>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g7ea7ffd9b72d0d0722cbf982b729efdb"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_allegro_mode" ref="g7ea7ffd9b72d0d0722cbf982b729efdb" 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&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Prepares for Allegro drawing to the screen. 
<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#g7ea7ffd9b72d0d0722cbf982b729efdb" 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#g00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> to restore OpenGL in its previous state.<p>
You should encapsulate all Allegro code dealing with the screen in between <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> and <a class="el" href="group__allegro.html#g00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a>.<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#g00fbbee541046767114bf9746ceb6f8b" 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#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> to switch back to Allegro commands.<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#g00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> may fail.<p>
Also note that <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> implicitely calls <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" 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" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#g00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> <p>
<a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> </dd></dl>

<p>
Definition at line <a class="el" href="glvtable_8c-source.html#l02394">2394</a> of file <a class="el" href="glvtable_8c-source.html">glvtable.c</a>.
<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>.
</div>
</div><p>
<a class="anchor" name="g00fbbee541046767114bf9746ceb6f8b"></a><!-- doxytag: member="alleggl.h::allegro_gl_unset_allegro_mode" ref="g00fbbee541046767114bf9746ceb6f8b" 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&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Restores previous OpenGL settings. 
<p>
Restores the OpenGL state that have saved during the last call of <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a>.<p>
Note that allegro_gl_unset_allegro_mode implicitely calls <a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> so you do not need to do it yourself.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> <p>
<a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> </dd></dl>

<p>
Definition at line <a class="el" href="glvtable_8c-source.html#l02463">2463</a> of file <a class="el" href="glvtable_8c-source.html">glvtable.c</a>.
<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>.
</div>
</div><p>
<a class="anchor" name="gbaf6024e9d196da357aad02c5dc7589f"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_projection" ref="gbaf6024e9d196da357aad02c5dc7589f" 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&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Prepares for Allegro drawing to the screen. 
<p>
This function sets the OpenGL projection and modelview matrices so that 2D OpenGL coordinates match the usual Allegro coordinate system.<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>
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#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> instead of <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a><p>
<a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> and <a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" 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#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> inside another <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> block. Similarly for <a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a>.<p>
Have a look at examp/exalleg.c for an example of combining Allegro drawing commands and OpenGL.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#g603f8f3719d02816acdf3dbdcaa1f447" title="Restores previously saved projection.">allegro_gl_unset_projection()</a> <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> <p>
<a class="el" href="group__allegro.html#g00fbbee541046767114bf9746ceb6f8b" 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#l02512">2512</a> of file <a class="el" href="glvtable_8c-source.html">glvtable.c</a>.
</div>
</div><p>
<a class="anchor" name="g603f8f3719d02816acdf3dbdcaa1f447"></a><!-- doxytag: member="alleggl.h::allegro_gl_unset_projection" ref="g603f8f3719d02816acdf3dbdcaa1f447" 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&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Restores previously saved projection. 
<p>
This function returns the projection and modelview matrices to their state before the last <a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> was called.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__allegro.html#gbaf6024e9d196da357aad02c5dc7589f" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_projection()</a> <a class="el" href="group__allegro.html#g7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> <p>
<a class="el" href="group__allegro.html#g00fbbee541046767114bf9746ceb6f8b" 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#l02539">2539</a> of file <a class="el" href="glvtable_8c-source.html">glvtable.c</a>.
</div>
</div><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 12 11:05:32 2007 for AllegroGL by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
</body>
</html>