@node Config System, Config Graphics, Specific Options, Specific Options
@subsubsection System Configuration
@cindex Configuration, System

This section describes how the base system can be configured via a
configuration file.  The default values are stored in
@file{CS/data/config/system.cfg}, except the list of default @sc{scf} classes
to instantiate, for which no default exists.  Typically, the list of default
requested classes will appear in an application's own configuration file.

@subsubheading List of @sc{scf} Classes

The most important part of the system configuration is the list of @sc{scf}
classes to instantiate by default.  A class is instantiated with the following
line:

@example
System.Plugins.InterfaceName = ClassName
@end example

@samp{System.Plugins.} is obligatory and tells the system to instantiate the
class at startup.  The @samp{InterfaceName} specifies the name of the abstract
@sc{scf} interface which this module is expected to implement.  For example the
interface name @samp{iGraphics3D} means that this plug-in is used for 3D
rendering.  Note that it is not possible to load more than one module with the
same functionality identifier.

Finally, @samp{ClassName} determines which @sc{scf} class to instantiate.  The
class you mention here must be designed for the purpose for which you try to
use it.  In other words, it must implement the interface specified with
@samp{InterfaceName} (it may also implement additional interfaces).  For
example, if you load a sound driver with the @samp{iGraphics3D}, the
application will not be able to instantiate the driver because it does not
implement that interface.

Note that some modules depend on others. If module A depends on module B,
then you must first load B, then A. If you don't do this then module A will
usually fail to initialize.

Here is an example of a line from the configuration file:

@example
System.Plugins.iGraphics3D = crystalspace.graphics3d.opengl
@end example

This line instantiates the @sc{scf} class @samp{crystalspace.graphics3d.opengl}
(the OpenGL graphics driver) which implements the abstract @samp{iGraphics3D}
interface, and makes the instantiated object available via shared object
registry.

The interface name mentioned above is exactly the name of the C++ abstract
interface which modules implement.  Some of the common ones which you will see
or use in configuration files are listed below.

@table @code
@item iVFS
The virtual file system.  Presently, there is only one @sc{vfs} implementation,
and it is named @samp{crystalspace.kernel.vfs}. @xref{VFS}.

@item iGraphics3D
A 3D renderer.  Some possible values include

@table @code
@item crystalspace.graphics3d.opengl
Uses OpenGL for 3D output, and by this takes advantage of hardware
acceleration. Requires installed OpenGL run-time libraries.
@item crystalspace.graphics3d.null
A null renderer useful for servers.
@end table

@item iBugPlug
A useful debugging plugin. Can also show frames per second. There is
only one implementation and it is named @samp{crystalspace.utilities.bugplug}.
@xref{BugPlug}.
@end table

@subsubheading Other Low-Level Configuration Options
@cindex maximum framerate

Apart from the list of plug-in modules, the following keys are recognized:

@table @code
@item System.UserConfig = true
Specifies whether or not user-specific configuration information should be
used and maintained. @xref{Config PerUser}.
@item System.MinimumElapsedTicks = 0
This option controls the minimum elapsed ticks that the default runloop
will use every frame. By default this is set to 0 which means that there
is no minimum but if you (for example) set this to 20 then this means that
framerate will be limited to 50 fps maximum since every frame will take
at least 20 milliseconds. Using this setting can relieve some load from the
cpu.
@end table

