haiku-website/static/legacy-docs/bebook/TheGameKit_CardHooks.html

155 lines
35 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Game Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheGameKit.html" title="The Game Kit" /><link rel="prev" href="TheGameKit_Functions.html" title="Global Functions" /><link rel="next" href="TheGameKit_Constants.html" title="Constants" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="TheGameKit_Functions.html" title="Global Functions"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheGameKit.html" title="The Game Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="TheGameKit_Constants.html" title="Constants"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Game Kit</div></div><div id="headerB">Prev: <a href="TheGameKit_Functions.html">Global Functions</a>  Up: <a href="TheGameKit.html">The Game Kit</a>  Next: <a href="TheGameKit_Constants.html">Constants</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="TheGameKit_CardHooks"></a>Graphics Card Hook Functions</h2></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="define_cursor"></a>define_cursor()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 0</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">define_cursor</span>(<span class="methodparam"><span class="type">uchar* </span><span class="parameter">xorMask</span></span>,<br />                    <span class="methodparam"><span class="type">uchar* </span><span class="parameter">andMask</span></span>,<br />                    <span class="methodparam"><span class="type">int32 </span><span class="parameter">width</span></span>,<br />                    <span class="methodparam"><span class="type">int32 </span><span class="parameter">height</span></span>,<br />                    <span class="methodparam"><span class="type">int32 </span><span class="parameter">hotX</span></span>,<br />                    <span class="methodparam"><span class="type">int32 </span><span class="parameter">hotY</span></span>);</code><p>
Tells the driver to create a cursor image as defined by the arguments.
The first two arguments, <code class="parameter">xorMask</code> and
<code class="parameter">andMask</code>, are bit vectors that
represent the cursor image laid out in concatenated, byte-aligned rows
(top to bottom). Parallel bits from the two vectors define the color of a
single cursor pixel:
</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th><code class="parameter">xorMask</code></th><th><code class="parameter">andMask</code></th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>0</td><td>White; replace the screen pixel with a white cursor pixel.</td></tr><tr><td>1</td><td>0</td><td>Black; replace the screen pixel with a black cursor pixel.</td></tr><tr><td>0</td><td>1</td><td>Transparent; let the color of the underlying screen pixel show
through.</td></tr><tr><td>1</td><td>1</td><td>Inversion; invert the color of the screen pixel.</td></tr></tbody></table></div><p>
The second two arguments, <code class="parameter">width</code> and <code class="parameter">height</code>,
are the size of the cursor
image in pixels. (Currently, the Application Server supports only 16x16
cursors.)
</p><p>
The (<code class="parameter">hotX</code>, <code class="parameter">hotY</code>) arguments
define the "hot spot"—the pixel that
precisely locates the cursor. Hot spot coordinates are relative to the
cursor rectangle itself, where the pixel at the left top corner of the
cursor image is (0, 0) and the one at the right bottom corner is
(<code class="parameter">width</code>-1, <code class="parameter">height</code>-1).
</p><p>
If the cursor is currently showing (i.e. not hidden), this function
should display the cursor image.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="move_cursor"></a>move_cursor()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 1</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">move_cursor</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">screenX</span></span>,<br />                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">screenY</span></span>);</code><p>
Tells the driver to move the cursor so the hot spot corresponds to
(<code class="parameter">screenX</code>, <code class="parameter">screenY</code>).
The arguments are display area coordinates (not frame
buffer coordinates).
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="show_cursor"></a>show_cursor()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 2</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">show_cursor</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">flag</span></span>);</code><p>
If the <code class="parameter">flag</code> argument is <code class="constant">true</code>,
the driver should show the cursor image
on-screen; if it's <code class="constant">false</code>, it should remove the cursor from the screen.
</p><p>
If the driver is asked to show the cursor before
<a class="link" href="TheGameKit_CardHooks.html#define_cursor" title="define_cursor()"><code class="function">define_cursor()</code></a> is
called, it should show it at (0, 0).
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_line_with_8_bit_depth"></a>draw_line_with_8_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 3</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_line_with_8_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">startX</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">endX</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">startY</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">endY</span></span>,<br />                                 <span class="methodparam"><span class="type">uint8 </span><span class="parameter">colorIndex</span></span>,<br />                                 <span class="methodparam"><span class="type">bool </span><span class="parameter">clipToRect</span></span>,<br />                                 <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipLeft</span></span>,<br />                                 <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipTop</span></span>,<br />                                 <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipRight</span></span>,<br />                                 <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipBottom</span></span>);</code><p>
Tells the driver to draw a straight, 8-bit color, minimally thin line.
</p><ul class="itemizedlist"><li><p>
The line begins at (<code class="parameter">startX</code>, <code class="parameter">startY</code>)
and ends at (<code class="parameter">endX</code>, <code class="parameter">endY</code>),
inclusive. The arguments are frame buffer coordinates.
</p></li><li><p>
<code class="parameter">colorIndex</code> gives the color of the line as an index into the 8-bit
color table.
</p></li><li><p>
If <code class="parameter">clipToRect</code> is <code class="constant">true</code>,
the function should draw only the portion of
the line that lies within the clipping rectangle defined by the last
four arguments. The sides of the rectangle are included in the drawing
area. If <code class="parameter">clipToRect</code> is <code class="constant">false</code>,
the final four arguments should be ignored
</p></li></ul><p>
To produce minimal thinness, the line should color only one pixel per row
or column, as the absolute slope of the line is more or less than 45
degrees; in other words, the line should move between rows or columns on
the diagonal, not by overlapping. Here's how you should (and shouldn't)
produce a mostly-vertical line; for the mostly-horizontal version, turn
your head sideways:
</p><div class="mediaobject"><img src="./images/TheGameKit/draw_line_with_8_bit_depth.png" alt="Drawing Line With 8 Bit Depth" /></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_line_with_32_bit_depth"></a>draw_line_with_32_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 4</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_line_with_32_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">startX</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">endX</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">startY</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">endY</span></span>,<br />                                  <span class="methodparam"><span class="type">uint32 </span><span class="parameter">color</span></span>,<br />                                  <span class="methodparam"><span class="type">bool </span><span class="parameter">clipToRect</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipLeft</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipTop</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipRight</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipBottom</span></span>);</code><p>
This is the same as
<a class="link" href="TheGameKit_CardHooks.html#draw_line_with_8_bit_depth" title="draw_line_with_8_bit_depth()"><code class="function">draw_line_with_8_bit_depth()</code></a>
except for the color
argument. Here, <code class="parameter">color</code> is a 32-bit value with 8-bit red, green, blue, and
alpha components. The components are arranged in the order that the
driver specified when it received the
<code class="constant">B_GET_GRAPHICS_CARD_INFO</code> request.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_rect_with_8_bit_depth"></a>draw_rect_with_8_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 5</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_rect_with_8_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">left</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">top</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">right</span></span>,<br />                                 <span class="methodparam"><span class="type">int32 </span><span class="parameter">bottom</span></span>,<br />                                 <span class="methodparam"><span class="type">uint8 </span><span class="parameter">colorIndex</span></span>);</code><p>
Tells the driver to fill a rectangle, specified by the first four
arguments, with the color at <code class="parameter">colorIndex</code> in the 8-bit color table. The
arguments are frame buffer coordinates. The sides of the rectangle should
be included in the area being filled.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_rect_with_32_bit_depth"></a>draw_rect_with_32_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 6</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_rect_with_32_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">left</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">top</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">right</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">bottom</span></span>,<br />                                  <span class="methodparam"><span class="type">uint32 </span><span class="parameter">color</span></span>);</code><p>
This is the same as
<a class="link" href="TheGameKit_CardHooks.html#draw_rect_with_8_bit_depth" title="draw_rect_with_8_bit_depth()"><code class="function">draw_rect_with_8_bit_depth()</code></a>
except for the <code class="parameter">color</code>
argument. Here, <code class="parameter">color</code> is a 32-bit value with 8-bit red, green, blue, and
alpha components. The components are arranged in the order that the
driver specified when it received the <code class="constant">B_GET_GRAPHICS_CARD_INFO</code> request.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="blit"></a>blit()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 7</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">blit</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">sourceX</span></span>,<br />           <span class="methodparam"><span class="type">int32 </span><span class="parameter">sourceY</span></span>,<br />           <span class="methodparam"><span class="type">int32 </span><span class="parameter">destinationX</span></span>,<br />           <span class="methodparam"><span class="type">int32 </span><span class="parameter">destinationY</span></span>,<br />           <span class="methodparam"><span class="type">int32 </span><span class="parameter">width</span></span>,<br />           <span class="methodparam"><span class="type">int32 </span><span class="parameter">height</span></span>);</code><p>
Tells the driver to copy pixel data from a source rectangle to a
destination rectangle. All coordinates and sizes are in frame buffer
space. The left top pixel of the source rectangle is at (<code class="parameter">sourceX</code>,
<code class="parameter">sourceY</code>) in the frame buffer. The left top pixel of the destination
rectangle is at (<code class="parameter">destinationX</code>,
<code class="parameter">destinationY</code>) in the frame buffer. Both
rectangles are <code class="parameter">width</code> pixels wide and <code class="parameter">height</code>
pixels high. The <code class="parameter">width</code> and
<code class="parameter">height</code> arguments will always contain positive values, and the rectangles
are guaranteed to lie wholly within the frame buffer.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_array_with_8_bit_depth"></a><a id="indexed_color_line"></a>
draw_array_with_8_bit_depth(), indexed_color_line</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 8</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_array_with_8_bit_depth</span>(<span class="methodparam"><span class="type">indexed_color_line* </span><span class="parameter">array</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">numItems</span></span>,<br />                                  <span class="methodparam"><span class="type">bool </span><span class="parameter">clipToRect</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipLeft</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipTop</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipRight</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipBottom</span></span>);</code><p>
Tells the driver to draw an array of lines in 8-bit depth. The line <code class="parameter">array</code>
holds a total of <code class="parameter">numItems</code>. Each item is specified as an
<span class="type">indexed_color_line</span> structure, which contains the following fields (all
coordinates are in frame buffer space):
</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">x1</code></span></p></td><td><p>
The x coordinate of one end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">y1</code></span></p></td><td><p>
The y coordinate of one end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">x2</code></span></p></td><td><p>
The x coordinate of the other end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">y2</code></span></p></td><td><p>
The y coordinate of the other end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">color</code></span></p></td><td><p>
The color of the line, expressed as an index into the color map.
</p></td></tr></tbody></table><p>
If <code class="parameter">clipToRect</code> is <code class="constant">true</code>,
the function should draw only the portions of the
lines that lie within the clipping rectangle defined by the last four
arguments. The sides of the rectangle are included in the drawing area.
If <code class="parameter">clipToRect</code> is <code class="constant">false</code>,
the final four arguments should be ignored
</p><p>
The lines should be minimally thin, as described under
<a class="link" href="TheGameKit_CardHooks.html#draw_line_with_8_bit_depth" title="draw_line_with_8_bit_depth()"><code class="function">draw_line_with_8_bit_depth()</code></a>
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_array_with_32_bit_depth"></a><a id="rgb_color_line"></a>
draw_array_with_32_bit_depth(), rgb_color_line</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 9</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_array_with_32_bit_depth</span>(<span class="methodparam"><span class="type">rgb_color_line* </span><span class="parameter">array</span></span>,<br />                                   <span class="methodparam"><span class="type">int32 </span><span class="parameter">numItems</span></span>,<br />                                   <span class="methodparam"><span class="type">bool </span><span class="parameter">clipToRect</span></span>,<br />                                   <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipLeft</span></span>,<br />                                   <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipTop</span></span>,<br />                                   <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipRight</span></span>,<br />                                   <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipBottom</span></span>);</code><p>
Except for the color specification, which is encoded in the
<span class="type">rgb_color_line</span> structure, this is the same as
<a class="link" href="TheGameKit_CardHooks.html#draw_array_with_8_bit_depth" title="draw_array_with_8_bit_depth(), indexed_color_line"><code class="function">draw_array_with_8_bit_depth()</code></a>.
The <span class="type">rgb_color_line</span> structure contains
these fields:
</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">x1</code></span></p></td><td><p>
The x coordinate of one end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">y1</code></span></p></td><td><p>
The y coordinate of one end of the line.
</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">x2</code></span></p></td><td><p>The x coordinate of the other end of the line.</p></td></tr><tr><td><p><span class="term"><span class="type">int16</span> <code class="varname">y2</code></span></p></td><td><p>The y coordinate of the other end of the line.</p></td></tr><tr><td><p><span class="term"><span class="type">rgb_color</span> <code class="varname">color</code></span></p></td><td><p>The color of the line, expressed as a full 32-bit value.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="sync"></a>sync()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 10</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">sync</span>();</code><p>The driver should implement this function to block until all other
currently-executing hook functions have finished. (More accurately, you
only have to wait for those hook functions that actually touch the frame
buffer.) The return value is ignored.</p><p>You should only implement this function if the card can perform any of
the hook functions asynchronously. If all hook functions are synchronous,
you should set the index 10 function to <code class="constant">NULL</code>.</p><p>After receiving a <code class="function">sync()</code> call, your driver won't receive anymore hook
functions until <code class="function">sync()</code> returns. Thus, you don't have to guard against
in-coming hook functions while sitting in <code class="function">sync()</code>.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="invert_rect"></a>invert_rect()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 11</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">invert_rect</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">left</span></span>,<br />                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">top</span></span>,<br />                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">right</span></span>,<br />                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">bottom</span></span>);</code><p>Tells the driver to invert the colors in the rectangle specified by the
arguments. The sides of the rectangle are included in the inversion.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_line_with_16_bit_depth"></a>draw_line_with_16_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 12</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_line_with_16_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">startX</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">endX</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">startY</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">endY</span></span>,<br />                                  <span class="methodparam"><span class="type">uint16 </span><span class="parameter">color</span></span>,<br />                                  <span class="methodparam"><span class="type">bool </span><span class="parameter">clipToRect</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipLeft</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipTop</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipRight</span></span>,<br />                                  <span class="methodparam"><span class="type">int16 </span><span class="parameter">clipBottom</span></span>);</code><p>This is the same as
<a class="link" href="TheGameKit_CardHooks.html#draw_line_with_8_bit_depth" title="draw_line_with_8_bit_depth()"><code class="function">draw_line_with_8_bit_depth()</code></a>
except for the color
argument. Here, <code class="parameter">color</code> is a 16-bit value with red, green, blue, and
(possibly) alpha components. The components are arranged in the order
that the driver specified when it received the <code class="constant">B_GET_GRAPHICS_CARD_INFO</code>
request.</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="draw_rect_with_16_bit_depth"></a>draw_rect_with_16_bit_depth()</h3></div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="subtitle">Index: 13</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">draw_rect_with_16_bit_depth</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">left</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">top</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">right</span></span>,<br />                                  <span class="methodparam"><span class="type">int32 </span><span class="parameter">bottom</span></span>,<br />                                  <span class="methodparam"><span class="type">uint16 </span><span class="parameter">color</span></span>);</code><p>This is the same as
<a class="link" href="TheGameKit_CardHooks.html#draw_rect_with_8_bit_depth" title="draw_rect_with_8_bit_depth()"><code class="function">draw_rect_with_8_bit_depth()</code></a>
except for the color
argument. Here, <code class="parameter">color</code> is a 16-bit value with red, green, blue, and
(possibly) alpha components. The components are arranged in the order
that the driver specified when it received the <code class="constant">B_GET_GRAPHICS_CARD_INFO</code>
request.</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="TheGameKit_Functions.html">Global Functions</a>  Up: <a href="TheGameKit.html">The Game Kit</a>  Next: <a href="TheGameKit_Constants.html">Constants</a> </div><div id="footerB"><div id="footerBL"><a href="TheGameKit_Functions.html" title="Global Functions"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheGameKit.html" title="The Game Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="TheGameKit_Constants.html" title="Constants"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>