CS Namespace Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
CS Namespace Reference
Geometry utilities | Graphics | 3D | Common Plugin Classes | Application Framework | Memory Management | Containers | Event handling | Utilities | Crystal Space 3D Engine | Loading & Saving support | Mesh plugins | Virtual File System (VFS) | 2D

Main namespace for CrystalSpace. More...

## Namespaces
namespace | Animation
| Animation-related types.
namespace | Checksum
| Checksums and message digests.
namespace | Container
| Container classes.
namespace | Debug
| Debugging utilities and helpers.
namespace | Deprecated
| Contains deprecated code that will be removed after next stable release.
namespace | DocSystem
| Document system / XML helper classes.
namespace | Geometry
| Geometry and mesh tools related classes.
namespace | Graphics
| Graphics and rendering related classes.
namespace | Material
| Material and texture related classes.
namespace | Math
| Mathematical functions and definitions.
namespace | Memory
| Memory allocation.
namespace | Mesh
| Meshes.
namespace | Meta
| Meta-programming helpers.
namespace | Physics
| Objects of a dynamic simulation.
namespace | Platform
| Platform specific code and wrappers.
namespace | Plugin
| Implementation of all plugins.
namespace | PluginCommon
| Common code shared among a number of plugins.
namespace | RenderManager
| Classes for render manager plugin implementation.
namespace | SndSys
| Sound system classes.
namespace | Threading
| Functions and classes for threading, locking and atomic operations.
namespace | Utility
| Assorted utility functions and classes that doesn't belong anywhere else.
## Classes
class | CowWrapper
| Copy-on-write wrapper for arbitrary types. More...
class | DataBuffer
| This is an implementation of iDataBuffer interface. More...
class | ImageAutoConvert
| Small wrapper class to automatically convert an image into a different storage format, if needed. More...
struct | InvalidStringID
| An invalid csStringID. More...
class | MeasureTime
| Simple helper class to measure execution time of a block. More...
class | NumberedFilenameHelper
| Helper to deal with numbered filename. More...
struct | Quote
| Helper functions to decorate strings with nice-looking quote characters. More...
class | RenderBufferPersistent
| Render buffer wrapper with additional persistence information. More...
class | RenderViewClipper
| Helper to clip in the context of a render view. More...
class | ScfStringSet
| The string set is a collection of unique strings. More...
struct | ShaderVarName
| Helper class to obtain an ID for a shader variable. More...
struct | StringID
| An identifier for a string. More...
class | StructuredTextureFormat
| Structured representation of a texture format. More...
class | SubRectangles
| A class managing allocations of sub-rectangles. More...
class | SubRectanglesCompact
| A variation of SubRectangles that tries to place rectangles in a rectangular fashion. More...
class | TextureFormatStrings
| Texture format string parser routines. More...
class | TriangleIndicesStream
| Helper class to extract triangles from an index buffer. More...
class | TriangleIndicesStreamRandom
| Extracts triangles like TriangleIndicesStream, but also provides random access to individual triangles and can be resetted. More...
struct | TriangleT
| A templated triangle. More...
class | UberScreenshotMaker
| Helper to create "&uuml;berscreenshots", screenshots with a resolution larger than the current framebuffer resolution. More...
## Typedefs
typedef StringID < StringSetTag::ShaderVar > | ShaderVarStringID
| String ID for shader variable name.
typedef unsigned int | StringIDValue
| Type for the actual value of a string ID.
## Enumerations
enum | RenderPriorityGrouping { rpgByLayer = 0, rpgByMesh = 1 }
| Render grouping for mesh multipass rendering. More...
## Functions
template<typename T , typename Fn >
Fn & | ForEach (T it, Fn &Func)
| Iterate over all elements in the iterator and perform operation given by Func.
template<typename T , typename Fn >
Fn & | ForEach (T *start, T *end, Fn &Func)
| Iterate over all elements in the list and perform operation given by Func.
template<typename T , typename Fn , typename P >
Fn & | ForEach (T it, Fn &Func, P &p)
| Iterate over all elements in the iterator and perform operation given by Func.
template<typename T , typename Fn , typename P1 , typename P2 >
Fn & | ForEach (T it, Fn &Func, P1 &p1, P2 &p2)
| Iterate over all elements in the iterator and perform operation given by Func.
template<typename T , typename Fn , typename P1 , typename P2 , typename P3 >
Fn & | ForEach (T it, Fn &Func, P1 &p1, P2 &p2, P3 &p3)
| Iterate over all elements in the iterator and perform operation given by Func.
template<typename Interface >
static csPtr< Interface > | GetChildObject (iObject *object)
| Get a child from an object that implements a specific interface.
template<typename Interface >
static csPtr< Interface > | GetNamedChildObject (iObject *object, const char *name)
| Get a child from an object that has the given name and implements a specific interface.
csHandlerID | RegisterWeakListener (iEventQueue *q, iEventHandler *listener, csRef< iEventHandler > &handler)
| Helper function for registering an event handler using a weak reference.
void | RemoveWeakListener (iEventQueue *q, csRef< iEventHandler > &handler)
| Helper function for removing an event handler that was registered with RegisterWeakListener().
char * | StrDup (const char *s)
| Allocate a char string with cs_malloc() and copy the string into the newly allocated storage.
char * | StrDup (const wchar_t *s)
| Allocate a char string with cs_malloc() and copy an UTF-8 version of the string into the newly allocated storage.
wchar_t * | StrDupW (const wchar_t *s)
| Allocate a wide char string with cs_malloc() and copy the string into the newly allocated storage.
wchar_t * | StrDupW (const char *s)
| Allocate a wide char string with cs_malloc() and copy the string converted from UTF-8 into the newly allocated storage.
template<typename T >
void | Swap (T &a, T &b)
| Swap two elements.
Floating point utilities
bool | IsNaN (float f)
| Checks if a floating point value is not-a-number.
bool | IsNaN_ext (double d)
| Checks if a floating point value is not-a-number.
bool | IsNaN (double d)
| Checks if a double-precision floating point value is not-a-number.
bool | IsFinite (float f)
| Checks if a floating point value is finite.
bool | IsFinite_ext (double d)
| Checks if a floating point value is not-a-number.
bool | IsFinite (double d)
| Checks if a double-precision floating point value is finite.
float | Infinity ()
| Return Infinity.
## Variables
ShaderVarStringID const | InvalidShaderVarStringID
| Invalid shader variable name.

## Detailed Description

Main namespace for CrystalSpace.

## Typedef Documentation

typedef StringID<StringSetTag::ShaderVar> CS::ShaderVarStringID

String ID for shader variable name.

Definition at line 61 of file shadervar.h.

typedef unsigned int CS::StringIDValue

Type for the actual value of a string ID.

Definition at line 32 of file strset.h.

## Enumeration Type Documentation

enum CS::RenderPriorityGrouping

Render grouping for mesh multipass rendering.

Enumerator:

  rpgByLayer | This first renders layer 1 for all meshes, then layer 2 for all meshes and and so on. This is the faster way of multipass rendering; however, some multipass effects produce incorrect results with this (especially when alpha transparency is involved).
  rpgByMesh | This all layers in order for the first mesh, then all layers in order for the second mesh and so on. This is the slower way of multipass rendering; however, it always results in correct results (and should thus be used when alpha transparency is involved).

Definition at line 110 of file engine.h.

## Function Documentation

template<typename T , typename Fn >

Fn& CS::ForEach | ( | T | it,
|  | Fn & | Func
| ) |  |

Iterate over all elements in the iterator and perform operation given by Func.

     csArray<int> anArray;
     anArray.Push (1);
     anArray.Push (4);
     ForEach (anArray.GetIterator (), OurFunctor ());

Definition at line 52 of file algorithms.h.

template<typename T , typename Fn >

Fn& CS::ForEach | ( | T * | start,
|  | T * | end,
|  | Fn & | Func
| ) |  |

Iterate over all elements in the list and perform operation given by Func.

Definition at line 66 of file algorithms.h.

template<typename T , typename Fn , typename P >

Fn& CS::ForEach | ( | T | it,
|  | Fn & | Func,
|  | P & | p
| ) |  |

Iterate over all elements in the iterator and perform operation given by Func.

Definition at line 81 of file algorithms.h.

template<typename T , typename Fn , typename P1 , typename P2 >

Fn& CS::ForEach | ( | T | it,
|  | Fn & | Func,
|  | P1 & | p1,
|  | P2 & | p2
| ) |  |

Iterate over all elements in the iterator and perform operation given by Func.

Definition at line 95 of file algorithms.h.

template<typename T , typename Fn , typename P1 , typename P2 , typename P3 >

Fn& CS::ForEach | ( | T | it,
|  | Fn & | Func,
|  | P1 & | p1,
|  | P2 & | p2,
|  | P3 & | p3
| ) |  |

Iterate over all elements in the iterator and perform operation given by Func.

Definition at line 109 of file algorithms.h.

template<typename Interface >

static csPtr<Interface> CS::GetChildObject | ( | iObject * | object | ) | `[inline, static]`

Get a child from an object that implements a specific interface.

Definition at line 186 of file object.h.

template<typename Interface >

static csPtr<Interface> CS::GetNamedChildObject | ( | iObject * | object,
|  | const char * | name
| ) |  | `[inline, static]`

Get a child from an object that has the given name and implements a specific interface.

Definition at line 198 of file object.h.

float CS::Infinity | ( |  | ) |

Return Infinity.

Definition at line 216 of file math.h.

bool CS::IsFinite | ( | float | f | ) |

Checks if a floating point value is finite.

Definition at line 177 of file math.h.

bool CS::IsFinite | ( | double | d | ) |

Checks if a double-precision floating point value is finite.

Definition at line 195 of file math.h.

bool CS::IsFinite_ext | ( | double | d | ) |

Checks if a floating point value is not-a-number.

bool CS::IsNaN | ( | float | f | ) |

Checks if a floating point value is not-a-number.

Definition at line 134 of file math.h.

bool CS::IsNaN | ( | double | d | ) |

Checks if a double-precision floating point value is not-a-number.

Definition at line 154 of file math.h.

bool CS::IsNaN_ext | ( | double | d | ) |

Checks if a floating point value is not-a-number.

csHandlerID CS::RegisterWeakListener | ( | iEventQueue * | q,
|  | iEventHandler * | listener,
|  | csRef< iEventHandler > & | handler
| ) |  |

Helper function for registering an event handler using a weak reference.

Use RemoveWeakListener() to remove an event handler registered with this function.

void CS::RemoveWeakListener | ( | iEventQueue * | q,
|  | csRef< iEventHandler > & | handler
| ) |  |

Helper function for removing an event handler that was registered with RegisterWeakListener().

char* CS::StrDup | ( | const char * | s | ) |

Allocate a char string with cs_malloc() and copy the string into the newly allocated storage.

This is a handy method for copying strings, in fact it is an analogue of the strdup() function from string.h, but using cs_malloc(). (Also, strdup() is not present on some platforms). To free the pointer the caller should call cs_free().

char* CS::StrDup | ( | const wchar_t * | s | ) |

Allocate a char string with cs_malloc() and copy an UTF-8 version of the string into the newly allocated storage.

See also:
  StrDup(const char*)

wchar_t* CS::StrDupW | ( | const wchar_t * | s | ) |

Allocate a wide char string with cs_malloc() and copy the string into the newly allocated storage.

See also:
  StrDup(const char*)

wchar_t* CS::StrDupW | ( | const char * | s | ) |

Allocate a wide char string with cs_malloc() and copy the string converted from UTF-8 into the newly allocated storage.

See also:
  StrDup(const char*)

template<typename T >

void CS::Swap | ( | T & | a,
|  | T & | b
| ) |  |

Swap two elements.

Definition at line 34 of file algorithms.h.

## Variable Documentation

ShaderVarStringID const CS::InvalidShaderVarStringID

Initial value:

        InvalidStringID<StringSetTag::ShaderVar> ()

Invalid shader variable name.

Definition at line 63 of file shadervar.h.