home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_SetAlpha.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  4.9 KB  |  126 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_SetAlpha"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_SetAlpha- Adjust the alpha properties of a surface 
  13. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  14. <p>
  15. <b>#include
  16. "SDL.h" <p>
  17. </b><b>int <b>SDL_SetAlpha</b></b>(<b>SDL_Surface *surface, Uint32 flag, Uint8 alpha</b>);
  18.  
  19. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  20. <p>
  21. <blockquote><b>Note:   <p>
  22. This function and the semantics of SDL alpha blending
  23. have changed since version 1.1.4. Up until version 1.1.5, an alpha value of
  24. 0 was considered opaque and a value of 255 was considered transparent. This
  25. has now been inverted: 0 (<b>SDL_ALPHA_TRANSPARENT</b></b>) is now considered transparent
  26. and 255 (<b>SDL_ALPHA_OPAQUE</b>) is now considered opaque. </blockquote>
  27. <p>
  28. <b>SDL_SetAlpha</b> is used
  29. for setting the per-surface alpha value and/or enabling and disabling alpha
  30. blending. <p>
  31. The<b>surface</b> parameter specifies which surface whose alpha attributes
  32. you wish to adjust. <b>flags</b> is used to specify whether alpha blending should
  33. be used (<b>SDL_SRCALPHA</b>) and whether the surface should use RLE acceleration
  34. for blitting (<b>SDL_RLEACCEL</b>). <b>flags</b> can be an OR'd combination of these two
  35. options, one of these options or 0. If <b>SDL_SRCALPHA</b> is not passed as a flag
  36. then all alpha information is ignored when blitting the surface. The <b>alpha</b>
  37. parameter is the per-surface alpha value; a surface need not have an alpha
  38. channel to use per-surface alpha and blitting can still be accelerated with
  39. <b>SDL_RLEACCEL</b>. <p>
  40. <blockquote><b>Note:   <p>
  41. The per-surface alpha value of 128 is considered a
  42. special case and is optimised, so it's much faster than other per-surface
  43. values. </blockquote>
  44. <p>
  45. </b>Alpha effects surface blitting in the following ways: 
  46. <dl>
  47.  
  48. <dt>RGBA->RGB with
  49. <b>SDL_SRCALPHA</b> </dt>
  50. <dd>The source is alpha-blended with the destination, using the
  51. alpha channel. <b>SDL_SRCCOLORKEY</b> and the per-surface alpha are ignored. </dd>
  52.  
  53. <dt>RGBA->RGB
  54. without <b>SDL_SRCALPHA</b> </dt>
  55. <dd>The RGB data is copied from the source. The source
  56. alpha channel and the per-surface alpha value are ignored. </dd>
  57.  
  58. <dt>RGB->RGBA with <b>SDL_SRCALPHA</b>
  59. </dt>
  60. <dd>The source is alpha-blended with the destination using the per-surface alpha
  61. value. If <b>SDL_SRCCOLORKEY</b> is set, only the pixels not matching the colorkey
  62. value are copied. The alpha channel of the copied pixels is set to opaque.
  63. </dd>
  64.  
  65. <dt>RGB->RGBA without <b>SDL_SRCALPHA</b> </dt>
  66. <dd>The RGB data is copied from the source and
  67. the alpha value of the copied pixels is set to opaque. If <b>SDL_SRCCOLORKEY</b>
  68. is set, only the pixels not matching the colorkey value are copied.  </dd>
  69.  
  70. <dt>RGBA->RGBA
  71. with <b>SDL_SRCALPHA</b> </dt>
  72. <dd>The source is alpha-blended with the destination using
  73. the source alpha channel. The alpha channel in the destination surface is
  74. left untouched. <b>SDL_SRCCOLORKEY</b> is ignored. </dd>
  75.  
  76. <dt>RGBA->RGBA without <b>SDL_SRCALPHA</b>
  77. </dt>
  78. <dd>The RGBA data is copied to the destination surface. If <b>SDL_SRCCOLORKEY</b> is
  79. set, only the pixels not matching the colorkey value are copied. </dd>
  80.  
  81. <dt>RGB->RGB
  82. with <b>SDL_SRCALPHA</b> </dt>
  83. <dd>The source is alpha-blended with the destination using
  84. the per-surface alpha value. If <b>SDL_SRCCOLORKEY</b> is set, only the pixels not
  85. matching the colorkey value are copied. </dd>
  86.  
  87. <dt>RGB->RGB without <b>SDL_SRCALPHA</b> </dt>
  88. <dd>The
  89. RGB data is copied from the source. If <b>SDL_SRCCOLORKEY</b> is set, only the
  90. pixels not matching the colorkey value are copied. </dd>
  91. </dl>
  92. <p>
  93. <blockquote><b>Note:   <p>
  94.  Note that RGBA->RGBA
  95. blits (with SDL_SRCALPHA set) keep the alpha of the destination surface.
  96. This means that you cannot compose two arbitrary RGBA surfaces this way
  97. and get the result you would expect from "overlaying" them; the destination
  98. alpha will work as a mask.</b><br>
  99.  <p>
  100. Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel
  101. alpha is always used if available </blockquote>
  102.  
  103. <h2><a name='sect3' href='#toc3'>Return Value</a></h2>
  104. <p>
  105. This function returns <b>0</b>,
  106. or <b>-1</b> if there was an error. 
  107. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  108. <p>
  109. <i><b>SDL_MapRGBA</b></i>, <i><b>SDL_GetRGBA</b></i>, <i><b>SDL_DisplayFormatAlpha</b></i>,
  110. <i><b>SDL_BlitSurface</b></i> 
  111. <!--
  112.   
  113.  <p>
  114.  
  115. <hr><p>
  116. <a name='toc'><b>Table of Contents</b></a><p>
  117. <ul>
  118. <li><a name='toc0' href='#sect0'>Name</a></li>
  119. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  120. <li><a name='toc2' href='#sect2'>Description</a></li>
  121. <li><a name='toc3' href='#sect3'>Return Value</a></li>
  122. <li><a name='toc4' href='#sect4'>See Also</a></li>
  123. </ul>
  124. </body>
  125. </html>
  126.