Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > a2116f36018873d572acbcadddb8e994 > files > 3020

clanlib0.8-docs-0.8.1-22.mga7.i586.rpm


<!-- clanlib header begin -->
<HTML>
<HEAD>
<TITLE>CL_ResourceManager - ClanLib Game SDK</TITLE>
<STYLE TYPE="text/css"><!--
HTML BODY
{
	font-family: verdana, helvetica, sans-serif;
	font-size: 12px;
}
H1 { font-size: 22px; }
H2 { font-size: 18px; }
H3 { font-size: 16px; }
H4 { font-size: 14px; }
P { font-size: 12px; }
LI { font-size: 12px; }
--></STYLE>
</HEAD>

<body bgcolor=white text=black link=blue vlink=#800080>

<center>
<img src="http://clanlib.org/gfx/clanlib.png">
</center>
<!-- clanlib header end -->

<center>
<p>
<a href="http://clanlib.org/docs.html">Home</a> |
<a href="classes.html">All Classes</a> |
<a href="modules.html">Grouped Classes</a> |
<a href="index.html">Index</a> |
<a href="search.html">Search</a>
</p>
</center>
<h1>Class CL_ResourceManager</h1>
<p>  The ClanLib resource manager. <a href="#description">More...</a></p>
<p>Derived from:
<i>none</i>
<br>
Derived by:
<i>none</i>
<br>Group: Core (Resources)</p>
<p>
#include &lt;ClanLib/core.h&gt;
<p>
<table border=0 width=100%>
</table>
<p><b>Construction:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_ResourceManager__CL_ResourceManager.html">CL_ResourceManager</a></p></td><td valign=top><p>  Resource Manager constructor.</p></td></tr></table>
<p><b>Attributes:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_ResourceManager__exists.html">exists</a></p></td><td valign=top><p>  Returns true if a resource exists.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_resource.html">get_resource</a></p></td><td valign=top><p>  Returns a pointer to the CL_Resource representing the given resource.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_all_resources.html">get_all_resources</a></p></td><td valign=top><p>  Returns a list of all resources available.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_all_sections.html">get_all_sections</a></p></td><td valign=top><p>  Returns a list of all resource sections available.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_sections.html">get_sections</a></p></td><td valign=top><p>  Returns a list of the resource sections immediately under the given secion.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_resources_of_type.html">get_resources_of_type</a></p></td><td valign=top><p>  Returns a list of all resources available matching a given type. </p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__get_resource_provider.html">get_resource_provider</a></p></td><td valign=top><p>  Returns a pointer to the input source provider, in which all resources are stored.</p></td></tr></table>
<p><b>Signals:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_ResourceManager__sig_resource_added.html">sig_resource_added</a></p></td><td valign=top><p>  Signal invoked when a resource is added during loading of a resource file.</p></td></tr></table>
<p><b>Operations:</b></p>
<table border=0 width=100%>
<tr><td width=30% valign=top><p><a href="CL_ResourceManager__operator == .html">operator == </a></p></td><td valign=top><p>  Returns true resource managers handles the same object.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__add_resources.html">add_resources</a></p></td><td valign=top><p>  Add resources from an other resource manager.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__remove_resources.html">remove_resources</a></p></td><td valign=top><p>  Remove resources from an other resource manager.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__load_all.html">load_all</a></p></td><td valign=top><p>  Loads all resources into memory.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__unload_all.html">unload_all</a></p></td><td valign=top><p>  Unloads all resources from memory.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__load_section.html">load_section</a></p></td><td valign=top><p>  Loads all resources in a given section into memory.</p></td></tr><tr><td width=30% valign=top><p><a href="CL_ResourceManager__unload_section.html">unload_section</a></p></td><td valign=top><p>  Unloads all resources in a given section into memory.</p></td></tr></table>
<a name="#description"><p><b>Detailed description:</b></p>
  !group=Core/Resources!
  !header=core.h!
  <p>The resource manager is used to retrieve resources from a given
  resource source.</p>

  <p>This can either be a resource script file (used as input to the
  datafile compiler), or a datafile with all the resources included into
  one large gzipped resource file.</p>

  <p>To speedup loading of resources in a game, you can load entire sections
  of resources at once. When a resource in the section is requested, it is
  returned instantly without having to access the disk. This is especially
  useful to make sure all the game resources are loaded before the game is
  started.</p>

  <p>Resources are normally not retrieved using the get_resource() function.
  Instead, you should load the resource using the appropiate resource type
  class. For instance, a surface is easiest loaded like this:</p>

  <pre>
  CL_ResourceManager res_manager("my_datafile.dat", true);
  CL_Surface my_surface("my_surface", &amp;res_manager);
  </pre>

  <p>Getting the same resource twice won't create a new instance of the
  resource; they are reference counted.</p>


<!-- clanlib footer begin -->

<center><br><br><font color="#a0a0a0">
Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>.
</font></center>

</body>
</html>
<!-- clanlib footer end -->