1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>AllegroGL: Texture Routines</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="alleggl.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">AllegroGL <span id="projectnumber">0.4.4</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('group__texture.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<h1>Texture Routines</h1> </div>
</div>
<div class="contents">
<p>AllegroGL provides functions to allow using Allegro BITMAP objects to be used as OpenGL textures.
<a href="#_details">More...</a></p>
<h2><a name="member-group"></a>
Texture routines</h2>
<ul>
<li>int <a class="el" href="group__texture.html#gab5393ecc10a2a31da7eb80c889af89ac">allegro_gl_use_mipmapping</a> (int enable)
<dl class="el"><dd class="mdescRight">Tell AllegroGL to use Mipmapping or not when generating textures via its functions. <a href="#gab5393ecc10a2a31da7eb80c889af89ac"></a><br/></dl><li>int <a class="el" href="group__texture.html#ga1d88f4ebc7ed1ecd65640b72ea46a71e">allegro_gl_use_alpha_channel</a> (int enable)
<dl class="el"><dd class="mdescRight">Tell AllegroGL to use Alpha channel or not when generating textures via its functions. <a href="#ga1d88f4ebc7ed1ecd65640b72ea46a71e"></a><br/></dl><li>int <a class="el" href="group__texture.html#ga3ec0a1c4c6656f13c8398bab7a1293f2">allegro_gl_flip_texture</a> (int enable)
<dl class="el"><dd class="mdescRight">Tell AllegroGL to flip the texture vertically or not when generating textures via its functions, to conform to the usual OpenGL texture coordinate system (increasing upwards). <a href="#ga3ec0a1c4c6656f13c8398bab7a1293f2"></a><br/></dl><li>int <a class="el" href="group__texture.html#ga6996c14538e18b1614f91d34b2d4d691">allegro_gl_check_texture</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">Checks whether the specified bitmap is of the proper size for texturing. <a href="#ga6996c14538e18b1614f91d34b2d4d691"></a><br/></dl><li>int <a class="el" href="group__texture.html#gab0cf4dc0ddcb45f5b067d08aed1c88e6">allegro_gl_check_texture_ex</a> (int flags, BITMAP *bmp, GLint internal_format)
<dl class="el"><dd class="mdescRight">Checks whether the specified bitmap is of the proper size for texturing. <a href="#gab0cf4dc0ddcb45f5b067d08aed1c88e6"></a><br/></dl><li>GLint <a class="el" href="group__texture.html#ga2392fe7a8dd6db65532160821804aa68">allegro_gl_get_texture_format</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">Returns the OpenGL internal texture format for this bitmap. <a href="#ga2392fe7a8dd6db65532160821804aa68"></a><br/></dl><li>GLint <a class="el" href="group__texture.html#ga5d535e8af776dd449cc4755b9e3585b1">allegro_gl_set_texture_format</a> (GLint format)
<dl class="el"><dd class="mdescRight">Sets the color format you'd like OpenGL to use for its textures. <a href="#ga5d535e8af776dd449cc4755b9e3585b1"></a><br/></dl><li><a class="anchor" id="ga59f7129dd541d2e5a291d36bf90b7289"></a><!-- doxytag: member="texture::allegro_gl_get_bitmap_type" ref="ga59f7129dd541d2e5a291d36bf90b7289" args="(BITMAP *bmp)" -->
GLenum <a class="el" href="group__texture.html#ga59f7129dd541d2e5a291d36bf90b7289">allegro_gl_get_bitmap_type</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">AllegroGL will generate mipmaps for this texture. <br/></dl><li><a class="anchor" id="ga83b2b13cb35dd4b4e9e874173a246581"></a><!-- doxytag: member="texture::allegro_gl_get_bitmap_color_format" ref="ga83b2b13cb35dd4b4e9e874173a246581" args="(BITMAP *bmp)" -->
GLenum <a class="el" href="group__texture.html#ga83b2b13cb35dd4b4e9e874173a246581">allegro_gl_get_bitmap_color_format</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">AllegroGL will generate mipmaps for this texture. <br/></dl><li>GLuint <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9">allegro_gl_make_texture</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">Uploads an Allegro BITMAP to the GL driver as a texture. <a href="#gae071354f76bc28e1bafbd90bdecbc0c9"></a><br/></dl><li>GLuint <a class="el" href="group__texture.html#gaeb33dfbbc1725f5132c10ac32ef6800d">allegro_gl_make_masked_texture</a> (BITMAP *bmp)
<dl class="el"><dd class="mdescRight">Uploads an Allegro BITMAP to the GL driver as a texture. <a href="#gaeb33dfbbc1725f5132c10ac32ef6800d"></a><br/></dl><li>GLuint <a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a">allegro_gl_make_texture_ex</a> (int flags, BITMAP *bmp, GLint internal_format)
<dl class="el"><dd class="mdescRight">Uploads an Allegro BITMAP to the GL driver as a texture. <a href="#gaf3a48c555068e7051171255c1011150a"></a><br/></dl><li><a class="anchor" id="gabaf179e577a9328a751e92e3603f0746"></a><!-- doxytag: member="texture::AGL_TEXTURE_MIPMAP" ref="gabaf179e577a9328a751e92e3603f0746" args="" -->
#define <a class="el" href="group__texture.html#gabaf179e577a9328a751e92e3603f0746">AGL_TEXTURE_MIPMAP</a>   0x01
<dl class="el"><dd class="mdescRight">AllegroGL will generate mipmaps for this texture. <br/></dl><li><a class="anchor" id="ga8cc859eadf1610b424cd9188e716f432"></a><!-- doxytag: member="texture::AGL_TEXTURE_HAS_ALPHA" ref="ga8cc859eadf1610b424cd9188e716f432" args="" -->
#define <a class="el" href="group__texture.html#ga8cc859eadf1610b424cd9188e716f432">AGL_TEXTURE_HAS_ALPHA</a>   0x02
<dl class="el"><dd class="mdescRight">Tell AllegroGL that the bitmap had an alpha channel, so it should be preserved when generating the texture. <br/></dl><li>#define <a class="el" href="group__texture.html#gadeffe4feb290278035beacedb284a010">AGL_TEXTURE_FLIP</a>   0x04
<dl class="el"><dd class="mdescRight">Flip the texture on the x-axis. <a href="#gadeffe4feb290278035beacedb284a010"></a><br/></dl><li>#define <a class="el" href="group__texture.html#gaba184d573c65f33b35d1d57936607d08">AGL_TEXTURE_MASKED</a>   0x08
<dl class="el"><dd class="mdescRight">Generate an alpha channel for this texture, based on the Allegro mask color. <a href="#gaba184d573c65f33b35d1d57936607d08"></a><br/></dl><li>#define <a class="el" href="group__texture.html#gaa8b7246edc7ec019ec3b434eb0cacdf2">AGL_TEXTURE_RESCALE</a>   0x10
<dl class="el"><dd class="mdescRight">Tell AllegroGL to allow rescaling of the bitmap. <a href="#gaa8b7246edc7ec019ec3b434eb0cacdf2"></a><br/></dl><li><a class="anchor" id="gad67cfdfd21ef2cae75b03cb871e57f4a"></a><!-- doxytag: member="texture::AGL_TEXTURE_ALPHA_ONLY" ref="gad67cfdfd21ef2cae75b03cb871e57f4a" args="" -->
#define <a class="el" href="group__texture.html#gad67cfdfd21ef2cae75b03cb871e57f4a">AGL_TEXTURE_ALPHA_ONLY</a>   0x20
<dl class="el"><dd class="mdescRight">Tell AllegroGL that the specified BITMAP is an 8-bpp alpha-only BITMAP. <br/></dl></ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>AllegroGL provides functions to allow using Allegro BITMAP objects to be used as OpenGL textures. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gadeffe4feb290278035beacedb284a010"></a><!-- doxytag: member="alleggl.h::AGL_TEXTURE_FLIP" ref="gadeffe4feb290278035beacedb284a010" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_TEXTURE_FLIP   0x04</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Flip the texture on the x-axis. </p>
<p>OpenGL uses the bottom-left corner of the texture as (0,0), so if you need your texture to be flipped to make (0,0) the top-left corner, you need to use this flag. </p>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00529">529</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gaba184d573c65f33b35d1d57936607d08"></a><!-- doxytag: member="alleggl.h::AGL_TEXTURE_MASKED" ref="gaba184d573c65f33b35d1d57936607d08" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_TEXTURE_MASKED   0x08</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Generate an alpha channel for this texture, based on the Allegro mask color. </p>
<p>Make sure the target format supports an alpha channel. </p>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00534">534</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gaa8b7246edc7ec019ec3b434eb0cacdf2"></a><!-- doxytag: member="alleggl.h::AGL_TEXTURE_RESCALE" ref="gaa8b7246edc7ec019ec3b434eb0cacdf2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AGL_TEXTURE_RESCALE   0x10</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Tell AllegroGL to allow rescaling of the bitmap. </p>
<p>By default, AllegroGL will not rescale the bitmap to fit into a texture. You can override this behavior by using this flag. </p>
<p>Definition at line <a class="el" href="alleggl_8h_source.html#l00540">540</a> of file <a class="el" href="alleggl_8h_source.html">alleggl.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gab5393ecc10a2a31da7eb80c889af89ac"></a><!-- doxytag: member="alleggl.h::allegro_gl_use_mipmapping" ref="gab5393ecc10a2a31da7eb80c889af89ac" args="(int enable)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_use_mipmapping </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>enable</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Tell AllegroGL to use Mipmapping or not when generating textures via its functions. </p>
<p>This will not affect outside OpenGL states. Default is FALSE (off).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#ga6996c14538e18b1614f91d34b2d4d691" title="Checks whether the specified bitmap is of the proper size for texturing.">allegro_gl_check_texture()</a>, <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture()</a> <a class="el" href="group__texture.html#gaeb33dfbbc1725f5132c10ac32ef6800d" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_masked_texture()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">enable</td><td>Set to TRUE to enable mipmapping, FALSE otherwise. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The previous mode (either TRUE or FALSE).</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000017">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00415">415</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
</div>
</div>
<a class="anchor" id="ga1d88f4ebc7ed1ecd65640b72ea46a71e"></a><!-- doxytag: member="alleggl.h::allegro_gl_use_alpha_channel" ref="ga1d88f4ebc7ed1ecd65640b72ea46a71e" args="(int enable)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_use_alpha_channel </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>enable</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Tell AllegroGL to use Alpha channel or not when generating textures via its functions. </p>
<p>This will not affect outside OpenGL states. Default is FALSE (off).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#ga6996c14538e18b1614f91d34b2d4d691" title="Checks whether the specified bitmap is of the proper size for texturing.">allegro_gl_check_texture()</a>, <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture()</a>, <a class="el" href="group__texture.html#gaeb33dfbbc1725f5132c10ac32ef6800d" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_masked_texture()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">enable</td><td>Set to TRUE to enable textures with alpha channel, FALSE otherwise. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The previous mode (either TRUE or FALSE).</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000018">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00439">439</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
</div>
</div>
<a class="anchor" id="ga3ec0a1c4c6656f13c8398bab7a1293f2"></a><!-- doxytag: member="alleggl.h::allegro_gl_flip_texture" ref="ga3ec0a1c4c6656f13c8398bab7a1293f2" args="(int enable)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_flip_texture </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>enable</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Tell AllegroGL to flip the texture vertically or not when generating textures via its functions, to conform to the usual OpenGL texture coordinate system (increasing upwards). </p>
<p>Default is TRUE (on).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#ga6996c14538e18b1614f91d34b2d4d691" title="Checks whether the specified bitmap is of the proper size for texturing.">allegro_gl_check_texture()</a>, <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture()</a>, <a class="el" href="group__texture.html#gaeb33dfbbc1725f5132c10ac32ef6800d" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_masked_texture()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">enable</td><td>Set to TRUE to enable textures with alpha channel, FALSE otherwise. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The previous mode (either TRUE or FALSE).</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000019">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00464">464</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
</div>
</div>
<a class="anchor" id="ga6996c14538e18b1614f91d34b2d4d691"></a><!-- doxytag: member="alleggl.h::allegro_gl_check_texture" ref="ga6996c14538e18b1614f91d34b2d4d691" args="(BITMAP *bmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_check_texture </td>
<td>(</td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks whether the specified bitmap is of the proper size for texturing. </p>
<p>This checks for the card's limit on texture sizes.</p>
<p><b>Important</b> <b>note:</b> allegro_gl_check_texture does not depend on the current state of the texture memory of the driver. This function may return TRUE although there is not enough memory to currently make the texture resident. You may check if the texture is actually resident with glAreTexturesResident().</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#gab0cf4dc0ddcb45f5b067d08aed1c88e6" title="Checks whether the specified bitmap is of the proper size for texturing.">allegro_gl_check_texture_ex()</a>, <a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture_ex()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">bmp</td><td>The bitmap to be converted to a texture.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if the bitmap can be made a texture of, FALSE otherwise.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000020">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00557">557</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>References <a class="el" href="texture_8c_source.html#l00495">allegro_gl_check_texture_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gab0cf4dc0ddcb45f5b067d08aed1c88e6"></a><!-- doxytag: member="alleggl.h::allegro_gl_check_texture_ex" ref="gab0cf4dc0ddcb45f5b067d08aed1c88e6" args="(int flags, BITMAP *bmp, GLint internal_format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int allegro_gl_check_texture_ex </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GLint </td>
<td class="paramname"><em>internal_format</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks whether the specified bitmap is of the proper size for texturing. </p>
<p>This checks for the card's limit on texture sizes.</p>
<p>The parameters to this function are identical to those of <a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture_ex()</a>.</p>
<p><b>Important</b> <b>note:</b> allegro_gl_check_texture does not depend on the current state of the texture memory of the driver. This function may return TRUE although there is not enough memory to currently make the texture resident. You may check if the texture is actually resident with glAreTexturesResident().</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture_ex()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">flags</td><td>The bitmap conversion flags. </td></tr>
<tr><td class="paramname">bmp</td><td>The bitmap to be converted to a texture. </td></tr>
<tr><td class="paramname">internal_format</td><td>The internal format to convert to.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if the bitmap can be made a texture of, FALSE otherwise. </dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00495">495</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>References <a class="el" href="texture_8c_source.html#l01165">allegro_gl_make_texture_ex()</a>.</p>
<p>Referenced by <a class="el" href="texture_8c_source.html#l00557">allegro_gl_check_texture()</a>, and <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="ga2392fe7a8dd6db65532160821804aa68"></a><!-- doxytag: member="alleggl.h::allegro_gl_get_texture_format" ref="ga2392fe7a8dd6db65532160821804aa68" args="(BITMAP *bmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLint allegro_gl_get_texture_format </td>
<td>(</td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the OpenGL internal texture format for this bitmap. </p>
<p>If left to default, it returns the number of color components in the bitmap. Otherwise, it simply returns the user defined value. If the bitmap parameter is NULL, then it returns the currently set format, or -1 if none were previously set. 8 bpp bitmaps are assumed to be alpha channels only (GL_ALPHA8) by default.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#ga5d535e8af776dd449cc4755b9e3585b1" title="Sets the color format you'd like OpenGL to use for its textures.">allegro_gl_set_texture_format()</a>, <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">bmp</td><td>The bitmap to get the information of. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The OpenGL internal texture format.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000015">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00248">248</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>Referenced by <a class="el" href="fontconv_8c_source.html#l00623">allegro_gl_convert_allegro_font()</a>.</p>
</div>
</div>
<a class="anchor" id="ga5d535e8af776dd449cc4755b9e3585b1"></a><!-- doxytag: member="alleggl.h::allegro_gl_set_texture_format" ref="ga5d535e8af776dd449cc4755b9e3585b1" args="(GLint format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLint allegro_gl_set_texture_format </td>
<td>(</td>
<td class="paramtype">GLint </td>
<td class="paramname"><em>format</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the color format you'd like OpenGL to use for its textures. </p>
<p>You can pass any of the available GL_* constants that describe the internal format (GL_ALPHA4...GL_RGBA16). It is recommended that you check for the availability of the format from the client, using <a class="el" href="group__core.html#ga444d507eaeb5ba800787f6a81827615d" title="Returns the OpenGL version number of the client (the computer the program is running on)...">allegro_gl_opengl_version()</a>. No checking will be done as to the validity of the format. The format is a recommendation to the driver, so there is no guarentee that the actual format used will be the one you chose - this is implementation dependant. This call will affect all subsequent calls to <a class="el" href="group__texture.html#gae071354f76bc28e1bafbd90bdecbc0c9" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture()</a> and <a class="el" href="group__texture.html#gaeb33dfbbc1725f5132c10ac32ef6800d" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_masked_texture()</a>.</p>
<p>To revert to the default AllegroGL format, pass -1 as the format.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#ga2392fe7a8dd6db65532160821804aa68" title="Returns the OpenGL internal texture format for this bitmap.">allegro_gl_get_texture_format()</a></dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">format</td><td>The OpenGL internal texture format. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The previous value of the texture format.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000016">Deprecated:</a></b></dt><dd></dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l00282">282</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
</div>
</div>
<a class="anchor" id="gae071354f76bc28e1bafbd90bdecbc0c9"></a><!-- doxytag: member="alleggl.h::allegro_gl_make_texture" ref="gae071354f76bc28e1bafbd90bdecbc0c9" args="(BITMAP *bmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLuint allegro_gl_make_texture </td>
<td>(</td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Uploads an Allegro BITMAP to the GL driver as a texture. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000021">Deprecated:</a></b></dt><dd></dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture_ex()</a> </dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l01383">1383</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>References <a class="el" href="texture_8c_source.html#l01165">allegro_gl_make_texture_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gaeb33dfbbc1725f5132c10ac32ef6800d"></a><!-- doxytag: member="alleggl.h::allegro_gl_make_masked_texture" ref="gaeb33dfbbc1725f5132c10ac32ef6800d" args="(BITMAP *bmp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLuint allegro_gl_make_masked_texture </td>
<td>(</td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Uploads an Allegro BITMAP to the GL driver as a texture. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000022">Deprecated:</a></b></dt><dd></dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__texture.html#gaf3a48c555068e7051171255c1011150a" title="Uploads an Allegro BITMAP to the GL driver as a texture.">allegro_gl_make_texture_ex()</a> </dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l01402">1402</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>References <a class="el" href="texture_8c_source.html#l01165">allegro_gl_make_texture_ex()</a>.</p>
</div>
</div>
<a class="anchor" id="gaf3a48c555068e7051171255c1011150a"></a><!-- doxytag: member="alleggl.h::allegro_gl_make_texture_ex" ref="gaf3a48c555068e7051171255c1011150a" args="(int flags, BITMAP *bmp, GLint internal_format)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GLuint allegro_gl_make_texture_ex </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">BITMAP * </td>
<td class="paramname"><em>bmp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">GLint </td>
<td class="paramname"><em>internal_format</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Uploads an Allegro BITMAP to the GL driver as a texture. </p>
<p>The bitmap must be a memory bitmap (note that it can be a subbitmap).</p>
<p>Each bitmap will be converted to a single texture object, with all its size limitations imposed by the video driver and hardware.</p>
<p>The bitmap should conform to the size limitations imposed by the video driver. That is, if ARB_texture_non_power_of_two is not supported, then the BITMAP must be power-of-two sized. Otherwise, AllegroGL will pick the best format for the bitmap.</p>
<p>The original bitmap will NOT be modified.</p>
<p>The flags parameter controls how the texture is generated. It can be a logical OR (|) of any of the following:</p>
<p><a class="el" href="group__texture.html#gabaf179e577a9328a751e92e3603f0746" title="AllegroGL will generate mipmaps for this texture.">AGL_TEXTURE_MIPMAP</a> <a class="el" href="group__texture.html#ga8cc859eadf1610b424cd9188e716f432" title="Tell AllegroGL that the bitmap had an alpha channel, so it should be preserved when generating the te...">AGL_TEXTURE_HAS_ALPHA</a> <a class="el" href="group__texture.html#gadeffe4feb290278035beacedb284a010" title="Flip the texture on the x-axis.">AGL_TEXTURE_FLIP</a> <a class="el" href="group__texture.html#gaba184d573c65f33b35d1d57936607d08" title="Generate an alpha channel for this texture, based on the Allegro mask color.">AGL_TEXTURE_MASKED</a> <a class="el" href="group__texture.html#gaa8b7246edc7ec019ec3b434eb0cacdf2" title="Tell AllegroGL to allow rescaling of the bitmap.">AGL_TEXTURE_RESCALE</a></p>
<p>AllegroGL will create a texture with the specified texel format. The texel format should be any of the valid formats that can be specified to glTexImage2D(). No validity checks will be performed by AllegroGL. If you want AllegroGL to automatically determine the format to use based on the BITMAP, use -1 as the format specifier.</p>
<p>A valid GL Rendering Context must have been established, which means you cannot use this function before having called set_gfx_mode() with a valid OpenGL mode.</p>
<p><b>Important</b> <b>note:</b> on 32 bit bitmap in RGBA mode, the alpha channel created by Allegro is set to all 0 by default. This will cause the texture to not show up in 32bpp modes if alpha is set. You will need to fill in the alpha channel manually if you need an alpha channel.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">bmp</td><td>The bitmap to be converted to a texture. </td></tr>
<tr><td class="paramname">flags</td><td>The conversion flags. </td></tr>
<tr><td class="paramname">internal_format</td><td>The texture format to convert to.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>GLuint The texture handle, or 0 on failure </dd></dl>
<p>Definition at line <a class="el" href="texture_8c_source.html#l01165">1165</a> of file <a class="el" href="texture_8c_source.html">texture.c</a>.</p>
<p>References <a class="el" href="glext_8c_source.html#l00055">allegro_gl_extensions_GL</a>.</p>
<p>Referenced by <a class="el" href="texture_8c_source.html#l00495">allegro_gl_check_texture_ex()</a>, <a class="el" href="fontconv_8c_source.html#l00688">allegro_gl_convert_allegro_font_ex()</a>, <a class="el" href="texture_8c_source.html#l01402">allegro_gl_make_masked_texture()</a>, and <a class="el" href="texture_8c_source.html#l01383">allegro_gl_make_texture()</a>.</p>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="footer">Generated on Thu May 19 2011 23:20:20 for AllegroGL by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
</ul>
</div>
</body>
</html>
|