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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419
|
<!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-compatible GUI routines</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__gui.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>Allegro-compatible GUI routines</h1> </div>
</div>
<div class="contents">
<p>AllegroGL GUI wrappers.
<a href="#_details">More...</a></p>
<h2><a name="func-members"></a>
Functions</h2>
<ul>
<li>int <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99">algl_do_dialog</a> (DIALOG *dialog, int focus_obj)
<dl class="el"><dd class="mdescRight">AllegroGL-friendly version of do_dialog. <a href="#ga30c12b20a701f84f994ebcbea14afc99"></a><br/></dl><li>int <a class="el" href="group__gui.html#ga4c6641a5fe463ca062b90bcc3bb5677d">algl_popup_dialog</a> (DIALOG *dialog, int focus_obj)
<dl class="el"><dd class="mdescRight">AllegroGL-friendly version of popup_dialog. <a href="#ga4c6641a5fe463ca062b90bcc3bb5677d"></a><br/></dl><li>void <a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6">algl_draw_mouse</a> (void)
<dl class="el"><dd class="mdescRight">Draws a mouse pointer on the screen. <a href="#ga4418d38b8585ab443ba7f41a476765c6"></a><br/></dl><li>void <a class="el" href="group__gui.html#ga428394c0ae4d4a1e96fe2b27fb13f745">algl_set_mouse_drawer</a> (void(*user_draw_mouse)(void))
<dl class="el"><dd class="mdescRight">Sets (or clears) a user mouse drawing callback. <a href="#ga428394c0ae4d4a1e96fe2b27fb13f745"></a><br/></dl><li>int <a class="el" href="group__gui.html#gad6be783b911635769fcb54d188a77107">algl_alert</a> (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, int c1, int c2)
<dl class="el"><dd class="mdescRight">AllegroGL-friendly version of Allegro's alert. <a href="#gad6be783b911635769fcb54d188a77107"></a><br/></dl><li>int <a class="el" href="group__gui.html#gadc8b61d7a682b7be11f0f1cc864b30be">algl_alert3</a> (AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)
<dl class="el"><dd class="mdescRight">AllegroGL-friendly version of Allegro's alert3. <a href="#gadc8b61d7a682b7be11f0f1cc864b30be"></a><br/></dl><li>int <a class="el" href="group__gui.html#gae41d96ae1ebefffdf60391e632915fd3">d_algl_viewport_proc</a> (int msg, DIALOG *d, int c)
<dl class="el"><dd class="mdescRight">Creates a viewport object where OpenGL commands can be performed. <a href="#gae41d96ae1ebefffdf60391e632915fd3"></a><br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>AllegroGL GUI wrappers. </p>
<p>Due to several specificities of OpenGL, some of the Allegro's GUI routines can not be used "as is". Indeed they are not designed to natively support double-buffered graphics mode. Hence AllegroGL provides wrapper routines of do_dialog, alert and so on...</p>
<p>AllegroGL GUI routines internally call <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> and its counterpart <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a>. So the default drawing mode in the GUI routines is the "2D Allegro mode" and functions like line() or rect() can safely be called.</p>
<p>Additionnaly AllegroGL provides a new GUI object <a class="el" href="group__gui.html#gae41d96ae1ebefffdf60391e632915fd3" title="Creates a viewport object where OpenGL commands can be performed.">d_algl_viewport_proc()</a> which allows to have a 3D viewport that can safely coexist with other "classical" 2D GUI objects : no need to call <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> or to save the current state of OpenGL. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga30c12b20a701f84f994ebcbea14afc99"></a><!-- doxytag: member="alleggl.h::algl_do_dialog" ref="ga30c12b20a701f84f994ebcbea14afc99" args="(DIALOG *dialog, int focus_obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int algl_do_dialog </td>
<td>(</td>
<td class="paramtype">DIALOG * </td>
<td class="paramname"><em>dialog</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>focus_obj</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>AllegroGL-friendly version of do_dialog. </p>
<p>This behaves exactly like do_dialog but forces a screen clear, rerender, and flip, after each iteration of update_dialog.</p>
<p>User gui components can do OpenGL or Allegro rendering to draw themselves. They should take care not to alter any OpenGL state (or be aware that this will affect other components). For the main render, they will be called in order, but this is not guarranteed at other times -- they may be called out of order; however the results will never be visible, so just don't crash.</p>
<p>Before drawing the final (in-order) pass, the color and depth buffers will be cleared -- set your clear color to black or green or whatever you like. You can overdraw it with an object of course.</p>
<p>Further notes: This routine uses <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a>, so your GUI components can use <a class="el" href="group__allegro.html#ga00fbbee541046767114bf9746ceb6f8b" title="Restores previous OpenGL settings.">allegro_gl_unset_allegro_mode()</a> to restore the old state while they draw themselves, provided that they use <a class="el" href="group__allegro.html#ga7ea7ffd9b72d0d0722cbf982b729efdb" title="Prepares for Allegro drawing to the screen.">allegro_gl_set_allegro_mode()</a> again afterwards.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">dialog</td><td>an array of dialog objects terminated by one with a NULL dialog procedure. </td></tr>
<tr><td class="paramname">focus_obj</td><td>index of the object on which the focus is set (-1 if you don't want anything to have the focus</td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse</a> </dd></dl>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00058">58</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>References <a class="el" href="glvtable_8c_source.html#l02422">allegro_gl_set_allegro_mode()</a>, and <a class="el" href="glvtable_8c_source.html#l02491">allegro_gl_unset_allegro_mode()</a>.</p>
</div>
</div>
<a class="anchor" id="ga4c6641a5fe463ca062b90bcc3bb5677d"></a><!-- doxytag: member="alleggl.h::algl_popup_dialog" ref="ga4c6641a5fe463ca062b90bcc3bb5677d" args="(DIALOG *dialog, int focus_obj)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int algl_popup_dialog </td>
<td>(</td>
<td class="paramtype">DIALOG * </td>
<td class="paramname"><em>dialog</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>focus_obj</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>AllegroGL-friendly version of popup_dialog. </p>
<p>This routine is likely to be very slow. It has to take a copy of the screen on entry, then where <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog()</a> would just clear the screen, this routine has to blit that copy back again after clearing. This is the only way to do overlays without knowing what type of flipping is going on.</p>
<p>Also, note that we don't save the depth buffer or anything like that so don't go around thinking that algl_popup_dialog won't affect anything when it's gone.</p>
<p>So, unless you need overlays, it's recommended that you just use <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog()</a>, and if you do need overlays, it's recommended that you just use <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog()</a> and redraw the thing you're overlaying yourself. If you're lazy or that's impossible, use this routine...</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">dialog</td><td>an array of dialog objects terminated by one with a NULL dialog procedure. </td></tr>
<tr><td class="paramname">focus_obj</td><td>index of the object on which the focus is set (-1 if you don't want anything to have the focus</td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog</a>, <a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse</a> </dd></dl>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00111">111</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>References <a class="el" href="gui_8c_source.html#l00187">algl_draw_mouse()</a>, <a class="el" href="alleggl_8c_source.html#l00951">allegro_gl_flip()</a>, <a class="el" href="glvtable_8c_source.html#l02422">allegro_gl_set_allegro_mode()</a>, and <a class="el" href="glvtable_8c_source.html#l02491">allegro_gl_unset_allegro_mode()</a>.</p>
<p>Referenced by <a class="el" href="gui_8c_source.html#l00329">algl_alert3()</a>.</p>
</div>
</div>
<a class="anchor" id="ga4418d38b8585ab443ba7f41a476765c6"></a><!-- doxytag: member="alleggl.h::algl_draw_mouse" ref="ga4418d38b8585ab443ba7f41a476765c6" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void algl_draw_mouse </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Draws a mouse pointer on the screen. </p>
<p>This function draws a mouse pointer on the screen. By default, it displays Allegro's standard black arrow cursor. However the settings of the cursor can be altered by Allegro's functions for mouse cursor management like show_mouse, set_mouse_sprite, scare_mouse, and so on... As a consequence, it should be stressed that if show_mouse(NULL) is called then <a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse()</a> won't draw anything.</p>
<p>Unlike Allegro, AllegroGL does not manage the mouse cursor with an interrupt routine, hence <a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse()</a> must be regularly called in order to display the mouse cursor (ideally it should be the last function called before <a class="el" href="group__core.html#gaf5aad043e99b766393fa4a7ec034a0f1" title="Flips the front and back framebuffers.">allegro_gl_flip()</a>). However if you use <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog()</a> then you do not need to make explicit calls to <a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse()</a> since <a class="el" href="group__gui.html#ga30c12b20a701f84f994ebcbea14afc99" title="AllegroGL-friendly version of do_dialog.">algl_do_dialog()</a> takes care of that for you.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gui.html#ga428394c0ae4d4a1e96fe2b27fb13f745" title="Sets (or clears) a user mouse drawing callback.">algl_set_mouse_drawer</a> </dd></dl>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00187">187</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>Referenced by <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="ga428394c0ae4d4a1e96fe2b27fb13f745"></a><!-- doxytag: member="alleggl.h::algl_set_mouse_drawer" ref="ga428394c0ae4d4a1e96fe2b27fb13f745" args="(void(*user_draw_mouse)(void))" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void algl_set_mouse_drawer </td>
<td>(</td>
<td class="paramtype">void(*)(void) </td>
<td class="paramname"><em>user_draw_mouse</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets (or clears) a user mouse drawing callback. </p>
<p>This function allows to use a user-defined routine to display the mouse cursor. This allows nice effects like a spinning cube or any fancy thing you can think of to be used as a mouse cursor.</p>
<p>When a user mouse drawing callback is enabled, set_mouse_sprite has no effect. However show_mouse and scare_mouse are still enabled.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">user_draw_mouse</td><td>user routine that displays the mouse cursor (NULL if you want to get back to the standard behaviour)</td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__gui.html#ga4418d38b8585ab443ba7f41a476765c6" title="Draws a mouse pointer on the screen.">algl_draw_mouse</a> </dd></dl>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00284">284</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
</div>
</div>
<a class="anchor" id="gad6be783b911635769fcb54d188a77107"></a><!-- doxytag: member="alleggl.h::algl_alert" ref="gad6be783b911635769fcb54d188a77107" args="(AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, int c1, int c2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int algl_alert </td>
<td>(</td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s3</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>b1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>b2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>AllegroGL-friendly version of Allegro's alert. </p>
<p>Displays a simple alert box, containing three lines of text (s1-s3), and with either one or two buttons. The text for these buttons is passed in b1 and b2 (b2 may be null), and the keyboard shortcuts in c1 and c2. Returns 1 or 2 depending on which button was selected. </p>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00449">449</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>References <a class="el" href="gui_8c_source.html#l00329">algl_alert3()</a>.</p>
</div>
</div>
<a class="anchor" id="gadc8b61d7a682b7be11f0f1cc864b30be"></a><!-- doxytag: member="alleggl.h::algl_alert3" ref="gadc8b61d7a682b7be11f0f1cc864b30be" args="(AL_CONST char *s1, AL_CONST char *s2, AL_CONST char *s3, AL_CONST char *b1, AL_CONST char *b2, AL_CONST char *b3, int c1, int c2, int c3)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int algl_alert3 </td>
<td>(</td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>s3</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>b1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>b2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">AL_CONST char * </td>
<td class="paramname"><em>b3</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c3</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>AllegroGL-friendly version of Allegro's alert3. </p>
<p>Displays a simple alert box, containing three lines of text (s1-s3), and with either one, two, or three buttons. The text for these buttons is passed in b1, b2, and b3 (NULL for buttons which are not used), and the keyboard shortcuts in c1 and c2. Returns 1, 2, or 3 depending on which button was selected. </p>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00329">329</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>References <a class="el" href="gui_8c_source.html#l00111">algl_popup_dialog()</a>.</p>
<p>Referenced by <a class="el" href="gui_8c_source.html#l00449">algl_alert()</a>.</p>
</div>
</div>
<a class="anchor" id="gae41d96ae1ebefffdf60391e632915fd3"></a><!-- doxytag: member="alleggl.h::d_algl_viewport_proc" ref="gae41d96ae1ebefffdf60391e632915fd3" args="(int msg, DIALOG *d, int c)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int d_algl_viewport_proc </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>msg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">DIALOG * </td>
<td class="paramname"><em>d</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>c</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a viewport object where OpenGL commands can be performed. </p>
<p>The viewport and the scissor are updated so that this GUI object behaves somewhat like a window. The dp field of the DIALOG object points to a callback function : int (*callback)(BITMAP* viewport, int msg, int c) where: viewport is a sub-bitmap of the screen limited to the area of the DIALOG object. msg and c are the values that come from the GUI manager. The callback function must return a sensible value to the GUI manager like D_O_K if everything went right or D_EXIT to close the dialog. </p>
<p>Definition at line <a class="el" href="gui_8c_source.html#l00477">477</a> of file <a class="el" href="gui_8c_source.html">gui.c</a>.</p>
<p>References <a class="el" href="gui_8c_source.html#l00187">algl_draw_mouse()</a>, <a class="el" href="alleggl_8c_source.html#l00951">allegro_gl_flip()</a>, <a class="el" href="glvtable_8c_source.html#l02422">allegro_gl_set_allegro_mode()</a>, and <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>
|