<!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: alleggl.c Source File</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 Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>alleggl.c</h1><a href="alleggl_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* This code is (C) AllegroGL contributors, and double licensed under</span> <a name="l00002"></a>00002 <span class="comment"> * the GPL and zlib licenses. See gpl.txt or zlib.txt for details.</span> <a name="l00003"></a>00003 <span class="comment"> */</span> <a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> <a name="l00012"></a>00012 <span class="preprocessor">#include <stdlib.h></span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="alleggl_8h.html" title="Main header file for AllegroGL.">alleggl.h</a>"</span> <a name="l00015"></a>00015 <span class="preprocessor">#include "allglint.h"</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#include <allegro/internal/aintern.h></span> <a name="l00018"></a>00018 <span class="preprocessor">#ifdef ALLEGRO_MACOSX</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include <OpenGL/glu.h></span> <a name="l00020"></a>00020 <span class="preprocessor">#else</span> <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#include <GL/glu.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#endif</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a><a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">00024</a> <span class="preprocessor">#define PREFIX_I "agl INFO: "</span> <a name="l00025"></a><a class="code" href="alleggl_8c.html#8c04b6ea901068c5cc4020e9a18c0cbe">00025</a> <span class="preprocessor"></span><span class="preprocessor">#define PREFIX_E "agl ERROR: "</span> <a name="l00026"></a><a class="code" href="alleggl_8c.html#712f8992c7b07a796b254244c0e362c4">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define PREFIX_L "agl LOG: "</span> <a name="l00027"></a>00027 <span class="preprocessor"></span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="comment">/* Structs containing the current driver state */</span> <a name="l00030"></a><a class="code" href="alleggl_8c.html#5367a90beaa783cd9c718b9f04581569">00030</a> <span class="keyword">struct </span><a class="code" href="structallegro__gl__driver.html">allegro_gl_driver</a> *<a class="code" href="alleggl_8c.html#5367a90beaa783cd9c718b9f04581569">__allegro_gl_driver</a> = NULL; <a name="l00031"></a><a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">00031</a> <span class="keyword">struct </span><a class="code" href="structallegro__gl__display__info.html">allegro_gl_display_info</a> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>; <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="comment">/* Settings required/suggested */</span> <a name="l00034"></a><a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">00034</a> <span class="keywordtype">int</span> <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a>, <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a>; <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="comment">/* Valid context state */</span> <a name="l00037"></a><a class="code" href="alleggl_8c.html#1cf577416af8a45cce479746114d7acb">00037</a> <span class="keywordtype">int</span> <a class="code" href="alleggl_8c.html#1cf577416af8a45cce479746114d7acb">__allegro_gl_valid_context</a> = 0; <a name="l00038"></a>00038 <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="comment">/* Operation to enable while blitting. */</span> <a name="l00041"></a><a class="code" href="alleggl_8c.html#480f9c7c69cd0af982451925cb6c25c8">00041</a> <span class="keywordtype">int</span> <a class="code" href="alleggl_8c.html#480f9c7c69cd0af982451925cb6c25c8">__allegro_gl_blit_operation</a>; <a name="l00042"></a>00042 <a name="l00043"></a>00043 <a name="l00044"></a><a class="code" href="alleggl_8c.html#56226bbab6a0dfb87493cd5f94b80876">00044</a> <span class="keywordtype">char</span> <a class="code" href="alleggl_8h.html#56226bbab6a0dfb87493cd5f94b80876">allegro_gl_error</a>[<a class="code" href="alleggl_8h.html#47dd926d0fa17257fd4870c8da949472">AGL_ERROR_SIZE</a>] = EMPTY_STRING; <a name="l00045"></a>00045 <a name="l00046"></a><a class="code" href="alleggl_8c.html#d05d1a03b46ff2f05841d3c2cc7ec5bd">00046</a> BLIT_BETWEEN_FORMATS_FUNC <a class="code" href="alleggl_8c.html#d05d1a03b46ff2f05841d3c2cc7ec5bd">__blit_between_formats8</a>; <a name="l00047"></a><a class="code" href="alleggl_8c.html#d93b412d24f734a1f8ac91df7031b8d9">00047</a> BLIT_BETWEEN_FORMATS_FUNC <a class="code" href="alleggl_8c.html#d93b412d24f734a1f8ac91df7031b8d9">__blit_between_formats15</a>; <a name="l00048"></a><a class="code" href="alleggl_8c.html#61b31e9c00583f1f6a7493a3f9ae57f6">00048</a> BLIT_BETWEEN_FORMATS_FUNC <a class="code" href="alleggl_8c.html#61b31e9c00583f1f6a7493a3f9ae57f6">__blit_between_formats16</a>; <a name="l00049"></a><a class="code" href="alleggl_8c.html#dcd1ff2e3c7d2a4e9dd5573a72923554">00049</a> BLIT_BETWEEN_FORMATS_FUNC <a class="code" href="alleggl_8c.html#dcd1ff2e3c7d2a4e9dd5573a72923554">__blit_between_formats24</a>; <a name="l00050"></a><a class="code" href="alleggl_8c.html#02dbd9fcc2542ce36c900ac579fcd8d9">00050</a> BLIT_BETWEEN_FORMATS_FUNC <a class="code" href="alleggl_8c.html#02dbd9fcc2542ce36c900ac579fcd8d9">__blit_between_formats32</a>; <a name="l00051"></a>00051 <a name="l00052"></a>00052 <a name="l00053"></a>00053 <a name="l00062"></a><a class="code" href="alleggl_8c.html#84d9cceae55bf273f9aab7512b353284">00062</a> BITMAP *<a class="code" href="alleggl_8c.html#84d9cceae55bf273f9aab7512b353284" title="Direct-mode GL `screen' bitmap.">allegro_gl_screen</a>; <a name="l00063"></a>00063 <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="comment">/* Allegro GFX_DRIVER list handling */</span> <a name="l00067"></a><a class="code" href="alleggl_8c.html#322edd34d2956f4bcdadb92e98b51880">00067</a> <span class="keyword">static</span> _DRIVER_INFO <a class="code" href="alleggl_8c.html#322edd34d2956f4bcdadb92e98b51880">our_driver_list</a>[] = { <a name="l00068"></a>00068 <span class="preprocessor">#ifdef GFX_OPENGL_WINDOWED</span> <a name="l00069"></a>00069 <span class="preprocessor"></span> {<a class="code" href="alleggl_8h.html#5fcf0497998fecc3c04bb5b6ce66782b" title="Windowed OpenGL graphics driver for Allegro.">GFX_OPENGL_WINDOWED</a>, &<a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>, FALSE}, <a name="l00070"></a>00070 <span class="preprocessor">#endif</span> <a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#ifdef GFX_OPENGL_FULLSCREEN</span> <a name="l00072"></a>00072 <span class="preprocessor"></span> {<a class="code" href="alleggl_8h.html#fd00c615b3351d54382b5f883b99544f" title="Fullscreen OpenGL graphics driver for Allegro.">GFX_OPENGL_FULLSCREEN</a>, &<a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>, FALSE}, <a name="l00073"></a>00073 <span class="preprocessor">#endif</span> <a name="l00074"></a>00074 <span class="preprocessor"></span> {<a class="code" href="alleggl_8h.html#6341d90e32c19c45f003442b19ecba5f" title="Non-specific OpenGL graphics driver for Allegro.">GFX_OPENGL</a>, &<a class="code" href="alleggl_8h.html#c62887d7ccdfa9737e2d952c95402e6a">gfx_allegro_gl_default</a>, FALSE}, <a name="l00075"></a>00075 {0, NULL, FALSE} <a name="l00076"></a>00076 }; <a name="l00077"></a>00077 <a name="l00078"></a>00078 <a name="l00079"></a>00079 <a name="l00080"></a><a class="code" href="alleggl_8c.html#8bfd290ff50878a432c36efaf494a856">00080</a> <span class="keyword">static</span> _DRIVER_INFO *<a class="code" href="alleggl_8c.html#8bfd290ff50878a432c36efaf494a856">our_gfx_drivers</a>(<span class="keywordtype">void</span>) <a name="l00081"></a>00081 { <a name="l00082"></a>00082 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#322edd34d2956f4bcdadb92e98b51880">our_driver_list</a>; <a name="l00083"></a>00083 } <a name="l00084"></a>00084 <a name="l00085"></a>00085 <a name="l00086"></a>00086 <a name="l00087"></a><a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">00087</a> _DRIVER_INFO *(*saved_gfx_drivers) (void) = NULL; <a name="l00088"></a>00088 <a name="l00089"></a>00089 <a name="l00090"></a>00090 <a name="l00091"></a><a class="code" href="alleggl_8c.html#ad021ddbdff0236b4a10ab5aa6af8d85">00091</a> <span class="keyword">static</span> _DRIVER_INFO *<a class="code" href="alleggl_8c.html#ad021ddbdff0236b4a10ab5aa6af8d85">list_saved_gfx_drivers</a>(<span class="keywordtype">void</span>) <a name="l00092"></a>00092 { <a name="l00093"></a>00093 <span class="keywordflow">return</span> _gfx_driver_list; <a name="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00096"></a>00096 <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="keyword">static</span> BITMAP *<a class="code" href="alleggl_8c.html#00396d2a89cb9f21be985de53e1df575">allegro_gl_default_gfx_init</a>(<span class="keywordtype">int</span> <a class="code" href="structallegro__gl__display__info.html#1d55b9c63d30f160e9c1d9345e3c4847">w</a>, <span class="keywordtype">int</span> <a class="code" href="structallegro__gl__display__info.html#48a7f122157f65d1c7e4261cba6c5a89">h</a>, <span class="keywordtype">int</span> vw, <span class="keywordtype">int</span> vh, <span class="keywordtype">int</span> depth); <a name="l00099"></a>00099 <a name="l00100"></a>00100 <a name="l00101"></a>00101 <a name="l00102"></a><a class="code" href="alleggl_8c.html#c62887d7ccdfa9737e2d952c95402e6a">00102</a> GFX_DRIVER <a class="code" href="alleggl_8h.html#c62887d7ccdfa9737e2d952c95402e6a">gfx_allegro_gl_default</a> = <a name="l00103"></a>00103 { <a name="l00104"></a>00104 <a class="code" href="alleggl_8h.html#6341d90e32c19c45f003442b19ecba5f" title="Non-specific OpenGL graphics driver for Allegro.">GFX_OPENGL</a>, <a name="l00105"></a>00105 EMPTY_STRING, <a name="l00106"></a>00106 EMPTY_STRING, <a name="l00107"></a>00107 <span class="stringliteral">"AllegroGL Default Driver"</span>, <a name="l00108"></a>00108 <a class="code" href="alleggl_8c.html#00396d2a89cb9f21be985de53e1df575">allegro_gl_default_gfx_init</a>, <a name="l00109"></a>00109 NULL, <a name="l00110"></a>00110 NULL, <a name="l00111"></a>00111 NULL, <span class="comment">//_xwin_vsync,</span> <a name="l00112"></a>00112 NULL, <a name="l00113"></a>00113 NULL, NULL, NULL, <a name="l00114"></a>00114 NULL, <span class="comment">/* create_video_bitmap */</span> <a name="l00115"></a>00115 NULL, <a name="l00116"></a>00116 NULL, NULL, <span class="comment">/* No show/request video bitmaps */</span> <a name="l00117"></a>00117 NULL, NULL, <a name="l00118"></a>00118 NULL, NULL, NULL, NULL, <a name="l00119"></a>00119 NULL, <a name="l00120"></a>00120 NULL, NULL, <a name="l00121"></a>00121 NULL, <span class="comment">/* set_blender_mode */</span> <a name="l00122"></a>00122 NULL, <span class="comment">/* No fetch_mode_list */</span> <a name="l00123"></a>00123 0, 0, <a name="l00124"></a>00124 0, <a name="l00125"></a>00125 0, 0, <a name="l00126"></a>00126 0, <a name="l00127"></a>00127 0, <a name="l00128"></a>00128 FALSE <span class="comment">/* Windowed mode */</span> <a name="l00129"></a>00129 }; <a name="l00130"></a>00130 <a name="l00131"></a>00131 <a name="l00132"></a>00132 <a name="l00176"></a>00176 <span class="comment">/* void allegro_gl_clear_settings(void) */</span> <a name="l00193"></a><a class="code" href="group__settings.html#gdd1249980001c22cb3eba880561a7e19">00193</a> <span class="keywordtype">void</span> <a class="code" href="group__settings.html#gdd1249980001c22cb3eba880561a7e19" title="Clear the option settings All settings are set to their default values, and marked...">allegro_gl_clear_settings</a>(<span class="keywordtype">void</span>) <a name="l00194"></a>00194 { <a name="l00195"></a>00195 memset(&<a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>, 0, <span class="keyword">sizeof</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>); <a name="l00196"></a>00196 <a name="l00197"></a>00197 <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> = <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a> = 0; <a name="l00198"></a>00198 <a name="l00199"></a>00199 <span class="comment">/* Pick sensible defaults */</span> <a name="l00200"></a>00200 allegro_gl_display_info.fullscreen = 1; <a name="l00201"></a>00201 allegro_gl_display_info.rmethod = 1; <a name="l00202"></a>00202 allegro_gl_display_info.doublebuffered = 1; <a name="l00203"></a>00203 allegro_gl_display_info.vidmem_policy = <a class="code" href="group__settings.html#g5deef983a0f5b2704746d7945c614b7c" title="Keep internal texture in video memory.">AGL_KEEP</a>; <a name="l00204"></a>00204 <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a> = <a name="l00205"></a>00205 <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a> | <a class="code" href="group__settings.html#g3cd047a464c8f8d928f9529226a4cf12" title="Set it if you'd like AllegroGL to pay special attention on whether hardware acceleration...">AGL_RENDERMETHOD</a> | <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>; <a name="l00206"></a>00206 } <a name="l00207"></a>00207 <a name="l00208"></a>00208 <a name="l00209"></a>00209 <a name="l00210"></a>00210 <span class="comment">/* void allegro_gl_set(int option, int value) */</span> <a name="l00274"></a><a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656">00274</a> <span class="keywordtype">void</span> <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<span class="keywordtype">int</span> option, <span class="keywordtype">int</span> value) <a name="l00275"></a>00275 { <a name="l00276"></a>00276 <span class="keywordflow">switch</span> (option) { <a name="l00277"></a>00277 <span class="comment">/* Options stating importance of other options */</span> <a name="l00278"></a>00278 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g839ae567340a64a97480e6abf1743b5f" title="Reject other values for these settings.">AGL_REQUIRE</a>: <a name="l00279"></a>00279 <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> |= value; <a name="l00280"></a>00280 <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a> &= ~value; <a name="l00281"></a>00281 <span class="keywordflow">break</span>; <a name="l00282"></a>00282 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g5a1518fe9c1b44beb7f5bdcc42b6b8f1" title="Prefer the assigned values for these settings.">AGL_SUGGEST</a>: <a name="l00283"></a>00283 <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a> |= value; <a name="l00284"></a>00284 <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> &= ~value; <a name="l00285"></a>00285 <span class="keywordflow">break</span>; <a name="l00286"></a>00286 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g7a6285db6617b68ae4946556c6a4636d" title="Ignore these settings.">AGL_DONTCARE</a>: <a name="l00287"></a>00287 <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> &= ~value; <a name="l00288"></a>00288 <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a> &= ~value; <a name="l00289"></a>00289 <span class="keywordflow">break</span>; <a name="l00290"></a>00290 <a name="l00291"></a>00291 <span class="comment">/* Options configuring the mode set */</span> <a name="l00292"></a>00292 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>: <a name="l00293"></a>00293 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#52dbe65e088cbeaa1ffe179eacc42571">allegro_format</a> = value; <a name="l00294"></a>00294 <span class="keywordflow">break</span>; <a name="l00295"></a>00295 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>: <a name="l00296"></a>00296 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#f9de518467fa0b1532e8eba66538be09">r</a> = value; <a name="l00297"></a>00297 <span class="keywordflow">break</span>; <a name="l00298"></a>00298 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>: <a name="l00299"></a>00299 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#b3eb1168ad9bc3d02b523b032f856b6c">g</a> = value; <a name="l00300"></a>00300 <span class="keywordflow">break</span>; <a name="l00301"></a>00301 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>: <a name="l00302"></a>00302 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#cd92a14a0bbb205a634295e18f00bd87">b</a> = value; <a name="l00303"></a>00303 <span class="keywordflow">break</span>; <a name="l00304"></a>00304 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>: <a name="l00305"></a>00305 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#87c70ef6046f7b5649c66590c102e0c4">a</a> = value; <a name="l00306"></a>00306 <span class="keywordflow">break</span>; <a name="l00307"></a>00307 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>: <a name="l00308"></a>00308 <span class="keywordflow">switch</span> (value) { <a name="l00309"></a>00309 <span class="keywordflow">case</span> 8: <a name="l00310"></a>00310 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>, 3); <a name="l00311"></a>00311 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>, 3); <a name="l00312"></a>00312 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>, 2); <a name="l00313"></a>00313 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>, 0); <a name="l00314"></a>00314 <span class="keywordflow">break</span>; <a name="l00315"></a>00315 <span class="keywordflow">case</span> 15: <a name="l00316"></a>00316 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(AGL_RED_DEPTH, 5); <a name="l00317"></a>00317 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>, 5); <a name="l00318"></a>00318 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>, 5); <a name="l00319"></a>00319 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>, 1); <a name="l00320"></a>00320 <span class="keywordflow">break</span>; <a name="l00321"></a>00321 <span class="keywordflow">case</span> 16: <a name="l00322"></a>00322 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(AGL_RED_DEPTH, 5); <a name="l00323"></a>00323 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>, 6); <a name="l00324"></a>00324 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>, 5); <a name="l00325"></a>00325 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>, 0); <a name="l00326"></a>00326 <span class="keywordflow">break</span>; <a name="l00327"></a>00327 <span class="keywordflow">case</span> 24: <a name="l00328"></a>00328 <span class="keywordflow">case</span> 32: <a name="l00329"></a>00329 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(AGL_RED_DEPTH, 8); <a name="l00330"></a>00330 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>, 8); <a name="l00331"></a>00331 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>, 8); <a name="l00332"></a>00332 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>, value-24); <a name="l00333"></a>00333 <span class="keywordflow">break</span>; <a name="l00334"></a>00334 } <a name="l00335"></a>00335 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#736c31eafe099ac504e844b8fb3ab963">colour_depth</a> = value; <a name="l00336"></a>00336 <span class="keywordflow">break</span>; <a name="l00337"></a>00337 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>: <a name="l00338"></a>00338 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#f9de518467fa0b1532e8eba66538be09">r</a> = value; <a name="l00339"></a>00339 <span class="keywordflow">break</span>; <a name="l00340"></a>00340 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>: <a name="l00341"></a>00341 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#b3eb1168ad9bc3d02b523b032f856b6c">g</a> = value; <a name="l00342"></a>00342 <span class="keywordflow">break</span>; <a name="l00343"></a>00343 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>: <a name="l00344"></a>00344 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#cd92a14a0bbb205a634295e18f00bd87">b</a> = value; <a name="l00345"></a>00345 <span class="keywordflow">break</span>; <a name="l00346"></a>00346 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>: <a name="l00347"></a>00347 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#87c70ef6046f7b5649c66590c102e0c4">a</a> = value; <a name="l00348"></a>00348 <span class="keywordflow">break</span>; <a name="l00349"></a>00349 <a name="l00350"></a>00350 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>: <a name="l00351"></a>00351 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#620e7a0c77ce365b470b1bf629960989">doublebuffered</a> = value; <a name="l00352"></a>00352 <span class="keywordflow">break</span>; <a name="l00353"></a>00353 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>: <a name="l00354"></a>00354 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#5c5e59ff093bcfe869460636eda46f01">stereo</a> = value; <a name="l00355"></a>00355 <span class="keywordflow">break</span>; <a name="l00356"></a>00356 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>: <a name="l00357"></a>00357 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#b0a89d6d93a3c8e565bfcfef23ae8fb8">aux_buffers</a> = value; <a name="l00358"></a>00358 <span class="keywordflow">break</span>; <a name="l00359"></a>00359 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>: <a name="l00360"></a>00360 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#0b5eaf55c97e5be1bec507ca8d1c45c7">depth_size</a> = value; <a name="l00361"></a>00361 <span class="keywordflow">break</span>; <a name="l00362"></a>00362 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>: <a name="l00363"></a>00363 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#fefde83b0454134e9980524577022f50">stencil_size</a> = value; <a name="l00364"></a>00364 <span class="keywordflow">break</span>; <a name="l00365"></a>00365 <a name="l00366"></a>00366 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>: <a name="l00367"></a>00367 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#03c7212a042475984dee4cb0d22dabae">x</a> = value; <a name="l00368"></a>00368 <span class="keywordflow">break</span>; <a name="l00369"></a>00369 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>: <a name="l00370"></a>00370 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d003c0b8e8a6ae6f031d438878343a0">y</a> = value; <a name="l00371"></a>00371 <span class="keywordflow">break</span>; <a name="l00372"></a>00372 <a name="l00373"></a>00373 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g3cd047a464c8f8d928f9529226a4cf12" title="Set it if you'd like AllegroGL to pay special attention on whether hardware acceleration...">AGL_RENDERMETHOD</a>: <a name="l00374"></a>00374 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#279d45652a733a6c94846859f1aa0c0b">rmethod</a> = value; <a name="l00375"></a>00375 <span class="keywordflow">break</span>; <a name="l00376"></a>00376 <a name="l00377"></a>00377 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>: <a name="l00378"></a>00378 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a> = value; <a name="l00379"></a>00379 <span class="keywordflow">break</span>; <a name="l00380"></a>00380 <a name="l00381"></a>00381 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>: <a name="l00382"></a>00382 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a> = !value; <a name="l00383"></a>00383 <span class="keywordflow">break</span>; <a name="l00384"></a>00384 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>: <a name="l00385"></a>00385 <span class="keywordflow">if</span> ((value == <a class="code" href="group__settings.html#g5deef983a0f5b2704746d7945c614b7c" title="Keep internal texture in video memory.">AGL_KEEP</a>) || (value == <a class="code" href="group__settings.html#g77a6cb708e52f68f893128db6f20bdea" title="Release video memory occupied by internal texture.">AGL_RELEASE</a>)) <a name="l00386"></a>00386 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#e570fabecf8698012888ba4b0dd93b07">vidmem_policy</a> = value; <a name="l00387"></a>00387 <span class="keywordflow">break</span>; <a name="l00388"></a>00388 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>: <a name="l00389"></a>00389 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#07036f3d972acefc5790df1ab33190d6">sample_buffers</a> = value; <a name="l00390"></a>00390 <span class="keywordflow">break</span>; <a name="l00391"></a>00391 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>: <a name="l00392"></a>00392 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#6bb01a18a7aa16e08d544f1b81536b44">samples</a> = value; <a name="l00393"></a>00393 <span class="keywordflow">break</span>; <a name="l00394"></a>00394 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>: <a name="l00395"></a>00395 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#c2a75c18dd42e5ee730eb42d862aed40">float_color</a> = value; <a name="l00396"></a>00396 <span class="keywordflow">break</span>; <a name="l00397"></a>00397 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>: <a name="l00398"></a>00398 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#44a555fa41bcd28266350078125a8a91">float_depth</a> = value; <a name="l00399"></a>00399 <span class="keywordflow">break</span>; <a name="l00400"></a>00400 } <a name="l00401"></a>00401 } <a name="l00402"></a>00402 <a name="l00403"></a>00403 <a name="l00404"></a>00404 <a name="l00421"></a><a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9">00421</a> <span class="keywordtype">int</span> <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(<span class="keywordtype">int</span> option) <a name="l00422"></a>00422 { <a name="l00423"></a>00423 <span class="keywordflow">switch</span> (option) { <a name="l00424"></a>00424 <span class="comment">/* Options stating importance of other options */</span> <a name="l00425"></a>00425 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g839ae567340a64a97480e6abf1743b5f" title="Reject other values for these settings.">AGL_REQUIRE</a>: <a name="l00426"></a>00426 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a>; <a name="l00427"></a>00427 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g5a1518fe9c1b44beb7f5bdcc42b6b8f1" title="Prefer the assigned values for these settings.">AGL_SUGGEST</a>: <a name="l00428"></a>00428 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a>; <a name="l00429"></a>00429 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g7a6285db6617b68ae4946556c6a4636d" title="Ignore these settings.">AGL_DONTCARE</a>: <a name="l00430"></a>00430 <span class="keywordflow">return</span> ~0 & ~(<a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> | <a name="l00431"></a>00431 <a class="code" href="alleggl_8c.html#c2e302ce1b0def545585451d80924a65">__allegro_gl_suggested_settings</a>); <a name="l00432"></a>00432 <a name="l00433"></a>00433 <span class="comment">/* Options configuring the mode set */</span> <a name="l00434"></a>00434 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>: <a name="l00435"></a>00435 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#52dbe65e088cbeaa1ffe179eacc42571">allegro_format</a>; <a name="l00436"></a>00436 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>: <a name="l00437"></a>00437 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#f9de518467fa0b1532e8eba66538be09">r</a>; <a name="l00438"></a>00438 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>: <a name="l00439"></a>00439 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#b3eb1168ad9bc3d02b523b032f856b6c">g</a>; <a name="l00440"></a>00440 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>: <a name="l00441"></a>00441 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#cd92a14a0bbb205a634295e18f00bd87">b</a>; <a name="l00442"></a>00442 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>: <a name="l00443"></a>00443 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#87c70ef6046f7b5649c66590c102e0c4">a</a>; <a name="l00444"></a>00444 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>: <a name="l00445"></a>00445 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#f9de518467fa0b1532e8eba66538be09">r</a> <a name="l00446"></a>00446 + <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#b3eb1168ad9bc3d02b523b032f856b6c">g</a> <a name="l00447"></a>00447 + <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#cd92a14a0bbb205a634295e18f00bd87">b</a> <a name="l00448"></a>00448 + <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d91d2f1759a1d6f3e6b0463e1d564e5">pixel_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#87c70ef6046f7b5649c66590c102e0c4">a</a>; <a name="l00449"></a>00449 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>: <a name="l00450"></a>00450 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#f9de518467fa0b1532e8eba66538be09">r</a>; <a name="l00451"></a>00451 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>: <a name="l00452"></a>00452 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#b3eb1168ad9bc3d02b523b032f856b6c">g</a>; <a name="l00453"></a>00453 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>: <a name="l00454"></a>00454 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#cd92a14a0bbb205a634295e18f00bd87">b</a>; <a name="l00455"></a>00455 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>: <a name="l00456"></a>00456 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#7f87a49c909fc0d69eb8b0729ec3afc6">accum_size</a>.<a class="code" href="unionallegro__gl__pixel__size.html#e04664badce9331a9199b88905494527">rgba</a>.<a class="code" href="structallegro__gl__rgba__size.html#87c70ef6046f7b5649c66590c102e0c4">a</a>; <a name="l00457"></a>00457 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>: <a name="l00458"></a>00458 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#620e7a0c77ce365b470b1bf629960989">doublebuffered</a>; <a name="l00459"></a>00459 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>: <a name="l00460"></a>00460 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#5c5e59ff093bcfe869460636eda46f01">stereo</a>; <a name="l00461"></a>00461 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>: <a name="l00462"></a>00462 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#b0a89d6d93a3c8e565bfcfef23ae8fb8">aux_buffers</a>; <a name="l00463"></a>00463 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>: <a name="l00464"></a>00464 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#0b5eaf55c97e5be1bec507ca8d1c45c7">depth_size</a>; <a name="l00465"></a>00465 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>: <a name="l00466"></a>00466 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#fefde83b0454134e9980524577022f50">stencil_size</a>; <a name="l00467"></a>00467 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>: <a name="l00468"></a>00468 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#03c7212a042475984dee4cb0d22dabae">x</a>; <a name="l00469"></a>00469 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>: <a name="l00470"></a>00470 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#4d003c0b8e8a6ae6f031d438878343a0">y</a>; <a name="l00471"></a>00471 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>: <a name="l00472"></a>00472 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a>; <a name="l00473"></a>00473 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>: <a name="l00474"></a>00474 <span class="keywordflow">return</span> !<a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a>; <a name="l00475"></a>00475 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>: <a name="l00476"></a>00476 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#e570fabecf8698012888ba4b0dd93b07">vidmem_policy</a>; <a name="l00477"></a>00477 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>: <a name="l00478"></a>00478 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#07036f3d972acefc5790df1ab33190d6">sample_buffers</a>; <a name="l00479"></a>00479 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>: <a name="l00480"></a>00480 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#6bb01a18a7aa16e08d544f1b81536b44">samples</a>; <a name="l00481"></a>00481 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>: <a name="l00482"></a>00482 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#c2a75c18dd42e5ee730eb42d862aed40">float_color</a>; <a name="l00483"></a>00483 <span class="keywordflow">case</span> <a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>: <a name="l00484"></a>00484 <span class="keywordflow">return</span> <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#44a555fa41bcd28266350078125a8a91">float_depth</a>; <a name="l00485"></a>00485 } <a name="l00486"></a>00486 <span class="keywordflow">return</span> -1; <a name="l00487"></a>00487 } <a name="l00488"></a>00488 <a name="l00489"></a>00489 <a name="l00490"></a>00490 <a name="l00491"></a>00491 <span class="comment">/* Builds a string corresponding to the options set in 'opt'</span> <a name="l00492"></a>00492 <span class="comment"> * and writes in the config file</span> <a name="l00493"></a>00493 <span class="comment"> */</span> <a name="l00494"></a><a class="code" href="alleggl_8c.html#40fb22e20a933efa9a33ff4098daa3e3">00494</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="alleggl_8c.html#40fb22e20a933efa9a33ff4098daa3e3">build_settings</a>(<span class="keywordtype">int</span> opt, <span class="keywordtype">char</span> *section, <span class="keywordtype">char</span> *name) { <a name="l00495"></a>00495 <span class="keywordtype">char</span> buf[2048]; <a name="l00496"></a>00496 <a name="l00497"></a>00497 usetc(buf, 0); <a name="l00498"></a>00498 <a name="l00499"></a>00499 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>) <a name="l00500"></a>00500 ustrcat(buf, <span class="stringliteral">"allegro_format "</span>); <a name="l00501"></a>00501 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>) <a name="l00502"></a>00502 ustrcat(buf, <span class="stringliteral">"red_depth "</span>); <a name="l00503"></a>00503 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>) <a name="l00504"></a>00504 ustrcat(buf, <span class="stringliteral">"green_depth "</span>); <a name="l00505"></a>00505 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>) <a name="l00506"></a>00506 ustrcat(buf, <span class="stringliteral">"blue_depth "</span>); <a name="l00507"></a>00507 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>) <a name="l00508"></a>00508 ustrcat(buf, <span class="stringliteral">"alpha_depth "</span>); <a name="l00509"></a>00509 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>) <a name="l00510"></a>00510 ustrcat(buf, <span class="stringliteral">"color_depth "</span>); <a name="l00511"></a>00511 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>) <a name="l00512"></a>00512 ustrcat(buf, <span class="stringliteral">"accum_red_depth "</span>); <a name="l00513"></a>00513 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>) <a name="l00514"></a>00514 ustrcat(buf, <span class="stringliteral">"accum_green_depth "</span>); <a name="l00515"></a>00515 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>) <a name="l00516"></a>00516 ustrcat(buf, <span class="stringliteral">"accum_blue_depth "</span>); <a name="l00517"></a>00517 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>) <a name="l00518"></a>00518 ustrcat(buf, <span class="stringliteral">"accum_alpha_depth "</span>); <a name="l00519"></a>00519 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>) <a name="l00520"></a>00520 ustrcat(buf, <span class="stringliteral">"double_buffer "</span>); <a name="l00521"></a>00521 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>) <a name="l00522"></a>00522 ustrcat(buf, <span class="stringliteral">"stereo_display "</span>); <a name="l00523"></a>00523 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>) <a name="l00524"></a>00524 ustrcat(buf, <span class="stringliteral">"aux_buffers "</span>); <a name="l00525"></a>00525 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>) <a name="l00526"></a>00526 ustrcat(buf, <span class="stringliteral">"z_depth "</span>); <a name="l00527"></a>00527 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>) <a name="l00528"></a>00528 ustrcat(buf, <span class="stringliteral">"stencil_depth "</span>); <a name="l00529"></a>00529 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>) <a name="l00530"></a>00530 ustrcat(buf, <span class="stringliteral">"window_x "</span>); <a name="l00531"></a>00531 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>) <a name="l00532"></a>00532 ustrcat(buf, <span class="stringliteral">"window_y "</span>); <a name="l00533"></a>00533 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>) <a name="l00534"></a>00534 ustrcat(buf, <span class="stringliteral">"fullscreen "</span>); <a name="l00535"></a>00535 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>) <a name="l00536"></a>00536 ustrcat(buf, <span class="stringliteral">"windowed "</span>); <a name="l00537"></a>00537 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>) <a name="l00538"></a>00538 ustrcat(buf, <span class="stringliteral">"video_memory_policy "</span>); <a name="l00539"></a>00539 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>) <a name="l00540"></a>00540 ustrcat(buf, <span class="stringliteral">"sample_buffers "</span>); <a name="l00541"></a>00541 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>) <a name="l00542"></a>00542 ustrcat(buf, <span class="stringliteral">"samples "</span>); <a name="l00543"></a>00543 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>) <a name="l00544"></a>00544 ustrcat(buf, <span class="stringliteral">"float_color "</span>); <a name="l00545"></a>00545 <span class="keywordflow">if</span> (opt & <a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>) <a name="l00546"></a>00546 ustrcat(buf, <span class="stringliteral">"float_depth "</span>); <a name="l00547"></a>00547 <a name="l00548"></a>00548 set_config_string(section, name, buf); <a name="l00549"></a>00549 } <a name="l00550"></a>00550 <a name="l00551"></a>00551 <a name="l00552"></a>00552 <a name="l00553"></a>00553 <span class="comment">/* void allegro_gl_save_settings() */</span> <a name="l00560"></a><a class="code" href="group__settings.html#ga461b9459f56c9274d2d49accf201ee1">00560</a> <span class="keywordtype">void</span> <a class="code" href="group__settings.html#ga461b9459f56c9274d2d49accf201ee1" title="Saves the current settings (as specified by allegro_gl_set()) to the current config...">allegro_gl_save_settings</a>() { <a name="l00561"></a>00561 <a name="l00562"></a>00562 <span class="keywordtype">char</span> *section = <span class="stringliteral">"OpenGL"</span>; <a name="l00563"></a>00563 <span class="keywordtype">int</span> save = <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(<a class="code" href="group__settings.html#g839ae567340a64a97480e6abf1743b5f" title="Reject other values for these settings.">AGL_REQUIRE</a>) | <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(<a class="code" href="group__settings.html#g5a1518fe9c1b44beb7f5bdcc42b6b8f1" title="Prefer the assigned values for these settings.">AGL_SUGGEST</a>); <a name="l00564"></a>00564 <a name="l00565"></a>00565 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>) <a name="l00566"></a>00566 set_config_int(section, <span class="stringliteral">"allegro_format"</span>, <a name="l00567"></a>00567 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ALLEGRO_FORMAT)); <a name="l00568"></a>00568 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>) <a name="l00569"></a>00569 set_config_int(section, <span class="stringliteral">"red_depth"</span>, <a name="l00570"></a>00570 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_RED_DEPTH)); <a name="l00571"></a>00571 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>) <a name="l00572"></a>00572 set_config_int(section, <span class="stringliteral">"green_depth"</span>, <a name="l00573"></a>00573 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_GREEN_DEPTH)); <a name="l00574"></a>00574 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>) <a name="l00575"></a>00575 set_config_int(section, <span class="stringliteral">"blue_depth"</span>, <a name="l00576"></a>00576 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_BLUE_DEPTH)); <a name="l00577"></a>00577 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>) <a name="l00578"></a>00578 set_config_int(section, <span class="stringliteral">"alpha_depth"</span>, <a name="l00579"></a>00579 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ALPHA_DEPTH)); <a name="l00580"></a>00580 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>) <a name="l00581"></a>00581 set_config_int(section, <span class="stringliteral">"color_depth"</span>, <a name="l00582"></a>00582 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_COLOR_DEPTH)); <a name="l00583"></a>00583 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>) <a name="l00584"></a>00584 set_config_int(section, <span class="stringliteral">"accum_red_depth"</span>, <a name="l00585"></a>00585 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ACC_RED_DEPTH)); <a name="l00586"></a>00586 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>) <a name="l00587"></a>00587 set_config_int(section, <span class="stringliteral">"accum_green_depth"</span>, <a name="l00588"></a>00588 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ACC_GREEN_DEPTH)); <a name="l00589"></a>00589 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>) <a name="l00590"></a>00590 set_config_int(section, <span class="stringliteral">"accum_blue_depth"</span>, <a name="l00591"></a>00591 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ACC_BLUE_DEPTH)); <a name="l00592"></a>00592 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>) <a name="l00593"></a>00593 set_config_int(section, <span class="stringliteral">"accum_alpha_depth"</span>, <a name="l00594"></a>00594 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_ACC_ALPHA_DEPTH)); <a name="l00595"></a>00595 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>) <a name="l00596"></a>00596 set_config_int(section, <span class="stringliteral">"double_buffer"</span>, <a name="l00597"></a>00597 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_DOUBLEBUFFER)); <a name="l00598"></a>00598 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>) <a name="l00599"></a>00599 set_config_int(section, <span class="stringliteral">"stereo_display"</span>, <a name="l00600"></a>00600 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_STEREO)); <a name="l00601"></a>00601 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>) <a name="l00602"></a>00602 set_config_int(section, <span class="stringliteral">"aux_buffers"</span>, <a name="l00603"></a>00603 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_AUX_BUFFERS)); <a name="l00604"></a>00604 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>) <a name="l00605"></a>00605 set_config_int(section, <span class="stringliteral">"z_depth"</span>, <a name="l00606"></a>00606 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_Z_DEPTH)); <a name="l00607"></a>00607 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>) <a name="l00608"></a>00608 set_config_int(section, <span class="stringliteral">"stencil_depth"</span>, <a name="l00609"></a>00609 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_STENCIL_DEPTH)); <a name="l00610"></a>00610 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>) <a name="l00611"></a>00611 set_config_int(section, <span class="stringliteral">"window_x"</span>, <a name="l00612"></a>00612 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_WINDOW_X)); <a name="l00613"></a>00613 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>) <a name="l00614"></a>00614 set_config_int(section, <span class="stringliteral">"window_y"</span>, <a name="l00615"></a>00615 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_WINDOW_Y)); <a name="l00616"></a>00616 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>) <a name="l00617"></a>00617 set_config_int(section, <span class="stringliteral">"fullscreen"</span>, <a name="l00618"></a>00618 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_FULLSCREEN)); <a name="l00619"></a>00619 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>) <a name="l00620"></a>00620 set_config_int(section, <span class="stringliteral">"windowed"</span>, <a name="l00621"></a>00621 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_WINDOWED)); <a name="l00622"></a>00622 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>) <a name="l00623"></a>00623 set_config_int(section, <span class="stringliteral">"video_memory_policy"</span>, <a name="l00624"></a>00624 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_VIDEO_MEMORY_POLICY)); <a name="l00625"></a>00625 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>) <a name="l00626"></a>00626 set_config_int(section, <span class="stringliteral">"sample_buffers"</span>, <a name="l00627"></a>00627 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_SAMPLE_BUFFERS)); <a name="l00628"></a>00628 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>) <a name="l00629"></a>00629 set_config_int(section, <span class="stringliteral">"samples"</span>, <a name="l00630"></a>00630 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_SAMPLES)); <a name="l00631"></a>00631 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>) <a name="l00632"></a>00632 set_config_int(section, <span class="stringliteral">"float_color"</span>, <a name="l00633"></a>00633 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_FLOAT_COLOR)); <a name="l00634"></a>00634 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>) <a name="l00635"></a>00635 set_config_int(section, <span class="stringliteral">"float_depth"</span>, <a name="l00636"></a>00636 <a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_FLOAT_Z)); <a name="l00637"></a>00637 <a name="l00638"></a>00638 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g839ae567340a64a97480e6abf1743b5f" title="Reject other values for these settings.">AGL_REQUIRE</a>) <a name="l00639"></a>00639 <a class="code" href="alleggl_8c.html#40fb22e20a933efa9a33ff4098daa3e3">build_settings</a>(<a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_REQUIRE), section, <span class="stringliteral">"require"</span>); <a name="l00640"></a>00640 <span class="keywordflow">if</span> (save & <a class="code" href="group__settings.html#g5a1518fe9c1b44beb7f5bdcc42b6b8f1" title="Prefer the assigned values for these settings.">AGL_SUGGEST</a>) <a name="l00641"></a>00641 <a class="code" href="alleggl_8c.html#40fb22e20a933efa9a33ff4098daa3e3">build_settings</a>(<a class="code" href="group__settings.html#g2179291ddb3cb528c3c0cf84af5c51a9" title="Reads the setting of a configuration option.">allegro_gl_get</a>(AGL_SUGGEST), section, <span class="stringliteral">"suggest"</span>); <a name="l00642"></a>00642 } <a name="l00643"></a>00643 <a name="l00644"></a>00644 <a name="l00645"></a>00645 <a name="l00646"></a>00646 <span class="comment">/* Parses an input string to read settings */</span> <a name="l00647"></a><a class="code" href="alleggl_8c.html#9020a1b0f0f4d0e7524b2d13b912a755">00647</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="alleggl_8c.html#9020a1b0f0f4d0e7524b2d13b912a755">agl_parse_section</a>(<span class="keywordtype">int</span> sec, <span class="keywordtype">char</span> *section, <span class="keywordtype">char</span> *name) { <a name="l00648"></a>00648 <span class="keyword">const</span> <span class="keywordtype">char</span> *end; <a name="l00649"></a>00649 <span class="keywordtype">char</span> *buf; <a name="l00650"></a>00650 <span class="keywordtype">char</span> *ptr; <a name="l00651"></a>00651 <span class="keywordtype">int</span> strsize; <a name="l00652"></a>00652 <span class="keywordtype">int</span> opt = 0; <a name="l00653"></a>00653 <a name="l00654"></a>00654 end = get_config_string(section, name, <span class="stringliteral">""</span>); <a name="l00655"></a>00655 strsize = ustrsizez(end); <a name="l00656"></a>00656 <a name="l00657"></a>00657 buf = (<span class="keywordtype">char</span>*)malloc(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * strsize); <a name="l00658"></a>00658 <a name="l00659"></a>00659 <span class="keywordflow">if</span> (!buf) { <a name="l00660"></a>00660 TRACE(<a class="code" href="aglf_8c.html#8c04b6ea901068c5cc4020e9a18c0cbe">PREFIX_E</a> <span class="stringliteral">"parse_section: Ran out of memory "</span> <a name="l00661"></a>00661 <span class="stringliteral">"while trying to allocate %i bytes!"</span>, <a name="l00662"></a>00662 (<span class="keywordtype">int</span>)<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * strsize); <a name="l00663"></a>00663 <span class="keywordflow">return</span>; <a name="l00664"></a>00664 } <a name="l00665"></a>00665 <a name="l00666"></a>00666 memcpy(buf, end, strsize); <a name="l00667"></a>00667 end = buf + strsize; <a name="l00668"></a>00668 ptr = buf; <a name="l00669"></a>00669 <a name="l00670"></a>00670 <span class="keywordflow">while</span> (ptr < end) { <a name="l00671"></a>00671 <span class="keywordtype">char</span> *s = ustrtok_r(ptr, <span class="stringliteral">" ;|+"</span>, &ptr); <a name="l00672"></a>00672 <a name="l00673"></a>00673 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"allegro_format"</span>)) <a name="l00674"></a>00674 opt |= <a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>; <a name="l00675"></a>00675 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"red_depth"</span>)) <a name="l00676"></a>00676 opt |= <a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>; <a name="l00677"></a>00677 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"green_depth"</span>)) <a name="l00678"></a>00678 opt |= <a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>; <a name="l00679"></a>00679 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"blue_depth"</span>)) <a name="l00680"></a>00680 opt |= <a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>; <a name="l00681"></a>00681 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"alpha_depth"</span>)) <a name="l00682"></a>00682 opt |= <a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>; <a name="l00683"></a>00683 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"color_depth"</span>)) <a name="l00684"></a>00684 opt |= <a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>; <a name="l00685"></a>00685 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"accum_red_depth"</span>)) <a name="l00686"></a>00686 opt |= <a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>; <a name="l00687"></a>00687 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"accum_green_depth"</span>)) <a name="l00688"></a>00688 opt |= <a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>; <a name="l00689"></a>00689 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"accum_blue_depth"</span>)) <a name="l00690"></a>00690 opt |= <a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>; <a name="l00691"></a>00691 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"accum_alpha_depth"</span>)) <a name="l00692"></a>00692 opt |= <a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>; <a name="l00693"></a>00693 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"double_buffer"</span>)) <a name="l00694"></a>00694 opt |= <a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>; <a name="l00695"></a>00695 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"stereo_display"</span>)) <a name="l00696"></a>00696 opt |= <a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>; <a name="l00697"></a>00697 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"aux_buffers"</span>)) <a name="l00698"></a>00698 opt |= <a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>; <a name="l00699"></a>00699 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"z_depth"</span>)) <a name="l00700"></a>00700 opt |= <a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>; <a name="l00701"></a>00701 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"stencil_depth"</span>)) <a name="l00702"></a>00702 opt |= <a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>; <a name="l00703"></a>00703 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"window_x"</span>)) <a name="l00704"></a>00704 opt |= <a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>; <a name="l00705"></a>00705 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"window_y"</span>)) <a name="l00706"></a>00706 opt |= <a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>; <a name="l00707"></a>00707 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"fullscreen"</span>)) <a name="l00708"></a>00708 opt |= <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>; <a name="l00709"></a>00709 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"windowed"</span>)) <a name="l00710"></a>00710 opt |= <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>; <a name="l00711"></a>00711 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"video_memory_policy"</span>)) <a name="l00712"></a>00712 opt |= <a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>; <a name="l00713"></a>00713 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"sample_buffers"</span>)) <a name="l00714"></a>00714 opt |= <a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>; <a name="l00715"></a>00715 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"samples"</span>)) <a name="l00716"></a>00716 opt |= <a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>; <a name="l00717"></a>00717 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"float_color"</span>)) <a name="l00718"></a>00718 opt |= <a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>; <a name="l00719"></a>00719 <span class="keywordflow">if</span> (!ustrcmp(s, <span class="stringliteral">"float_depth"</span>)) <a name="l00720"></a>00720 opt |= <a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>; <a name="l00721"></a>00721 } <a name="l00722"></a>00722 <a name="l00723"></a>00723 free(buf); <a name="l00724"></a>00724 <a name="l00725"></a>00725 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(sec, opt); <a name="l00726"></a>00726 } <a name="l00727"></a>00727 <a name="l00728"></a>00728 <a name="l00729"></a>00729 <a name="l00730"></a>00730 <span class="comment">/* void allegro_gl_load_settings() */</span> <a name="l00741"></a><a class="code" href="group__settings.html#g60a577d2fed019cdae83c648f1ff74ec">00741</a> <span class="keywordtype">void</span> <a class="code" href="group__settings.html#g60a577d2fed019cdae83c648f1ff74ec" title="Loads the settings from the current config file, in the section [OpenGL].">allegro_gl_load_settings</a>() { <a name="l00742"></a>00742 <a name="l00743"></a>00743 <span class="keywordtype">int</span> <span class="keyword">set</span>; <a name="l00744"></a>00744 <span class="keywordtype">char</span> *section = <span class="stringliteral">"OpenGL"</span>; <a name="l00745"></a>00745 <a name="l00746"></a>00746 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"allegro_format"</span>, -1); <a name="l00747"></a>00747 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00748"></a>00748 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gb34e1290cbeb5fe252642f3bd59f0a52" title="Use Allegro-compatible framebuffer.">AGL_ALLEGRO_FORMAT</a>, <span class="keyword">set</span>); <a name="l00749"></a>00749 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"red_depth"</span>, -1); <a name="l00750"></a>00750 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00751"></a>00751 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gbe75eb7c907fedeef4763ad6c3ffd8f0" title="Select the red depth of the frame buffer.">AGL_RED_DEPTH</a>, <span class="keyword">set</span>); <a name="l00752"></a>00752 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"green_depth"</span>, -1); <a name="l00753"></a>00753 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00754"></a>00754 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gda8f8e9bb4e0ccf1bf7f7353d1e6032d" title="Select the green depth of the frame buffer.">AGL_GREEN_DEPTH</a>, <span class="keyword">set</span>); <a name="l00755"></a>00755 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"blue_depth"</span>, -1); <a name="l00756"></a>00756 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00757"></a>00757 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g8efacc076a3d6523dd989211833c1ca8" title="Select the blue depth of the frame buffer.">AGL_BLUE_DEPTH</a>, <span class="keyword">set</span>); <a name="l00758"></a>00758 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"alpha_depth"</span>, -1); <a name="l00759"></a>00759 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00760"></a>00760 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gd37b2a655ca53a34bb41bc629c8aa51e" title="Select the alpha depth of the frame buffer.">AGL_ALPHA_DEPTH</a>, <span class="keyword">set</span>); <a name="l00761"></a>00761 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"color_depth"</span>, -1); <a name="l00762"></a>00762 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00763"></a>00763 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g71846e567336fe02f8f063af1282ddc5" title="Specify the total color depth of the frame buffer.">AGL_COLOR_DEPTH</a>, <span class="keyword">set</span>); <a name="l00764"></a>00764 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"accum_red_depth"</span>, -1); <a name="l00765"></a>00765 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00766"></a>00766 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g317622005a4a2956a0d1659d3c47822a" title="Select the red depth of the accumulator buffer.">AGL_ACC_RED_DEPTH</a>, <span class="keyword">set</span>); <a name="l00767"></a>00767 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"accum_green_depth"</span>, -1); <a name="l00768"></a>00768 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00769"></a>00769 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g00f4cfb4cb19b60d677b6941fec903ba" title="Select the green depth of the accumulator buffer.">AGL_ACC_GREEN_DEPTH</a>, <span class="keyword">set</span>); <a name="l00770"></a>00770 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"accum_blue_depth"</span>, -1); <a name="l00771"></a>00771 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00772"></a>00772 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gf80c6da60114ac3962aabcfd8745b97e" title="Select the blue depth of the accumulator buffer.">AGL_ACC_BLUE_DEPTH</a>, <span class="keyword">set</span>); <a name="l00773"></a>00773 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"accum_alpha_depth"</span>, -1); <a name="l00774"></a>00774 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00775"></a>00775 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gb8eba4f52cdb3d333b237c0ab0b3594a" title="Select the alpha depth of the accumulator buffer.">AGL_ACC_ALPHA_DEPTH</a>, <span class="keyword">set</span>); <a name="l00776"></a>00776 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"double_buffer"</span>, -1); <a name="l00777"></a>00777 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00778"></a>00778 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#ga1150ae35d6ff9b33d5771f29f9770dd" title="Creates a backbuffer if set.">AGL_DOUBLEBUFFER</a>, <span class="keyword">set</span>); <a name="l00779"></a>00779 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"stereo_display"</span>, -1); <a name="l00780"></a>00780 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00781"></a>00781 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g47be892718fa4b2c6166caf51da67489" title="Creates seperate left/right buffers for stereo display.">AGL_STEREO</a>, <span class="keyword">set</span>); <a name="l00782"></a>00782 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"aux_buffers"</span>, -1); <a name="l00783"></a>00783 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00784"></a>00784 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g6267cbe7841d12c35d59032f66b7b871" title="Creates additional auxiliary buffers.">AGL_AUX_BUFFERS</a>, <span class="keyword">set</span>); <a name="l00785"></a>00785 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"z_depth"</span>, -1); <a name="l00786"></a>00786 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00787"></a>00787 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gbef24a727709a823e8fc900fdb72892e" title="Select the depth of the z-buffer.">AGL_Z_DEPTH</a>, <span class="keyword">set</span>); <a name="l00788"></a>00788 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"stencil_depth"</span>, -1); <a name="l00789"></a>00789 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00790"></a>00790 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g7b34772508e08edb0436e85d2d696fb9" title="Select the depth of the stencil buffer.">AGL_STENCIL_DEPTH</a>, <span class="keyword">set</span>); <a name="l00791"></a>00791 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"window_x"</span>, -1); <a name="l00792"></a>00792 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00793"></a>00793 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gfea8132efd1fcac7a7f997ef0fe34cfa" title="Requests a placement of the window to a specified pixel location.">AGL_WINDOW_X</a>, <span class="keyword">set</span>); <a name="l00794"></a>00794 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"window_y"</span>, -1); <a name="l00795"></a>00795 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00796"></a>00796 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g80b7ef911d06ddee6d94d528cc6d914a" title="Same as AGL_WINDOW_X, but for the y-axis.">AGL_WINDOW_Y</a>, <span class="keyword">set</span>); <a name="l00797"></a>00797 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"fullscreen"</span>, -1); <a name="l00798"></a>00798 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00799"></a>00799 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>, <span class="keyword">set</span>); <a name="l00800"></a>00800 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"windowed"</span>, -1); <a name="l00801"></a>00801 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00802"></a>00802 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>, <span class="keyword">set</span>); <a name="l00803"></a>00803 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"video_memory_policy"</span>, -1); <a name="l00804"></a>00804 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00805"></a>00805 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gb78a9c8ca24294b008d706a409c4fa37" title="Define AllegroGL's policy relative to video memory usage.">AGL_VIDEO_MEMORY_POLICY</a>, <span class="keyword">set</span>); <a name="l00806"></a>00806 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"sample_buffers"</span>, -1); <a name="l00807"></a>00807 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00808"></a>00808 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#ge1836cab58a366c122ace31160fe0e06" title="Define multisample parameters Some OpenGL ICDs expose an extension called GL_ARB_multisample...">AGL_SAMPLE_BUFFERS</a>, <span class="keyword">set</span>); <a name="l00809"></a>00809 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"samples"</span>, -1); <a name="l00810"></a>00810 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00811"></a>00811 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g92d9751c38774297013087e89a25749d" title="Define multisample samples Set this value to the number of samples that can be accepted...">AGL_SAMPLES</a>, <span class="keyword">set</span>); <a name="l00812"></a>00812 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"float_color"</span>, -1); <a name="l00813"></a>00813 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00814"></a>00814 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#gfeffd285319ab06291f90d03ff8b2482" title="Floating-point Color buffer.">AGL_FLOAT_COLOR</a>, <span class="keyword">set</span>); <a name="l00815"></a>00815 <span class="keyword">set</span> = get_config_int(section, <span class="stringliteral">"float_depth"</span>, -1); <a name="l00816"></a>00816 <span class="keywordflow">if</span> (<span class="keyword">set</span> != -1) <a name="l00817"></a>00817 <a class="code" href="group__settings.html#g025e79a4394803a0e15aaf07b1a8a656" title="Sets a configuration option.">allegro_gl_set</a>(<a class="code" href="group__settings.html#g468710b6f682956d724f984ab7fa8e02" title="Floating-point Depth buffer.">AGL_FLOAT_Z</a>, <span class="keyword">set</span>); <a name="l00818"></a>00818 <a name="l00819"></a>00819 <a class="code" href="alleggl_8c.html#9020a1b0f0f4d0e7524b2d13b912a755">agl_parse_section</a>(<a class="code" href="group__settings.html#g839ae567340a64a97480e6abf1743b5f" title="Reject other values for these settings.">AGL_REQUIRE</a>, section, <span class="stringliteral">"require"</span>); <a name="l00820"></a>00820 <a class="code" href="alleggl_8c.html#9020a1b0f0f4d0e7524b2d13b912a755">agl_parse_section</a>(<a class="code" href="group__settings.html#g5a1518fe9c1b44beb7f5bdcc42b6b8f1" title="Prefer the assigned values for these settings.">AGL_SUGGEST</a>, section, <span class="stringliteral">"suggest"</span>); <a name="l00821"></a>00821 } <a name="l00822"></a>00822 <a name="l00823"></a>00823 <a name="l00824"></a>00824 <a name="l00825"></a>00825 <span class="comment">/* int install_allegro_gl(void) */</span> <a name="l00836"></a><a class="code" href="group__core.html#ga0cbb82fa1e2bae6788eb7bd06673bd3">00836</a> <span class="keywordtype">int</span> <a class="code" href="group__core.html#ga0cbb82fa1e2bae6788eb7bd06673bd3" title="Installs the AllegroGL addon to Allegro.">install_allegro_gl</a>(<span class="keywordtype">void</span>) <a name="l00837"></a>00837 { <a name="l00838"></a>00838 <span class="keywordflow">if</span> (!system_driver) <a name="l00839"></a>00839 <span class="keywordflow">return</span> -1; <a name="l00840"></a>00840 <a name="l00841"></a>00841 <span class="keywordflow">if</span> (atexit(<a class="code" href="group__core.html#geff6abbb1d1071a01f4cd694ef504298" title="Removes the AllegroGL addon.">remove_allegro_gl</a>)) <a name="l00842"></a>00842 <span class="keywordflow">return</span> -1; <a name="l00843"></a>00843 <a name="l00844"></a>00844 <span class="keywordflow">if</span> (system_driver->gfx_drivers) <a name="l00845"></a>00845 <a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a> = system_driver->gfx_drivers; <a name="l00846"></a>00846 <span class="keywordflow">else</span> <a name="l00847"></a>00847 <a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a> = <a class="code" href="alleggl_8c.html#ad021ddbdff0236b4a10ab5aa6af8d85">list_saved_gfx_drivers</a>; <a name="l00848"></a>00848 <a name="l00849"></a>00849 system_driver->gfx_drivers = <a class="code" href="alleggl_8c.html#8bfd290ff50878a432c36efaf494a856">our_gfx_drivers</a>; <a name="l00850"></a>00850 <a name="l00851"></a>00851 <a class="code" href="group__settings.html#gdd1249980001c22cb3eba880561a7e19" title="Clear the option settings All settings are set to their default values, and marked...">allegro_gl_clear_settings</a>(); <a name="l00852"></a>00852 <a name="l00853"></a>00853 <span class="comment">/* Save and replace old blit_between_formats methods */</span> <a name="l00854"></a>00854 <span class="preprocessor">#ifdef ALLEGRO_COLOR8</span> <a name="l00855"></a>00855 <span class="preprocessor"></span> <a class="code" href="alleggl_8c.html#d05d1a03b46ff2f05841d3c2cc7ec5bd">__blit_between_formats8</a> = __linear_vtable8.blit_between_formats; <a name="l00856"></a>00856 __linear_vtable8.blit_between_formats = <a name="l00857"></a>00857 <a class="code" href="group__glvtable.html#g9f6042da85f5738a43821f83d491a772">allegro_gl_memory_blit_between_formats</a>; <a name="l00858"></a>00858 <span class="preprocessor">#endif</span> <a name="l00859"></a>00859 <span class="preprocessor"></span><span class="preprocessor">#ifdef ALLEGRO_COLOR16</span> <a name="l00860"></a>00860 <span class="preprocessor"></span> <a class="code" href="alleggl_8c.html#d93b412d24f734a1f8ac91df7031b8d9">__blit_between_formats15</a> = __linear_vtable15.blit_between_formats; <a name="l00861"></a>00861 __linear_vtable15.blit_between_formats = <a name="l00862"></a>00862 <a class="code" href="group__glvtable.html#g9f6042da85f5738a43821f83d491a772">allegro_gl_memory_blit_between_formats</a>; <a name="l00863"></a>00863 <a class="code" href="alleggl_8c.html#61b31e9c00583f1f6a7493a3f9ae57f6">__blit_between_formats16</a> = __linear_vtable16.blit_between_formats; <a name="l00864"></a>00864 __linear_vtable16.blit_between_formats <a name="l00865"></a>00865 = <a class="code" href="group__glvtable.html#g9f6042da85f5738a43821f83d491a772">allegro_gl_memory_blit_between_formats</a>; <a name="l00866"></a>00866 <span class="preprocessor">#endif</span> <a name="l00867"></a>00867 <span class="preprocessor"></span><span class="preprocessor">#ifdef ALLEGRO_COLOR24</span> <a name="l00868"></a>00868 <span class="preprocessor"></span> <a class="code" href="alleggl_8c.html#dcd1ff2e3c7d2a4e9dd5573a72923554">__blit_between_formats24</a> = __linear_vtable24.blit_between_formats; <a name="l00869"></a>00869 __linear_vtable24.blit_between_formats <a name="l00870"></a>00870 = <a class="code" href="group__glvtable.html#g9f6042da85f5738a43821f83d491a772">allegro_gl_memory_blit_between_formats</a>; <a name="l00871"></a>00871 <span class="preprocessor">#endif</span> <a name="l00872"></a>00872 <span class="preprocessor"></span><span class="preprocessor">#ifdef ALLEGRO_COLOR32</span> <a name="l00873"></a>00873 <span class="preprocessor"></span> <a class="code" href="alleggl_8c.html#02dbd9fcc2542ce36c900ac579fcd8d9">__blit_between_formats32</a> = __linear_vtable32.blit_between_formats; <a name="l00874"></a>00874 __linear_vtable32.blit_between_formats <a name="l00875"></a>00875 = <a class="code" href="group__glvtable.html#g9f6042da85f5738a43821f83d491a772">allegro_gl_memory_blit_between_formats</a>; <a name="l00876"></a>00876 <span class="preprocessor">#endif</span> <a name="l00877"></a>00877 <span class="preprocessor"></span> <a name="l00878"></a>00878 usetc(<a class="code" href="alleggl_8h.html#56226bbab6a0dfb87493cd5f94b80876">allegro_gl_error</a>, 0); <a name="l00879"></a>00879 <a name="l00880"></a>00880 <span class="keywordflow">return</span> 0; <a name="l00881"></a>00881 } <a name="l00882"></a>00882 <a name="l00883"></a>00883 <a name="l00884"></a>00884 <a name="l00885"></a>00885 <span class="comment">/* void remove_allegro_gl(void) */</span> <a name="l00894"></a><a class="code" href="group__core.html#geff6abbb1d1071a01f4cd694ef504298">00894</a> <span class="keywordtype">void</span> <a class="code" href="group__core.html#geff6abbb1d1071a01f4cd694ef504298" title="Removes the AllegroGL addon.">remove_allegro_gl</a>(<span class="keywordtype">void</span>) <a name="l00895"></a>00895 { <a name="l00896"></a>00896 <span class="keywordflow">if</span> ((!system_driver) || (!<a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a>)) <a name="l00897"></a>00897 <span class="keywordflow">return</span>; <a name="l00898"></a>00898 <a name="l00899"></a>00899 <span class="keywordflow">if</span> (<a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a> == &<a class="code" href="alleggl_8c.html#ad021ddbdff0236b4a10ab5aa6af8d85">list_saved_gfx_drivers</a>) <a name="l00900"></a>00900 system_driver->gfx_drivers = NULL; <a name="l00901"></a>00901 <span class="keywordflow">else</span> <a name="l00902"></a>00902 system_driver->gfx_drivers = <a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a>; <a name="l00903"></a>00903 <a name="l00904"></a>00904 <span class="comment">/* This function may be called twice (once by a user explicit call</span> <a name="l00905"></a>00905 <span class="comment"> * and once again at exit since the function is registered with at_exit)</span> <a name="l00906"></a>00906 <span class="comment"> * In order to prevent crashes, 'saved_gfx_drivers' is set to NULL</span> <a name="l00907"></a>00907 <span class="comment"> */</span> <a name="l00908"></a>00908 <a class="code" href="alleggl_8c.html#d87e1f6cfc73f0d89ac2ef93fb3c08f5">saved_gfx_drivers</a> = NULL; <a name="l00909"></a>00909 <a name="l00910"></a>00910 <span class="comment">/* Restore the blit_between_formats methods */</span> <a name="l00911"></a>00911 <span class="preprocessor"> #ifdef ALLEGRO_COLOR8</span> <a name="l00912"></a>00912 <span class="preprocessor"></span> __linear_vtable8.blit_between_formats = <a class="code" href="alleggl_8c.html#d05d1a03b46ff2f05841d3c2cc7ec5bd">__blit_between_formats8</a>; <a name="l00913"></a>00913 <span class="preprocessor"> #endif</span> <a name="l00914"></a>00914 <span class="preprocessor"></span><span class="preprocessor"> #ifdef ALLEGRO_COLOR16</span> <a name="l00915"></a>00915 <span class="preprocessor"></span> __linear_vtable15.blit_between_formats = <a class="code" href="alleggl_8c.html#d93b412d24f734a1f8ac91df7031b8d9">__blit_between_formats15</a>; <a name="l00916"></a>00916 __linear_vtable16.blit_between_formats = <a class="code" href="alleggl_8c.html#61b31e9c00583f1f6a7493a3f9ae57f6">__blit_between_formats16</a>; <a name="l00917"></a>00917 <span class="preprocessor"> #endif</span> <a name="l00918"></a>00918 <span class="preprocessor"></span><span class="preprocessor"> #ifdef ALLEGRO_COLOR24</span> <a name="l00919"></a>00919 <span class="preprocessor"></span> __linear_vtable24.blit_between_formats = <a class="code" href="alleggl_8c.html#dcd1ff2e3c7d2a4e9dd5573a72923554">__blit_between_formats24</a>; <a name="l00920"></a>00920 <span class="preprocessor"> #endif</span> <a name="l00921"></a>00921 <span class="preprocessor"></span><span class="preprocessor"> #ifdef ALLEGRO_COLOR32</span> <a name="l00922"></a>00922 <span class="preprocessor"></span> __linear_vtable32.blit_between_formats = <a class="code" href="alleggl_8c.html#02dbd9fcc2542ce36c900ac579fcd8d9">__blit_between_formats32</a>; <a name="l00923"></a>00923 <span class="preprocessor"> #endif</span> <a name="l00924"></a>00924 <span class="preprocessor"></span>} <a name="l00925"></a>00925 <a name="l00926"></a>00926 <a name="l00927"></a>00927 <a name="l00928"></a>00928 <span class="comment">/* void allegro_gl_flip(void) */</span> <a name="l00951"></a><a class="code" href="group__core.html#gf5aad043e99b766393fa4a7ec034a0f1">00951</a> <span class="keywordtype">void</span> <a class="code" href="group__core.html#gf5aad043e99b766393fa4a7ec034a0f1" title="Flips the front and back framebuffers.">allegro_gl_flip</a>(<span class="keywordtype">void</span>) <a name="l00952"></a>00952 { <a name="l00953"></a>00953 <a class="code" href="alleggl_8c.html#5367a90beaa783cd9c718b9f04581569">__allegro_gl_driver</a>-><a class="code" href="structallegro__gl__driver.html#51215a6628e2ea176ca1c7ca4dc28777">flip</a>(); <a name="l00954"></a>00954 } <a name="l00955"></a>00955 <a name="l00956"></a>00956 <a name="l00957"></a>00957 <a name="l00958"></a>00958 <span class="comment">/* float allegro_gl_opengl_version() */</span> <a name="l00971"></a><a class="code" href="group__core.html#g444d507eaeb5ba800787f6a81827615d">00971</a> <span class="keywordtype">float</span> <a class="code" href="group__core.html#g444d507eaeb5ba800787f6a81827615d" title="Returns the OpenGL version number of the client (the computer the program is running...">allegro_gl_opengl_version</a>() { <a name="l00972"></a>00972 <a name="l00973"></a>00973 <span class="keyword">const</span> <span class="keywordtype">char</span> *str; <a name="l00974"></a>00974 <a name="l00975"></a>00975 <span class="keywordflow">if</span> (!<a class="code" href="alleggl_8c.html#1cf577416af8a45cce479746114d7acb">__allegro_gl_valid_context</a>) <a name="l00976"></a>00976 <span class="keywordflow">return</span> 0.0f; <a name="l00977"></a>00977 <a name="l00978"></a>00978 str = (<span class="keyword">const</span> <span class="keywordtype">char</span>*)glGetString(GL_VERSION); <a name="l00979"></a>00979 <a name="l00980"></a>00980 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.0 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.0.0 "</span>, 6) == 0)) <a name="l00981"></a>00981 <span class="keywordflow">return</span> 1.0; <a name="l00982"></a>00982 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.1 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.1.0 "</span>, 6) == 0)) <a name="l00983"></a>00983 <span class="keywordflow">return</span> 1.1; <a name="l00984"></a>00984 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.2 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.2.0 "</span>, 6) == 0)) <a name="l00985"></a>00985 <span class="keywordflow">return</span> 1.2; <a name="l00986"></a>00986 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.2.1 "</span>, 6) == 0)) <a name="l00987"></a>00987 <span class="keywordflow">return</span> 1.21; <a name="l00988"></a>00988 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.2.2 "</span>, 6) == 0)) <a name="l00989"></a>00989 <span class="keywordflow">return</span> 1.22; <a name="l00990"></a>00990 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.3 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.3.0 "</span>, 6) == 0)) <a name="l00991"></a>00991 <span class="keywordflow">return</span> 1.3; <a name="l00992"></a>00992 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.4 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.4.0 "</span>, 6) == 0)) <a name="l00993"></a>00993 <span class="keywordflow">return</span> 1.4; <a name="l00994"></a>00994 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"1.5 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"1.5.0 "</span>, 6) == 0)) <a name="l00995"></a>00995 <span class="keywordflow">return</span> 1.5; <a name="l00996"></a>00996 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"2.0 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"2.0.0 "</span>, 6) == 0)) <a name="l00997"></a>00997 <span class="keywordflow">return</span> 2.0; <a name="l00998"></a>00998 <span class="keywordflow">if</span> ((strncmp(str, <span class="stringliteral">"2.1 "</span>, 4) == 0) || (strncmp(str, <span class="stringliteral">"2.1.0 "</span>, 6) == 0)) <a name="l00999"></a>00999 <span class="keywordflow">return</span> 2.1; <a name="l01000"></a>01000 <a name="l01001"></a>01001 <span class="comment">/* The OpenGL driver does not return a version</span> <a name="l01002"></a>01002 <span class="comment"> * number. However it probably supports at least OpenGL 1.0</span> <a name="l01003"></a>01003 <span class="comment"> */</span> <a name="l01004"></a>01004 <span class="keywordflow">if</span> (!str) { <a name="l01005"></a>01005 <span class="keywordflow">return</span> 1.0; <a name="l01006"></a>01006 } <a name="l01007"></a>01007 <a name="l01008"></a>01008 <span class="keywordflow">return</span> atof(str); <a name="l01009"></a>01009 } <a name="l01010"></a>01010 <a name="l01011"></a>01011 <a name="l01012"></a>01012 <a name="l01013"></a><a class="code" href="alleggl_8c.html#1648560e7a8d944f2cc700f420374da2">01013</a> <span class="keywordtype">void</span> <a class="code" href="alleggl_8c.html#1648560e7a8d944f2cc700f420374da2">__allegro_gl_set_allegro_image_format</a>(<span class="keywordtype">int</span> big_endian) <a name="l01014"></a>01014 { <a name="l01015"></a>01015 <span class="comment">/* Sets up Allegro to use OpenGL formats */</span> <a name="l01016"></a>01016 _rgb_r_shift_15 = 11; <a name="l01017"></a>01017 _rgb_g_shift_15 = 6; <a name="l01018"></a>01018 _rgb_b_shift_15 = 1; <a name="l01019"></a>01019 <a name="l01020"></a>01020 _rgb_r_shift_16 = 11; <a name="l01021"></a>01021 _rgb_g_shift_16 = 5; <a name="l01022"></a>01022 _rgb_b_shift_16 = 0; <a name="l01023"></a>01023 <a name="l01024"></a>01024 <span class="keywordflow">if</span> (big_endian) { <a name="l01025"></a>01025 _rgb_r_shift_24 = 16; <a name="l01026"></a>01026 _rgb_g_shift_24 = 8; <a name="l01027"></a>01027 _rgb_b_shift_24 = 0; <a name="l01028"></a>01028 <a name="l01029"></a>01029 _rgb_a_shift_32 = 0; <a name="l01030"></a>01030 _rgb_r_shift_32 = 24; <a name="l01031"></a>01031 _rgb_g_shift_32 = 16; <a name="l01032"></a>01032 _rgb_b_shift_32 = 8; <a name="l01033"></a>01033 } <a name="l01034"></a>01034 <span class="keywordflow">else</span> { <a name="l01035"></a>01035 _rgb_r_shift_24 = 0; <a name="l01036"></a>01036 _rgb_g_shift_24 = 8; <a name="l01037"></a>01037 _rgb_b_shift_24 = 16; <a name="l01038"></a>01038 <a name="l01039"></a>01039 _rgb_r_shift_32 = 0; <a name="l01040"></a>01040 _rgb_g_shift_32 = 8; <a name="l01041"></a>01041 _rgb_b_shift_32 = 16; <a name="l01042"></a>01042 _rgb_a_shift_32 = 24; <a name="l01043"></a>01043 } <a name="l01044"></a>01044 <a name="l01045"></a>01045 <span class="keywordflow">return</span>; <a name="l01046"></a>01046 } <a name="l01047"></a>01047 <a name="l01048"></a>01048 <a name="l01049"></a>01049 <a name="l01050"></a>01050 <span class="comment">/* allegro_gl_default_init:</span> <a name="l01051"></a>01051 <span class="comment"> * Sets a graphics mode according to the mode (fullscreen or windowed)</span> <a name="l01052"></a>01052 <span class="comment"> * requested by the user. If it fails to set up the mode then it tries</span> <a name="l01053"></a>01053 <span class="comment"> * (if available) the other one unless the user has "AGL_REQUIRED" the mode.</span> <a name="l01054"></a>01054 <span class="comment"> */</span> <a name="l01055"></a><a class="code" href="alleggl_8c.html#00396d2a89cb9f21be985de53e1df575">01055</a> <span class="keyword">static</span> BITMAP *<a class="code" href="alleggl_8c.html#00396d2a89cb9f21be985de53e1df575">allegro_gl_default_gfx_init</a>(<span class="keywordtype">int</span> <a class="code" href="structallegro__gl__display__info.html#1d55b9c63d30f160e9c1d9345e3c4847">w</a>, <span class="keywordtype">int</span> <a class="code" href="structallegro__gl__display__info.html#48a7f122157f65d1c7e4261cba6c5a89">h</a>, <span class="keywordtype">int</span> vw, <span class="keywordtype">int</span> vh, <a name="l01056"></a>01056 <span class="keywordtype">int</span> depth) <a name="l01057"></a>01057 { <a name="l01058"></a>01058 BITMAP* bmp = NULL; <a name="l01059"></a>01059 <a name="l01060"></a>01060 <span class="keywordflow">if</span> (<a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a>) { <a name="l01061"></a>01061 TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Trying to set up fullscreen mode.\n"</span>); <a name="l01062"></a>01062 <a name="l01063"></a>01063 <span class="preprocessor">#ifdef GFX_OPENGL_FULLSCREEN</span> <a name="l01064"></a>01064 <span class="preprocessor"></span> <span class="comment">/* Looks for fullscreen mode in our_driver_list */</span> <a name="l01065"></a>01065 gfx_driver = &<a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>; <a name="l01066"></a>01066 <a name="l01067"></a>01067 <span class="keywordflow">if</span> (<a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> & <a class="code" href="group__settings.html#g1baffefcedaffebf7ca47724a0441e60" title="Set if you'd like a full screen mode.">AGL_FULLSCREEN</a>) <a name="l01068"></a>01068 <span class="comment">/* Fullscreen mode required and found */</span> <a name="l01069"></a>01069 <span class="keywordflow">return</span> <a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>.init(w, h, vw, vh, depth); <a name="l01070"></a>01070 <span class="keywordflow">else</span> <a name="l01071"></a>01071 bmp = <a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>.init(w, h, vw, vh, depth); <a name="l01072"></a>01072 <a name="l01073"></a>01073 <span class="keywordflow">if</span> (bmp) <a name="l01074"></a>01074 <span class="comment">/* Fullscreen mode found but not required (probably suggested) */</span> <a name="l01075"></a>01075 <span class="keywordflow">return</span> bmp; <a name="l01076"></a>01076 <a name="l01077"></a>01077 <span class="preprocessor">#endif </span><span class="comment">/*GFX_OPENGL_FULLSCREEN*/</span> <a name="l01078"></a>01078 <a name="l01079"></a>01079 <span class="comment">/* Fullscreen mode not available but not required :</span> <a name="l01080"></a>01080 <span class="comment"> * let's try windowed mode :</span> <a name="l01081"></a>01081 <span class="comment"> */</span> <a name="l01082"></a>01082 TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Failed to set up fullscreen mode!\n"</span>); <a name="l01083"></a>01083 <span class="preprocessor">#ifdef GFX_OPENGL_WINDOWED</span> <a name="l01084"></a>01084 <span class="preprocessor"></span> TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Trying windowed mode...\n"</span>); <a name="l01085"></a>01085 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a> = FALSE; <a name="l01086"></a>01086 gfx_driver = &<a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>; <a name="l01087"></a>01087 <span class="keywordflow">return</span> <a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>.init(w, h, vw, vh, depth); <a name="l01088"></a>01088 <span class="preprocessor">#else</span> <a name="l01089"></a>01089 <span class="preprocessor"></span> <span class="keywordflow">return</span> NULL; <a name="l01090"></a>01090 <span class="preprocessor">#endif </span><span class="comment">/* GFX_OPENGL_WINDOWED */</span> <a name="l01091"></a>01091 } <a name="l01092"></a>01092 <span class="keywordflow">else</span> { <a name="l01093"></a>01093 TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Trying to set up windowed mode...\n"</span>); <a name="l01094"></a>01094 <a name="l01095"></a>01095 <span class="preprocessor">#ifdef GFX_OPENGL_WINDOWED</span> <a name="l01096"></a>01096 <span class="preprocessor"></span> <span class="comment">/* Looks for windowed mode in our_driver_list */</span> <a name="l01097"></a>01097 gfx_driver = &<a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>; <a name="l01098"></a>01098 <a name="l01099"></a>01099 <span class="keywordflow">if</span> (<a class="code" href="alleggl_8c.html#a2eae9f89b0113a34ca4bc74a1567e3c">__allegro_gl_required_settings</a> & <a class="code" href="group__settings.html#g6fcfd5d01183e704595b05fa9812b94f" title="Set if you'd like a windowed mode.">AGL_WINDOWED</a>) <a name="l01100"></a>01100 <span class="comment">/* Windowed mode required and found */</span> <a name="l01101"></a>01101 <span class="keywordflow">return</span> <a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>.init(w, h, vw, vh, depth); <a name="l01102"></a>01102 <span class="keywordflow">else</span> <a name="l01103"></a>01103 bmp = <a class="code" href="alleggl_8h.html#bfb526c49d9fb066ee80c45889caa9aa">gfx_allegro_gl_windowed</a>.init(w, h, vw, vh, depth); <a name="l01104"></a>01104 <a name="l01105"></a>01105 <span class="keywordflow">if</span> (bmp) <a name="l01106"></a>01106 <span class="comment">/* Windowed mode found but not required (probably suggested) */</span> <a name="l01107"></a>01107 <span class="keywordflow">return</span> bmp; <a name="l01108"></a>01108 <a name="l01109"></a>01109 <span class="preprocessor">#endif </span><span class="comment">/* GFX_OPENGL_WINDOWED */</span> <a name="l01110"></a>01110 <a name="l01111"></a>01111 <span class="comment">/* Windowed mode not available but not required :</span> <a name="l01112"></a>01112 <span class="comment"> * let's try fullscreen mode :</span> <a name="l01113"></a>01113 <span class="comment"> */</span> <a name="l01114"></a>01114 TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Failed to set up windowed mode...\n"</span>); <a name="l01115"></a>01115 <span class="preprocessor">#ifdef GFX_OPENGL_FULLSCREEN</span> <a name="l01116"></a>01116 <span class="preprocessor"></span> TRACE(<a class="code" href="alleggl_8c.html#09462782acac95f9a6da67adf659ed6e">PREFIX_I</a> <span class="stringliteral">"default_gfx_init: Trying fullscreen mode...\n"</span>); <a name="l01117"></a>01117 <a class="code" href="alleggl_8c.html#2c85176c3194da68f01306449426d6ca">allegro_gl_display_info</a>.<a class="code" href="structallegro__gl__display__info.html#74b3e5c7ee4f8c8aacc89f21bc0a46fc">fullscreen</a> = TRUE; <a name="l01118"></a>01118 gfx_driver = &<a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>; <a name="l01119"></a>01119 <span class="keywordflow">return</span> <a class="code" href="alleggl_8h.html#d939783cd83d7eee3227b608f4901441">gfx_allegro_gl_fullscreen</a>.init(w, h, vw, vh, depth); <a name="l01120"></a>01120 <span class="preprocessor">#else</span> <a name="l01121"></a>01121 <span class="preprocessor"></span> <span class="keywordflow">return</span> NULL; <a name="l01122"></a>01122 <span class="preprocessor">#endif </span><span class="comment">/*GFX_OPENGL_FULLSCREEN*/</span> <a name="l01123"></a>01123 } <a name="l01124"></a>01124 } <a name="l01125"></a>01125 <a name="l01126"></a>01126 <a name="l01127"></a>01127 <a name="l01128"></a>01128 <span class="comment">/* allegro_gl_set_blender_mode (GFX_DRIVER vtable entry):</span> <a name="l01129"></a>01129 <span class="comment"> * Sets the blending mode. Same implementation to all GFX vtables.</span> <a name="l01130"></a>01130 <span class="comment"> */</span> <a name="l01131"></a><a class="code" href="alleggl_8c.html#4e7f6038ebd76a511b6c2a787090699a">01131</a> <span class="keywordtype">void</span> <a class="code" href="alleggl_8c.html#4e7f6038ebd76a511b6c2a787090699a">allegro_gl_set_blender_mode</a>(<span class="keywordtype">int</span> mode, <span class="keywordtype">int</span> r, <span class="keywordtype">int</span> g, <span class="keywordtype">int</span> b, <span class="keywordtype">int</span> a) { <a name="l01132"></a>01132 <a class="code" href="alleggl_8c.html#480f9c7c69cd0af982451925cb6c25c8">__allegro_gl_blit_operation</a> = AGL_OP_BLEND; <a name="l01133"></a>01133 <span class="comment">/* These blenders do not need any special extensions. </span> <a name="l01134"></a>01134 <span class="comment"> * We specify only pixel arithmetic here. Blend equation and blend</span> <a name="l01135"></a>01135 <span class="comment"> * color (if available) are reset to defualt later.*/</span> <a name="l01136"></a>01136 <span class="keywordflow">switch</span> (mode) { <a name="l01137"></a>01137 <span class="keywordflow">case</span> blender_mode_none: <a name="l01138"></a>01138 glBlendFunc(GL_ONE, GL_ZERO); <a name="l01139"></a>01139 <span class="keywordflow">break</span>; <a name="l01140"></a>01140 <span class="keywordflow">case</span> blender_mode_alpha: <a name="l01141"></a>01141 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); <a name="l01142"></a>01142 <span class="keywordflow">break</span>; <a name="l01143"></a>01143 <span class="keywordflow">case</span> blender_mode_invert: <a name="l01144"></a>01144 glLogicOp(GL_COPY_INVERTED); <a name="l01145"></a>01145 <a class="code" href="alleggl_8c.html#480f9c7c69cd0af982451925cb6c25c8">__allegro_gl_blit_operation</a> = AGL_OP_LOGIC_OP; <a name="l01146"></a>01146 <span class="keywordflow">break</span>; <a name="l01147"></a>01147 <span class="keywordflow">case</span> blender_mode_multiply: <a name="l01148"></a>01148 glBlendFunc(GL_DST_COLOR, GL_ZERO); <a name="l01149"></a>01149 <span class="keywordflow">break</span>; <a name="l01150"></a>01150 } <a name="l01151"></a>01151 <a name="l01152"></a>01152 <span class="keywordflow">if</span> (<a class="code" href="group__core.html#g444d507eaeb5ba800787f6a81827615d" title="Returns the OpenGL version number of the client (the computer the program is running...">allegro_gl_opengl_version</a>() >= 1.4 || <a name="l01153"></a>01153 (<a class="code" href="group__core.html#g444d507eaeb5ba800787f6a81827615d" title="Returns the OpenGL version number of the client (the computer the program is running...">allegro_gl_opengl_version</a>() >= 1.2 && <a name="l01154"></a>01154 <a class="code" href="group__extensions.html#g7351f56ea1c4f4665193fc3bf547ff0a" title="This function is an helper to determine whether an OpenGL extension is available...">allegro_gl_is_extension_supported</a>(<span class="stringliteral">"ARB_imaging"</span>))) { <a name="l01155"></a>01155 <span class="comment">/* We're running a recent version of OpenGL and everything needed is here. */</span> <a name="l01156"></a>01156 <a name="l01157"></a>01157 glBlendColor(r / 255.f, g / 255.f, b / 255.f, a / 255.f); <a name="l01158"></a>01158 <a name="l01159"></a>01159 <span class="keywordflow">switch</span> (mode) { <a name="l01160"></a>01160 <span class="keywordflow">case</span> blender_mode_none: <a name="l01161"></a>01161 glBlendEquation(GL_FUNC_ADD); <a name="l01162"></a>01162 <span class="keywordflow">break</span>; <a name="l01163"></a>01163 <span class="keywordflow">case</span> blender_mode_alpha: <a name="l01164"></a>01164 glBlendEquation(GL_FUNC_ADD); <a name="l01165"></a>01165 <span class="keywordflow">break</span>; <a name="l01166"></a>01166 <span class="keywordflow">case</span> blender_mode_trans: <a name="l01167"></a>01167 glBlendEquation(GL_FUNC_ADD); <a name="l01168"></a>01168 glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); <a name="l01169"></a>01169 <span class="keywordflow">break</span>; <a name="l01170"></a>01170 <span class="keywordflow">case</span> blender_mode_add: <a name="l01171"></a>01171 glBlendEquation(GL_FUNC_ADD); <a name="l01172"></a>01172 glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE); <a name="l01173"></a>01173 <span class="keywordflow">break</span>; <a name="l01174"></a>01174 <span class="keywordflow">case</span> blender_mode_burn: <a name="l01175"></a>01175 glBlendEquation(GL_FUNC_SUBTRACT); <a name="l01176"></a>01176 glBlendFunc(GL_ONE, GL_CONSTANT_ALPHA); <a name="l01177"></a>01177 <span class="keywordflow">break</span>; <a name="l01178"></a>01178 <span class="keywordflow">case</span> blender_mode_dodge: <a name="l01179"></a>01179 glBlendEquation(GL_FUNC_ADD); <a name="l01180"></a>01180 glBlendFunc(GL_ONE, GL_CONSTANT_ALPHA); <a name="l01181"></a>01181 <span class="keywordflow">break</span>; <a name="l01182"></a>01182 <span class="keywordflow">case</span> blender_mode_multiply: <a name="l01183"></a>01183 glBlendEquation(GL_FUNC_ADD); <a name="l01184"></a>01184 <span class="keywordflow">break</span>; <a name="l01185"></a>01185 } <a name="l01186"></a>01186 <a name="l01187"></a>01187 <span class="keywordflow">return</span>; <a name="l01188"></a>01188 } <a name="l01189"></a>01189 <a name="l01190"></a>01190 <span class="comment">/* Check for presence of glBlendColor() and special parameters to</span> <a name="l01191"></a>01191 <span class="comment"> * glBlendFunc(). */</span> <a name="l01192"></a>01192 <span class="keywordflow">if</span> (<a class="code" href="group__extensions.html#g7351f56ea1c4f4665193fc3bf547ff0a" title="This function is an helper to determine whether an OpenGL extension is available...">allegro_gl_is_extension_supported</a>(<span class="stringliteral">"GL_EXT_blend_color"</span>)) { <a name="l01193"></a>01193 glBlendColorEXT(r / 255.f, g / 255.f, b / 255.f, a / 255.f); <a name="l01194"></a>01194 <a name="l01195"></a>01195 <span class="keywordflow">switch</span> (mode) { <a name="l01196"></a>01196 <span class="keywordflow">case</span> blender_mode_trans: <a name="l01197"></a>01197 glBlendFunc(GL_CONSTANT_ALPHA_EXT, GL_ONE_MINUS_CONSTANT_ALPHA_EXT); <a name="l01198"></a>01198 <span class="keywordflow">break</span>; <a name="l01199"></a>01199 <span class="keywordflow">case</span> blender_mode_add: <a name="l01200"></a>01200 glBlendFunc(GL_CONSTANT_ALPHA_EXT, GL_ONE); <a name="l01201"></a>01201 <span class="keywordflow">break</span>; <a name="l01202"></a>01202 <span class="keywordflow">case</span> blender_mode_burn: <a name="l01203"></a>01203 glBlendFunc(GL_ONE, GL_CONSTANT_ALPHA_EXT); <a name="l01204"></a>01204 <span class="keywordflow">break</span>; <a name="l01205"></a>01205 <span class="keywordflow">case</span> blender_mode_dodge: <a name="l01206"></a>01206 glBlendFunc(GL_ONE, GL_CONSTANT_ALPHA_EXT); <a name="l01207"></a>01207 <span class="keywordflow">break</span>; <a name="l01208"></a>01208 } <a name="l01209"></a>01209 } <a name="l01210"></a>01210 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mode == blender_mode_trans || <a name="l01211"></a>01211 mode == blender_mode_add || <a name="l01212"></a>01212 mode == blender_mode_burn || <a name="l01213"></a>01213 mode == blender_mode_dodge) { <a name="l01214"></a>01214 <span class="comment">/* glBlendColor() is not available and it is needed by the selected</span> <a name="l01215"></a>01215 <span class="comment"> * bledner. Bail out.*/</span> <a name="l01216"></a>01216 <span class="keywordflow">return</span>; <a name="l01217"></a>01217 } <a name="l01218"></a>01218 <a name="l01219"></a>01219 <span class="comment">/* Check for presence of glBlendEquation(). */</span> <a name="l01220"></a>01220 <span class="keywordflow">if</span> (<a class="code" href="group__extensions.html#g7351f56ea1c4f4665193fc3bf547ff0a" title="This function is an helper to determine whether an OpenGL extension is available...">allegro_gl_is_extension_supported</a>(<span class="stringliteral">"GL_EXT_blend_minmax"</span>)) { <a name="l01221"></a>01221 <span class="keywordflow">switch</span> (mode) { <a name="l01222"></a>01222 <span class="keywordflow">case</span> blender_mode_none: <a name="l01223"></a>01223 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01224"></a>01224 <span class="keywordflow">break</span>; <a name="l01225"></a>01225 <span class="keywordflow">case</span> blender_mode_alpha: <a name="l01226"></a>01226 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01227"></a>01227 <span class="keywordflow">break</span>; <a name="l01228"></a>01228 <span class="keywordflow">case</span> blender_mode_trans: <a name="l01229"></a>01229 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01230"></a>01230 <span class="keywordflow">break</span>; <a name="l01231"></a>01231 <span class="keywordflow">case</span> blender_mode_add: <a name="l01232"></a>01232 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01233"></a>01233 <span class="keywordflow">break</span>; <a name="l01234"></a>01234 <span class="keywordflow">case</span> blender_mode_dodge: <a name="l01235"></a>01235 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01236"></a>01236 <span class="keywordflow">break</span>; <a name="l01237"></a>01237 <span class="keywordflow">case</span> blender_mode_multiply: <a name="l01238"></a>01238 glBlendEquationEXT(GL_FUNC_ADD_EXT); <a name="l01239"></a>01239 <span class="keywordflow">break</span>; <a name="l01240"></a>01240 <span class="keywordflow">case</span> blender_mode_burn: <a name="l01241"></a>01241 <span class="keywordflow">if</span> (<a class="code" href="group__extensions.html#g7351f56ea1c4f4665193fc3bf547ff0a" title="This function is an helper to determine whether an OpenGL extension is available...">allegro_gl_is_extension_supported</a>(<span class="stringliteral">"GL_EXT_blend_subtract"</span>)) { <a name="l01242"></a>01242 glBlendEquationEXT(GL_FUNC_SUBTRACT_EXT); <a name="l01243"></a>01243 } <a name="l01244"></a>01244 <span class="keywordflow">else</span> { <a name="l01245"></a>01245 <span class="comment">/* GL_FUNC_SUBTRACT is not supported and it is needed by the</span> <a name="l01246"></a>01246 <span class="comment"> * selected blender. Bail out. */</span> <a name="l01247"></a>01247 <span class="keywordflow">return</span>; <a name="l01248"></a>01248 } <a name="l01249"></a>01249 <span class="keywordflow">break</span>; <a name="l01250"></a>01250 } <a name="l01251"></a>01251 } <a name="l01252"></a>01252 } <a name="l01253"></a>01253 <a name="l01254"></a>01254 <a name="l01255"></a>01255 <span class="preprocessor">#ifdef DEBUGMODE</span> <a name="l01256"></a>01256 <span class="preprocessor"></span><span class="preprocessor">#ifdef LOGLEVEL</span> <a name="l01257"></a>01257 <span class="preprocessor"></span> <a name="l01258"></a>01258 <span class="keywordtype">void</span> __allegro_gl_log(<span class="keywordtype">int</span> level, <span class="keyword">const</span> <span class="keywordtype">char</span> *str) <a name="l01259"></a>01259 { <a name="l01260"></a>01260 <span class="keywordflow">if</span> (level <= LOGLEVEL) <a name="l01261"></a>01261 TRACE(<a class="code" href="alleggl_8c.html#712f8992c7b07a796b254244c0e362c4">PREFIX_L</a> <span class="stringliteral">"[%d] %s"</span>, level, str); <a name="l01262"></a>01262 } <a name="l01263"></a>01263 <a name="l01264"></a>01264 <span class="preprocessor">#endif</span> <a name="l01265"></a>01265 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l01266"></a>01266 <span class="preprocessor"></span> </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 12 11:05:31 2007 for AllegroGL by <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>