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

102 lines
14 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_Constants.html" title="Constants" /><link rel="next" href="TheInputServer.html" title="The Input Server" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="TheGameKit_Constants.html" title="Constants"><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="TheInputServer.html" title="The Input Server"><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_Constants.html">Constants</a>  Up: <a href="TheGameKit.html">The Game Kit</a>  Next: <a href="TheInputServer.html">The Input Server</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_DefinedTypes"></a>Defined Types</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="frame_buffer_info"></a>frame_buffer_info</h3></div></div></div><a id="id958011" class="indexterm"></a><p>
Declared in: <code class="filename">add-ons/graphics/GraphicsCard.h</code>
</p><pre class="programlisting definition c">typedef struct {
<span class="type">short</span> <code class="varname">bits_per_pixel</code>;
<span class="type">short</span> <code class="varname">bytes_per_row</code>;
<span class="type">short</span> <code class="varname">width</code>;
<span class="type">short</span> <code class="varname">height</code>;
<span class="type">short</span> <code class="varname">display_width</code>;
<span class="type">short</span> <code class="varname">display_height</code>;
<span class="type">short</span> <code class="varname">display_x</code>;
<span class="type">short</span> <code class="varname">display_y</code>;
} <span class="type">frame_buffer_info</span></pre><p>
This structure is used to report the current configuration of the frame
buffer.
</p><p>
See also:
<a class="link" href="BWindowScreen.html#BWindowScreen_FrameBufferInfo" title="FrameBufferInfo()"><code class="methodname">FrameBufferInfo()</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="graphics_card_hook"></a>graphics_card_hook</h3></div></div></div><a id="id958128" class="indexterm"></a><p>
Declared in: <code class="filename">add-ons/graphics/GraphicsCard.h</code>
</p><pre class="programlisting definition c">typedef <span class="type">void</span> (*<span class="type">graphics_card_hook</span>)(<span class="type">void</span>)</pre><p>
This is the general type declaration for a graphics card hook function.
Specific hook functions will in fact declare various sets of arguments
and all return a status_t error code rather than void.
</p><p>
See also:
<a class="link" href="BWindowScreen.html#BWindowScreen_CardHookAt" title="CardHookAt()"><code class="methodname">CardHookAt()</code></a>,
"<a class="link" href="TheGameKit_CardHooks.html" title="Graphics Card Hook Functions">Graphics Card Hook Functions</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="graphics_card_info"></a>graphics_card_info</h3></div></div></div><a id="id958201" class="indexterm"></a><p>
Declared in: <code class="filename">add-ons/graphics/GraphicsCard.h</code>
</p><pre class="programlisting definition c">typedef struct {
<span class="type">short</span> <code class="varname">version</code>;
<span class="type">short</span> <code class="varname">id</code>;
<span class="type">void*</span> <code class="varname">frame_buffer</code>;
<span class="type">char</span> <code class="varname">rgba_order</code>[4];
<span class="type">short</span> <code class="varname">flags</code>;
<span class="type">short</span> <code class="varname">bits_per_pixel</code>;
<span class="type">short</span> <code class="varname">bytes_per_row</code>;
<span class="type">short</span> <code class="varname">width</code>;
<span class="type">short</span> <code class="varname">height</code>;
} <span class="type">graphics_card_info</span></pre><p>
Drivers use this structure to supply information about themselves and the
current configuration of the frame buffer to the Application Server and the
<a class="link" href="BWindowScreen.html" title="BWindowScreen"><code class="classname">BWindowScreen</code></a> class.
</p><p>
See also:
<a class="link" href="BWindowScreen.html#BWindowScreen_CardInfo" title="CardInfo()"><code class="methodname">CardInfo()</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="gs_attribute"></a>gs_attribute</h3></div></div></div><a id="id958332" class="indexterm"></a><p>
Declared in: <code class="filename">game/GameSoundDefs.h</code>
</p><pre class="programlisting definition c">struct <span class="type">gs_attribute</span> {
<span class="type">int32</span> <code class="varname">attribute</code>;
<span class="type">bigtime_t</span> <code class="varname">duration</code>;
<span class="type">float</span> <code class="varname">value</code>;
<span class="type">uint32</span> <code class="varname">flags</code>;
};</pre><p>
Defines an attribute. An attribute consists of an attribute number from
<span class="type">gs_attributes</span>, a <code class="varname">duration</code> indicating
the period of time, in microseconds,
over which the attribute's change takes effect, and a target <code class="varname">value</code>.
Additional <code class="varname">flags</code> can be specified for the attribute as well; these vary
depending on the attribute.
</p><p>
Currently, there are no flags defined for any of the predefined
attributes.
</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="gs_attribute_info"></a>gs_attribute_info</h3></div></div></div><a id="id958430" class="indexterm"></a><p>
Declared in: <code class="filename">game/GameSoundDefs.h</code>
</p><pre class="programlisting definition c">struct <span class="type">gs_attribute_info</span> {
<span class="type">int32</span> <code class="varname">attribute</code>;
<span class="type">float</span> <code class="varname">granularity</code>;
<span class="type">float</span> <code class="varname">minimum</code>;
<span class="type">float</span> <code class="varname">maximum</code>;
};</pre><p>
Describes the possible values the attribute can take. The granularity
field indicates how finely the value of the attribute can be controlled,
and minimum and maximum specify the minimum and maximum values the
attribute can take on.
</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="gs_audio_format"></a>gs_audio_format</h3></div></div></div><a id="id958508" class="indexterm"></a><p>
Declared in: <code class="filename">game/GameSoundDefs.h</code>
</p><pre class="programlisting definition c">struct <span class="type">gs_audio_format</span> {
enum <code class="varname">format</code> {
B_GS_U8 = 0x11,
B_GS_S16 = 0x2,
B_GS_F = 0x24,
B_GS_S32 = 0x4
};
<span class="type">float</span> <code class="varname">frame_rate</code>;
<span class="type">uint32</span> <code class="varname">channel_count</code>;
<span class="type">uint32</span> <code class="varname">format</code>;
<span class="type">uint32</span> <code class="varname">byte_order</code>;
<span class="type">size_t</span> <code class="varname">buffer_size</code>;
};</pre><p>This structure describes the format of a game sound.</p><table class="variablelist fields"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="varname">format</code></span></p></td><td><p>The format enum
lists the possible sound sample formats supported by the Game Kit:</p><dl class="variablelist constants"><dt><span class="term"><code class="constant">B_GS_U8</code></span></dt><dd><p>Unsigned 8-bit integer.</p></dd><dt><span class="term"><code class="constant">B_GS_S16</code></span></dt><dd><p>Signed 16-bit integer.</p></dd><dt><span class="term"><code class="constant">B_GS_F</code></span></dt><dd><p>Floating-point.</p></dd><dt><span class="term"><code class="constant">B_GS_S32</code></span></dt><dd><p>Signed 32-bit integer.</p></dd></dl></td></tr><tr><td><p><span class="term"><code class="varname">frame_rate</code></span></p></td><td><p>Indicates how many frames per second of audio should
be played.</p></td></tr><tr><td><p><span class="term"><code class="varname">channel_count</code></span></p></td><td><p>Indicates the number of audio channels the sound uses.</p></td></tr><tr><td><p><span class="term"><code class="varname">format</code></span></p></td><td><p>Specifies the format of the audio data to be
played must be one of the values declared in the format enum.</p></td></tr><tr><td><p><span class="term"><code class="varname">byte_order</code></span></p></td><td><p>Specifies the byte order of the sound to be played.</p></td></tr><tr><td><p><span class="term"><code class="varname">buffer_size</code></span></p></td><td><p>Used to specify how large the audio buffers used
to play the sound should be. You can specify zero if you want the Game
Kit to determine an appropriate size for you.</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="gs_id"></a>gs_id</h3></div></div></div><a id="id958779" class="indexterm"></a><p>Declared in: <code class="filename">game/GameSoundDefs.h</code></p><pre class="programlisting definition c">typedef <span class="type">int32</span> <span class="type">gs_id</span>;</pre><p>This type is used for game sound ID numbers.</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="TheGameKit_Constants.html">Constants</a>  Up: <a href="TheGameKit.html">The Game Kit</a>  Next: <a href="TheInputServer.html">The Input Server</a> </div><div id="footerB"><div id="footerBL"><a href="TheGameKit_Constants.html" title="Constants"><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="TheInputServer.html" title="The Input Server"><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>