categories for docs
[sdlgit/SDL-Site.git] / pages / SDL-Overlay.html-inc
CommitLineData
162a0989 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
60f74f6f 5<ul><li><a href="#NAME">NAME</a>
6<ul><li><a href="#CATEGORY">CATEGORY</a></li>
7</ul>
8</li>
162a0989 9<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
11<li><a href="#METHODS">METHODS</a>
12<ul><li><a href="#new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </a>
13<ul><li><a href="#YUV_Flags">YUV_Flags</a>
14</li>
15</ul>
16</li>
17</ul>
18</li>
19</ul><hr />
20<!-- INDEX END -->
21
22<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
23<div id="NAME_CONTENT">
24<p>SDL::Overlay - YUV Video overlay</p>
25
26</div>
60f74f6f 27<h2 id="CATEGORY">CATEGORY</h2>
28<div id="CATEGORY_CONTENT">
29<p>Core, Video, Structure</p>
30
31</div>
162a0989 32<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
33<div id="SYNOPSIS_CONTENT">
34<p>First import the following modules to get access to constants and functions needed for overlay.</p>
35<pre> use SDL;
36 use SDL::Video;
37 use SDL::Overlay;
38
39</pre>
40<p>Init the video susbsystem.</p>
41<pre> SDL::Init(SDL_INIT_VIDEO);
42
43</pre>
44<p>Create a display to use. </p>
45<pre> my $display = SDL::SetVideoMore(640, 480, 32, SDL_SWSURFACE);
46
47</pre>
48<p>Create and attach the display to a new overlay
49 my $overlay = SDL::Overlay-&gt;new( 100, 100, SDL_YV12_OVERLAY, $display);</p>
50
51</div>
52<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
53<div id="DESCRIPTION_CONTENT">
54<p>A <code>SDL_Overlay</code> allows for video rendering on an <code>SDL_Surface</code> which is a display. </p>
55<p>The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.</p>
56
57</div>
58<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
59<div id="METHODS_CONTENT">
60
61</div>
62<h2 id="new_width_height_YUV_flag_display">new ( $width, $height, $YUV_flag, $display) </h2>
63<div id="new_width_height_YUV_flag_display_CO">
64<p>The constructor creates a SDL::Overlay of the specified width, height and format (see <code>YUV_Flags</code> list below of available formats), for the provided display.</p>
65<p>Note the 'display' argument needs to actually be the surface created by <code>SDL::Video::SetVideoMode</code> otherwise this function will segfault. </p>
66<pre> my $overlay = SDL::Overlay-&gt;new( $width, $height, $YUV_flag, $display );
67
68</pre>
69
70</div>
71<h3 id="YUV_Flags">YUV_Flags</h3>
72<div id="YUV_Flags_CONTENT">
73<p>More information on YUV formats can be found at <a href="http://www.fourcc.org/indexyuv.htm">http://www.fourcc.org/indexyuv.htm</a> . </p>
74<dl>
75 <dt>*
76SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */</dt>
77 <dt>*
78SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */</dt>
79 <dt>*
80SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */</dt>
81 <dt>*
82SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */</dt>
83 <dt>*
84SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */</dt>
85</dl>
86
87</div>
88</div>