CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csEngine Class Reference

The 3D engine. More...

#include <engine.h>

Inheritance diagram for csEngine:

iEngine iBase List of all members.

Public Methods

iEngineSequenceManagerGetEngineSequenceManager ()
 Get/create the engine sequence manager. More...

 csEngine (iBase *iParent)
 Initialize an empty engine. More...

virtual ~csEngine ()
 Delete the engine and all entities it contains. More...

void Report (const char *description,...)
 Report a notification message. More...

void Warn (const char *description,...)
 Report a warning. More...

void ReportBug (const char *description,...)
 Report a bug. More...

bool CheckConsistency ()
 Check consistency of the loaded elements which comprise the world. More...

virtual void PrepareTextures ()
 Prepare the textures. More...

virtual void PrepareMeshes ()
 Calls UpdateMove for all meshes to initialise bsp bounding boxes. More...

virtual void ShineLights (iRegion *region=0, iProgressMeter *meter=0)
 Calculate all lighting information. More...

virtual iObjectQueryObject ()
 Query the iObject for the engine. More...

csObjectQueryCsObject ()
 Query the csObject for the engine. More...

virtual bool Prepare (iProgressMeter *meter=0)
 Prepare the engine. More...

virtual void ForceRelight (iRegion *region, iProgressMeter *meter)
 Force a relight of all lighting. More...

virtual void ForceRelight (iStatLight *light, iRegion *region)
 Force a relight for the given light. More...

virtual void RemoveLight (iStatLight *light)
 Remove a light and update all lightmaps. More...

void InvalidateLightmaps ()
 Invalidate all lightmaps. More...

virtual int GetBeginDrawFlags () const
 Get the required flags for 3D->BeginDraw() which should be called from the application. More...

csTicks GetLastAnimationTime () const
 Get the last animation time. More...

virtual void SetLightingCacheMode (int mode)
 Set the mode for the lighting cache. More...

virtual int GetLightingCacheMode ()
 Get the mode for the lighting cache. More...

virtual void SetFastMeshThresshold (int th)
 Set the fastmesh thresshold. More...

virtual int GetFastMeshThresshold () const
 Get the fastmesh thresshold. More...

virtual void SetClearZBuf (bool yesno)
 Set clear z buffer flag. More...

virtual bool GetClearZBuf () const
 Get clear z buffer flag. More...

virtual bool GetDefaultClearZBuf () const
 Get default clear z-buffer flag. More...

virtual void SetClearScreen (bool yesno)
 Set clear screen flag. More...

virtual bool GetClearScreen () const
 Get clear screen flag. More...

virtual bool GetDefaultClearScreen () const
 Get default clear screen flag. More...

virtual void SetMaxLightmapSize (int w, int h)
 Set the maximum lightmap dimensions. More...

virtual void GetMaxLightmapSize (int &w, int &h)
 Retrieve maximum lightmap size. More...

virtual void GetDefaultMaxLightmapSize (int &w, int &h)
 Retrieve default maximum lightmap size. More...

virtual void GetDefaultAmbientLight (csColor &c) const
 Return the default amount of ambient light. More...

virtual bool GetLightmapsRequirePO2 () const
 Get a boolean which indicates if power of two lightmaps are required. More...

virtual int GetMaxLightmapAspectRatio () const
 Get the maximum aspect ratio for lightmaps. More...

virtual csPtr< iFrustumViewCreateFrustumView ()
 Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows(). More...

virtual csPtr< iObjectWatcherCreateObjectWatcher ()
 Create an object watcher instance that you can use to watch other objects. More...

virtual void WantToDie (iMeshWrapper *mesh)
 Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime). More...

virtual void ResetWorldSpecificSettings ()
 Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults. More...

void ReadConfig (iConfigFile *)
 Read configuration file (using the system driver) for all engine specific values. More...

void StartEngine ()
 Prepare for creation of a world. More...

csTextureListGetTextures () const
 Return the object managing all loaded textures. More...

csMaterialListGetMaterials () const
 Return the object managing all loaded materials. More...

csSharedVariableListGetVariables () const
 Return the object managing all shared variables. More...

virtual csPtr< iMaterialCreateBaseMaterial (iTextureWrapper *txt)
 Create a base material. More...

virtual csPtr< iMaterialCreateBaseMaterial (iTextureWrapper *txt, int num_layers, iTextureWrapper **wrappers, csTextureLayer *layers)
 Create a base material that can be used to give to the texture manager. More...

virtual iSharedVariableListGetVariableList () const
 Get the list of all shared variables. More...

virtual iMaterialListGetMaterialList () const
 Get the list of all materials. More...

virtual iTextureListGetTextureList () const
 Get the list of all textures. More...

virtual iRegionCreateRegion (const char *name)
 Create a new region and add it to the region list. More...

virtual iRegionListGetRegions ()
 Get the list of all regions. More...

virtual csPtr< iMeshWrapperCreateSectorWallsMesh (iSector *sector, const char *name)
 Convenience function to create the thing containing the convex outline of a sector. More...

virtual csPtr< iMeshWrapperCreateThingMesh (iSector *sector, const char *name)
 Convenience function to create a thing mesh in a sector. More...

void AddDynLight (csDynLight *dyn)
 Add a dynamic light to the engine. More...

void RemoveDynLight (csDynLight *dyn)
 Remove a dynamic light from the engine. More...

virtual iDynLightGetFirstDynLight () const
 Return the first dynamic light in this engine. More...

virtual int GetNearbyLights (iSector *sector, const csVector3 &pos, uint32 flags, iLight **lights, int max_num_lights)
 Get all nearby lights. More...

virtual int GetNearbyLights (iSector *sector, const csBox3 &box, uint32 flags, iLight **lights, int max_num_lights)
 Get all nearby lights. More...

virtual csPtr< iSectorIteratorGetNearbySectors (iSector *sector, const csVector3 &pos, float radius)
 This routine returns an iterator to iterate over all nearby sectors. More...

virtual csPtr< iObjectIteratorGetNearbyObjects (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true)
 This routine returns an iterator to iterate over all objects that are within a radius of a given position. More...

virtual csPtr< iObjectIteratorGetVisibleObjects (iSector *sector, const csVector3 &pos)
 This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More...

virtual csPtr< iObjectIteratorGetVisibleObjects (iSector *sector, const csFrustum &frustum)
 This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position. More...

virtual csPtr< iMeshWrapperIteratorGetNearbyMeshes (iSector *sector, const csVector3 &pos, float radius, bool crossPortals=true)
 This routine returns an iterator to iterate over all meshes that are within a radius of a given position. More...

virtual csPtr< iMeshWrapperIteratorGetVisibleMeshes (iSector *sector, const csVector3 &pos)
 This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. More...

virtual csPtr< iMeshWrapperIteratorGetVisibleMeshes (iSector *sector, const csFrustum &frustum)
 This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position. More...

virtual bool RemoveObject (iBase *object)
 Convenience function to 'remove' a CS object from the engine. More...

void AddHalo (csLight *Light)
 Add a halo attached to given light to the engine. More...

void RemoveHalo (csLight *Light)
 Remove halo attached to given light from the engine. More...

virtual void Draw (iCamera *c, iClipper2D *clipper)
 Draw the 3D world given a camera and a clipper. More...

virtual csPtr< iLightIteratorGetLightIterator (iRegion *region=0)
 Create an iterator to iterate over all static lights of the engine. More...

virtual void RegisterRenderPriority (const char *name, long priority, int rendsort=CS_RENDPRI_NONE, bool do_camera=false)
 Register a new render priority. More...

virtual long GetRenderPriority (const char *name) const
 Get a render priority by name. More...

virtual void SetRenderPriorityCamera (long priority, bool do_camera)
 Set the render priority camera flag. More...

virtual bool GetRenderPriorityCamera (const char *name) const
 Get the render priority camera flag. More...

virtual bool GetRenderPriorityCamera (long priority) const
 Get the render priority camera flag. More...

virtual int GetRenderPrioritySorting (const char *name) const
 Get the render priority sorting flag. More...

virtual int GetRenderPrioritySorting (long priority) const
 Get the render priority sorting flag. More...

virtual long GetSkyRenderPriority () const
 Get the render priority for sky objects (attached to 'sky' name). More...

virtual long GetWallRenderPriority () const
 Get the render priority for wall objects (attached to 'wall' name). More...

virtual long GetObjectRenderPriority () const
 Get the render priority for general objects (attached to 'object' name). More...

virtual long GetAlphaRenderPriority () const
 Get the render priority for alpha objects (attached to 'alpha' name). More...

virtual void ClearRenderPriorities ()
 Clear all render priorities. More...

virtual int GetRenderPriorityCount () const
 Get the number of render priorities. More...

virtual const char * GetRenderPriorityName (long priority) const
 Get the name of the render priority. More...

virtual bool Initialize (iObjectRegistry *object_reg)
 Initialize the engine. More...

virtual bool HandleEvent (iEvent &Event)
 We need to handle some events. More...

virtual int GetTextureFormat () const
 Query the format to load textures (usually this depends on texture manager). More...

virtual void DeleteAll ()
 Clear the entire engine. More...

virtual iTextureWrapperCreateTexture (const char *iName, const char *iFileName, csColor *iTransp, int iFlags)
 Register a texture to be loaded during Prepare(). More...

virtual iTextureWrapperCreateBlackTexture (const char *name, int w, int h, csColor *iTransp, int iFlags)
 Create a black texture. More...

virtual iMaterialWrapperCreateMaterial (const char *iName, iTextureWrapper *texture)
 Register a material to be loaded during Prepare(). More...

virtual iSectorCreateSector (const char *iName)
 Create a empty sector with given name. More...

virtual iSectorListGetSectors ()
 Return the list of sectors. More...

virtual iMeshFactoryListGetMeshFactories ()
 Return the list of mesh factories. More...

virtual iMeshListGetMeshes ()
 Return the list of meshes. More...

virtual iCollectionListGetCollections ()
 Return the list of collections. More...

virtual iCameraPositionListGetCameraPositions ()
 Return the list of camera positions. More...

virtual csPtr< iCameraCreateCamera ()
 Create a new camera. More...

virtual csPtr< iStatLightCreateLight (const char *name, const csVector3 &pos, float radius, const csColor &color, bool pseudoDyn)
 Create a static/pseudo-dynamic light. More...

virtual iStatLightFindLightID (const char *light_id) const
 Find a static/pseudo-dynamic light by ID. More...

virtual iStatLightFindLight (const char *Name, bool RegionOnly=false) const
 Find a static/pseudo-dynamic light by name. More...

virtual csPtr< iDynLightCreateDynLight (const csVector3 &pos, float radius, const csColor &color)
 Create a dynamic light. More...

virtual void RemoveDynLight (iDynLight *)
 Remove a dynamic light. More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (const char *classId, const char *name)
 Create a mesh factory wrapper from a mesh plugin. More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (iMeshObjectFactory *, const char *name)
 Create a mesh factory wrapper for an existing mesh factory. More...

virtual csPtr< iMeshFactoryWrapperCreateMeshFactory (const char *name)
 Create an uninitialized mesh factory wrapper. More...

virtual csPtr< iLoaderContextCreateLoaderContext (iRegion *region, bool curRegOnly)
 Create a loader context that you can give to loader plugins. More...

virtual csPtr< iMeshFactoryWrapperLoadMeshFactory (const char *name, const char *loaderClassId, iDataBuffer *input)
 Load mesh factory. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (iMeshFactoryWrapper *factory, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0))
 Create a mesh wrapper from a mesh factory wrapper. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (iMeshObject *, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0))
 Create a mesh wrapper for an existing mesh object. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (const char *classid, const char *name, iSector *sector=0, const csVector3 &pos=csVector3(0, 0, 0))
 Create a mesh wrapper from a class id. More...

virtual csPtr< iMeshWrapperCreateMeshWrapper (const char *name)
 Create an uninitialized mesh wrapper. More...

virtual csPtr< iMeshWrapperLoadMeshWrapper (const char *name, const char *loaderClassId, iDataBuffer *input, iSector *sector, const csVector3 &pos)
 Load mesh object. More...

virtual iClipper2DGetTopLevelClipper () const
 Get the top-level clipper. More...

virtual void SetAmbientLight (const csColor &c)
 Set the amount of ambient light. More...

virtual void GetAmbientLight (csColor &c) const
 Return the amount of ambient light. More...

virtual iMaterialWrapperFindMaterial (const char *name, iRegion *region=0)
 Find the given material. More...

virtual iTextureWrapperFindTexture (const char *name, iRegion *region=0)
 Find the given texture. More...

virtual iSectorFindSector (const char *name, iRegion *region=0)
 Find the given sector. More...

virtual iMeshWrapperFindMeshObject (const char *name, iRegion *region=0)
 Find the given mesh object. More...

virtual iMeshFactoryWrapperFindMeshFactory (const char *name, iRegion *region=0)
 Find the given mesh factory. More...

virtual iCameraPositionFindCameraPosition (const char *name, iRegion *region=0)
 Find the given camera position. More...

virtual iCollectionFindCollection (const char *name, iRegion *region=0)
 Find the given collection. More...

virtual void SetCacheManager (iCacheManager *cache_mgr)
 Set the cache manager that the engine will use. More...

virtual iCacheManagerGetCacheManager ()
 Get the cache manager that the engine is currently using. More...

virtual void SetContext (iTextureHandle *txt)
 Point engine to rendering context (for procedural textures). More...

virtual iTextureHandleGetContext () const
 Return the current drawing context. More...

virtual iRenderLoopManagerGetRenderLoopManager ()
 For NR: Retrieve the render loop manager. More...

virtual iRenderLoopGetCurrentDefaultRenderloop ()
 For NR: Returns the current render loop. More...

virtual bool SetCurrentDefaultRenderloop (iRenderLoop *loop)
 Set the current render loop. More...


Static Public Methods

void SetMaxProcessPolygons (int m)
 Set the maximum number of polygons to process in one frame. More...

int GetMaxProcessPolygons ()
 Get the maximum number of polygons to process in one frame. More...

bool ProcessPolygon ()
 Indicate that we will process another polygon. More...

bool ProcessLastPolygon ()
 Return true if we are processing the last polygon. More...


Public Attributes

csRef< iVFSVFS
 This is the Virtual File System object where all the files used by the engine live. More...

csRef< iEngineSequenceManagereseqmgr
 Pointer to the engine sequence manager. More...

csRef< iReporterReporter
 Pointer to an optional reporter that will be used for notification and warning messages. More...

csRefArray< iBasecleanup
 This is a vector which holds objects of type 'csCleanable'. More...

csSectorList sectors
 List of sectors in the engine. More...

csCollectionList collections
 List of all collections in the engine. More...

csMeshFactoryList mesh_factories
 List of mesh object factories. More...

csEngineMeshList meshes
 List of all meshes in the engine. More...

csCameraPositionList camera_positions
 The list of all camera position objects. More...

csRef< iGraphics3DG3D
 The 3D driver. More...

csRef< iGraphics2DG2D
 The 2D driver. More...

csRef< iImageIOImageLoader
 The graphics loader. More...

csRef< iStringSetStrings
 For NR: @ Document me! More...

csRef< iShaderManagerShaderManager
 For NR: @ Document me! More...

csRef< iCacheManagercache_mgr
 The following variable is only set if the engine had to create its own cache manager. More...

G3D_FOGMETHOD fogmethod
 The fog mode this G3D implements. More...

bool NeedPO2Maps
 Does the 3D driver require power-of-two lightmaps? More...

int MaxAspectRatio
 Maximum texture aspect ratio. More...

csRegionList regions
 The list of all regions currently loaded. More...

csStringArray render_priorities
 The list of all named render priorities. More...

csArray< int > render_priority_sortflags
 Sorting flags for the render priorities. More...

csArray< bool > render_priority_cameraflags
 Do_camera flags for the render priorities. More...

long render_priority_sky
 The engine knows about the following render priorities and keeps them here:. More...

csRef< iRenderLoopdefaultRenderLoop
 Default render loop. More...

csRenderLoopManager * renderLoopManager
 Render loop manager. More...

iCameracurrent_camera
 The current camera for drawing the world. More...

iClipper2Dtop_clipper
 The top-level clipper we are currently using for drawing. More...

csEngine::eiComponent scfiComponent
 iComponent implementation. More...

csEngine::EventHandlerscfiEventHandler
 iEventHandler implementation. More...


Static Public Attributes

int frame_width
 Remember dimensions of display. More...

int frame_height
 Remember dimensions of display. More...

iObjectRegistryobject_reg
 Remember iObjectRegistry. More...

csEngine * current_engine
 The shared engine instance. More...

iEnginecurrent_iengine
 The shared engine instance. More...

bool use_new_radiosity
 Need to render using newradiosity? More...

int lightcache_mode
 Option variable: force lightmap recalculation? More...

int lightmap_quality
 Option variable: quality for lightmap calculation. More...

bool do_force_revis
 Option variable: force visibility recalculation? More...

bool do_rad_debug
 Option variable: radiosity debugging (step by step)? More...

int max_lightmap_w
 Maximum lightmap dimensions. More...


Detailed Description

The 3D engine.

This class manages all components which comprise a 3D world including sectors, polygons, curves, mesh objects, etc.

Definition at line 222 of file csengine/engine.h.


Constructor & Destructor Documentation

csEngine::csEngine iBase   iParent
 

Initialize an empty engine.

The only thing that is valid just after creating the engine is the configurator object which you can use to configure the engine before continuing (see GetEngineConfig()).

virtual csEngine::~csEngine   [virtual]
 

Delete the engine and all entities it contains.

All objects added to this engine by the user (like Things, Sectors, ...) will be deleted as well. If you don't want this then you should unlink them manually before destroying the engine.


Member Function Documentation

void csEngine::AddDynLight csDynLight   dyn
 

Add a dynamic light to the engine.

void csEngine::AddHalo csLight   Light
 

Add a halo attached to given light to the engine.

bool csEngine::CheckConsistency  
 

Check consistency of the loaded elements which comprise the world.

Currently this function only checks if polygons have three or more vertices and if the vertices are coplanar (if more than three). This function prints out warnings for all found errors. Returns true if everything is in order.

virtual void csEngine::ClearRenderPriorities   [virtual]
 

Clear all render priorities.

Implements iEngine.

virtual csPtr<iMaterial> csEngine::CreateBaseMaterial iTextureWrapper   txt,
int    num_layers,
iTextureWrapper **    wrappers,
csTextureLayer   layers
[virtual]
 

Create a base material that can be used to give to the texture manager.

This version also supports texture layers. Assign to a csRef or use DecRef().

Parameters:
txt  the base texture (lowermost texture layer)
num_layers  the number of texture layers supplid in the next parameter
wrappers  an array of pointers to iTextureWrapper objects, supplying the texture to use for each texture layer
layers  an array of csTextureLayer structures cooresponding to each texture layer and describing how the layer is aligned and blended with the layers beneath it.
See also:
CreateBaseMaterial(iTextureWrapper* txt) note about registering/preparing materials.

Implements iEngine.

virtual csPtr<iMaterial> csEngine::CreateBaseMaterial iTextureWrapper   txt [virtual]
 

Create a base material.

Implements iEngine.

virtual iTextureWrapper* csEngine::CreateBlackTexture const char *    name,
int    w,
int    h,
csColor   iTransp,
int    iFlags
[virtual]
 

Create a black texture.

This is mostly useful for procedural textures.

Parameters:
name  The name to use for this texture in the engine
w  the texture width (must be a power of 2, eg 64, 128, 256, 512...)
h  the texture height (must be a power of 2, eg 64, 128, 256, 512...)
transp  pixels in the image with this key color will be considered transparent instead of being drawn
iFlags  see CreateTexture()
See also:
CreateTexture() note about registering/preparing textures.

Implements iEngine.

virtual csPtr<iCamera> csEngine::CreateCamera   [virtual]
 

Create a new camera.

Implements iEngine.

virtual csPtr<iDynLight> csEngine::CreateDynLight const csVector3   pos,
float    radius,
const csColor   color
[virtual]
 

Create a dynamic light.

Implements iEngine.

virtual csPtr<iFrustumView> csEngine::CreateFrustumView   [virtual]
 

Create a iFrustumView instance that you can give to iVisibilityCuller->CastShadows().

You can initialize that instance so that your own function is called for every object that is being visited.

Implements iEngine.

virtual csPtr<iStatLight> csEngine::CreateLight const char *    name,
const csVector3   pos,
float    radius,
const csColor   color,
bool    pseudoDyn
[virtual]
 

Create a static/pseudo-dynamic light.

Implements iEngine.

virtual csPtr<iLoaderContext> csEngine::CreateLoaderContext iRegion   region,
bool    curRegOnly
[virtual]
 

Create a loader context that you can give to loader plugins.

It will basically allow loader plugins to find materials.

Parameters:
region  optional loader region
curRegOnly  if region is valid and and curRegOnly is true then only that region will be searched. Assign to a csRef or use DecRef().

Implements iEngine.

virtual iMaterialWrapper* csEngine::CreateMaterial const char *    iName,
iTextureWrapper   texture
[virtual]
 

Register a material to be loaded during Prepare().

Implements iEngine.

virtual csPtr<iMeshFactoryWrapper> csEngine::CreateMeshFactory const char *    name [virtual]
 

Create an uninitialized mesh factory wrapper.

Implements iEngine.

virtual csPtr<iMeshFactoryWrapper> csEngine::CreateMeshFactory iMeshObjectFactory  ,
const char *    name
[virtual]
 

Create a mesh factory wrapper for an existing mesh factory.

Implements iEngine.

virtual csPtr<iMeshFactoryWrapper> csEngine::CreateMeshFactory const char *    classId,
const char *    name
[virtual]
 

Create a mesh factory wrapper from a mesh plugin.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateMeshWrapper const char *    name [virtual]
 

Create an uninitialized mesh wrapper.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateMeshWrapper const char *    classid,
const char *    name,
iSector   sector = 0,
const csVector3   pos = csVector3(0, 0, 0)
[virtual]
 

Create a mesh wrapper from a class id.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateMeshWrapper iMeshObject  ,
const char *    name,
iSector   sector = 0,
const csVector3   pos = csVector3(0, 0, 0)
[virtual]
 

Create a mesh wrapper for an existing mesh object.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateMeshWrapper iMeshFactoryWrapper   factory,
const char *    name,
iSector   sector = 0,
const csVector3   pos = csVector3(0, 0, 0)
[virtual]
 

Create a mesh wrapper from a mesh factory wrapper.

Implements iEngine.

virtual csPtr<iObjectWatcher> csEngine::CreateObjectWatcher   [virtual]
 

Create an object watcher instance that you can use to watch other objects.

The engine will not keep a reference to this object.

Implements iEngine.

virtual iRegion* csEngine::CreateRegion const char *    name [virtual]
 

Create a new region and add it to the region list.

If the region already exists then this function will just return the pointer to that region.

Parameters:
name  the engine name for the region

Implements iEngine.

virtual iSector* csEngine::CreateSector const char *    iName [virtual]
 

Create a empty sector with given name.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateSectorWallsMesh iSector   sector,
const char *    name
[virtual]
 

Convenience function to create the thing containing the convex outline of a sector.

The thing will be empty but it will have CS_ZBUF_FILL set (so that the Z-buffer will be filled by the polygons of this object) and have 'wall' as render priority. This version creates a mesh wrapper. Assign to a csRef or use DecRef().

Parameters:
sector  the sector to add walls to
name  the engine name of the walls mesh that will be created

Implements iEngine.

virtual iTextureWrapper* csEngine::CreateTexture const char *    iName,
const char *    iFileName,
csColor   iTransp,
int    iFlags
[virtual]
 

Register a texture to be loaded during Prepare().

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::CreateThingMesh iSector   sector,
const char *    name
[virtual]
 

Convenience function to create a thing mesh in a sector.

This mesh will have CS_ZBUF_USE set (use Z-buffer fully) and have 'object' as render priority. This means this function is useful for general objects. Assign to a csRef or use DecRef().

Parameters:
sector  the sector to add the object to
name  the engine name of the mesh that will be created

Implements iEngine.

virtual void csEngine::DeleteAll   [virtual]
 

Clear the entire engine.

Implements iEngine.

virtual void csEngine::Draw iCamera   c,
iClipper2D   clipper
[virtual]
 

Draw the 3D world given a camera and a clipper.

Note that in order to be able to draw using the given 3D driver all textures must have been registered to that driver (using Prepare()). Note that you need to call Prepare() again if you switch to another 3D driver.

Implements iEngine.

virtual iCameraPosition* csEngine::FindCameraPosition const char *    name,
iRegion   region = 0
[virtual]
 

Find the given camera position.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired camera position
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iCollection* csEngine::FindCollection const char *    name,
iRegion   region = 0
[virtual]
 

Find the given collection.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired collection
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iStatLight* csEngine::FindLight const char *    Name,
bool    RegionOnly = false
const [virtual]
 

Find a static/pseudo-dynamic light by name.

Implements iEngine.

virtual iStatLight* csEngine::FindLightID const char *    light_id const [virtual]
 

Find a static/pseudo-dynamic light by ID.

Implements iEngine.

virtual iMaterialWrapper* csEngine::FindMaterial const char *    name,
iRegion   region = 0
[virtual]
 

Find the given material.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired material
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iMeshFactoryWrapper* csEngine::FindMeshFactory const char *    name,
iRegion   region = 0
[virtual]
 

Find the given mesh factory.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired mesh factory
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iMeshWrapper* csEngine::FindMeshObject const char *    name,
iRegion   region = 0
[virtual]
 

Find the given mesh object.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired mesh
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iSector* csEngine::FindSector const char *    name,
iRegion   region = 0
[virtual]
 

Find the given sector.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired sector
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual iTextureWrapper* csEngine::FindTexture const char *    name,
iRegion   region = 0
[virtual]
 

Find the given texture.

The name can be a normal name. In that case this function will look in all regions except if region is not 0 in which case it will only look in that region. If the name is specified as 'regionname/objectname' then this function will only look in the specified region and return 0 if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Parameters:
name  the engine name of the desired texture
region  if specified, search only this region (also see note above)

Implements iEngine.

virtual void csEngine::ForceRelight iStatLight   light,
iRegion   region
[virtual]
 

Force a relight for the given light.

This is useful to update the lightmaps after a static or pseudo-dynamic light has been added (don't use this for dynamic lights). If there are a lot of objects this function can be slow. The optional region can be given to limit calculation to objects in the region.

The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not.

Implements iEngine.

virtual void csEngine::ForceRelight iRegion   region,
iProgressMeter   meter
[virtual]
 

Force a relight of all lighting.

It is better to call this instead of calling engine->Prepare() again as engine->Prepare() will also do other stuff (like registering textures). Warning! This function can be very slow (depending on the number of lights and objects in the world). The optional region can be given to limit calculation to objects in the region.

The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not.

Implements iEngine.

virtual long csEngine::GetAlphaRenderPriority   const [inline, virtual]
 

Get the render priority for alpha objects (attached to 'alpha' name).

Implements iEngine.

Definition at line 872 of file csengine/engine.h.

virtual void csEngine::GetAmbientLight csColor   c const [virtual]
 

Return the amount of ambient light.

Implements iEngine.

virtual int csEngine::GetBeginDrawFlags   const [inline, virtual]
 

Get the required flags for 3D->BeginDraw() which should be called from the application.

These flags must be or-ed with optional other flags that the application might be interested in.

Implements iEngine.

Definition at line 651 of file csengine/engine.h.

References CSDRAW_CLEARSCREEN, and CSDRAW_CLEARZBUFFER.

virtual iCacheManager* csEngine::GetCacheManager   [virtual]
 

Get the cache manager that the engine is currently using.

Implements iEngine.

virtual iCameraPositionList* csEngine::GetCameraPositions   [inline, virtual]
 

Return the list of camera positions.

Implements iEngine.

Definition at line 955 of file csengine/engine.h.

References csCameraPositionList::scfiCameraPositionList.

virtual bool csEngine::GetClearScreen   const [inline, virtual]
 

Get clear screen flag.

Implements iEngine.

Definition at line 695 of file csengine/engine.h.

virtual bool csEngine::GetClearZBuf   const [inline, virtual]
 

Get clear z buffer flag.

Implements iEngine.

Definition at line 683 of file csengine/engine.h.

virtual iCollectionList* csEngine::GetCollections   [inline, virtual]
 

Return the list of collections.

Implements iEngine.

Definition at line 952 of file csengine/engine.h.

References csCollectionList::scfiCollectionList.

virtual iTextureHandle* csEngine::GetContext   const [virtual]
 

Return the current drawing context.

Implements iEngine.

virtual iRenderLoop* csEngine::GetCurrentDefaultRenderloop   [virtual]
 

For NR: Returns the current render loop.

Remarks:
This will the loop that is set to be the current default with SetCurrentDefaultRenderloop(). This doesn't have to be the engine's default render loop (note the difference between the "current" and "default" render loop - former one is the loop used currently for drawing, latter one is a default loop created at engine initialization time.) To retrieve the default loop, use

Implements iEngine.

virtual void csEngine::GetDefaultAmbientLight csColor   c const [virtual]
 

Return the default amount of ambient light.

Implements iEngine.

virtual bool csEngine::GetDefaultClearScreen   const [inline, virtual]
 

Get default clear screen flag.

Implements iEngine.

Definition at line 698 of file csengine/engine.h.

virtual bool csEngine::GetDefaultClearZBuf   const [inline, virtual]
 

Get default clear z-buffer flag.

Implements iEngine.

Definition at line 686 of file csengine/engine.h.

virtual void csEngine::GetDefaultMaxLightmapSize int &    w,
int &    h
[inline, virtual]
 

Retrieve default maximum lightmap size.

Implements iEngine.

Definition at line 710 of file csengine/engine.h.

iEngineSequenceManager* csEngine::GetEngineSequenceManager  
 

Get/create the engine sequence manager.

virtual int csEngine::GetFastMeshThresshold   const [inline, virtual]
 

Get the fastmesh thresshold.

Implements iEngine.

Definition at line 674 of file csengine/engine.h.

virtual iDynLight* csEngine::GetFirstDynLight   const [virtual]
 

Return the first dynamic light in this engine.

Implements iEngine.

csTicks csEngine::GetLastAnimationTime   const [inline]
 

Get the last animation time.

Definition at line 664 of file csengine/engine.h.

References csTicks.

virtual int csEngine::GetLightingCacheMode   [inline, virtual]
 

Get the mode for the lighting cache.

Implements iEngine.

Definition at line 669 of file csengine/engine.h.

References lightcache_mode.

virtual csPtr<iLightIterator> csEngine::GetLightIterator iRegion   region = 0 [inline, virtual]
 

Create an iterator to iterate over all static lights of the engine.

Implements iEngine.

Definition at line 843 of file csengine/engine.h.

virtual bool csEngine::GetLightmapsRequirePO2   const [inline, virtual]
 

Get a boolean which indicates if power of two lightmaps are required.

Implements iEngine.

Definition at line 715 of file csengine/engine.h.

References NeedPO2Maps.

virtual iMaterialList* csEngine::GetMaterialList   const [virtual]
 

Get the list of all materials.

Implements iEngine.

csMaterialList* csEngine::GetMaterials   const [inline]
 

Return the object managing all loaded materials.

Definition at line 754 of file csengine/engine.h.

virtual int csEngine::GetMaxLightmapAspectRatio   const [inline, virtual]
 

Get the maximum aspect ratio for lightmaps.

Implements iEngine.

Definition at line 716 of file csengine/engine.h.

References MaxAspectRatio.

virtual void csEngine::GetMaxLightmapSize int &    w,
int &    h
[inline, virtual]
 

Retrieve maximum lightmap size.

Implements iEngine.

Definition at line 707 of file csengine/engine.h.

References max_lightmap_w.

int csEngine::GetMaxProcessPolygons   [inline, static]
 

Get the maximum number of polygons to process in one frame.

Definition at line 612 of file csengine/engine.h.

virtual iMeshList* csEngine::GetMeshes   [inline, virtual]
 

Return the list of meshes.

Implements iEngine.

Definition at line 949 of file csengine/engine.h.

virtual iMeshFactoryList* csEngine::GetMeshFactories   [inline, virtual]
 

Return the list of mesh factories.

Implements iEngine.

Definition at line 946 of file csengine/engine.h.

virtual int csEngine::GetNearbyLights iSector   sector,
const csBox3   box,
uint32    flags,
iLight **    lights,
int    max_num_lights
[virtual]
 

Get all nearby lights.

Implements iEngine.

virtual int csEngine::GetNearbyLights iSector   sector,
const csVector3   pos,
uint32    flags,
iLight **    lights,
int    max_num_lights
[virtual]
 

Get all nearby lights.

Implements iEngine.

virtual csPtr<iMeshWrapperIterator> csEngine::GetNearbyMeshes iSector   sector,
const csVector3   pos,
float    radius,
bool    crossPortals = true
[virtual]
 

This routine returns an iterator to iterate over all meshes that are within a radius of a given position.

If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in.

Implements iEngine.

virtual csPtr<iObjectIterator> csEngine::GetNearbyObjects iSector   sector,
const csVector3   pos,
float    radius,
bool    crossPortals = true
[virtual]
 

This routine returns an iterator to iterate over all objects that are within a radius of a given position.

The current implementation only does meshes but in future lights will also be supported. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects. If crossPortals is true it will search through portals. Otherwise it will limit the search to the sector passed in. If you only want to have meshes then it is more efficient to call GetNearbyMeshes() as you can then avoid the call to SCF_QUERY_INTERFACE.

Implements iEngine.

virtual csPtr<iSectorIterator> csEngine::GetNearbySectors iSector   sector,
const csVector3   pos,
float    radius
[virtual]
 

This routine returns an iterator to iterate over all nearby sectors.

Assign to a csRef or use DecRef().

Implements iEngine.

virtual long csEngine::GetObjectRenderPriority   const [inline, virtual]
 

Get the render priority for general objects (attached to 'object' name).

Implements iEngine.

Definition at line 870 of file csengine/engine.h.

virtual iRegionList* csEngine::GetRegions   [virtual]
 

Get the list of all regions.

Implements iEngine.

virtual iRenderLoopManager* csEngine::GetRenderLoopManager   [virtual]
 

For NR: Retrieve the render loop manager.

Implements iEngine.

virtual long csEngine::GetRenderPriority const char *    name const [virtual]
 

Get a render priority by name.

Implements iEngine.

virtual bool csEngine::GetRenderPriorityCamera long    priority const [virtual]
 

Get the render priority camera flag.

Implements iEngine.

virtual bool csEngine::GetRenderPriorityCamera const char *    name const [virtual]
 

Get the render priority camera flag.

Implements iEngine.

virtual int csEngine::GetRenderPriorityCount   const [virtual]
 

Get the number of render priorities.

Implements iEngine.

virtual const char* csEngine::GetRenderPriorityName long    priority const [virtual]
 

Get the name of the render priority.

Implements iEngine.

virtual int csEngine::GetRenderPrioritySorting long    priority const [virtual]
 

Get the render priority sorting flag.

Implements iEngine.

virtual int csEngine::GetRenderPrioritySorting const char *    name const [virtual]
 

Get the render priority sorting flag.

Implements iEngine.

virtual iSectorList* csEngine::GetSectors   [inline, virtual]
 

Return the list of sectors.

Implements iEngine.

Definition at line 943 of file csengine/engine.h.

virtual long csEngine::GetSkyRenderPriority   const [inline, virtual]
 

Get the render priority for sky objects (attached to 'sky' name).

Implements iEngine.

Definition at line 866 of file csengine/engine.h.

References render_priority_sky.

virtual int csEngine::GetTextureFormat   const [virtual]
 

Query the format to load textures (usually this depends on texture manager).

Implements iEngine.

virtual iTextureList* csEngine::GetTextureList   const [virtual]
 

Get the list of all textures.

Implements iEngine.

csTextureList* csEngine::GetTextures   const [inline]
 

Return the object managing all loaded textures.

Definition at line 749 of file csengine/engine.h.

virtual iClipper2D* csEngine::GetTopLevelClipper   const [virtual]
 

Get the top-level clipper.

Implements iEngine.

virtual iSharedVariableList* csEngine::GetVariableList   const [virtual]
 

Get the list of all shared variables.

Implements iEngine.

csSharedVariableList* csEngine::GetVariables   const [inline]
 

Return the object managing all shared variables.

Definition at line 759 of file csengine/engine.h.

virtual csPtr<iMeshWrapperIterator> csEngine::GetVisibleMeshes iSector   sector,
const csFrustum   frustum
[virtual]
 

This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.

This routine has a frustum restricting the view. CURRENTLY NOT IMPLEMENTED!

Implements iEngine.

virtual csPtr<iMeshWrapperIterator> csEngine::GetVisibleMeshes iSector   sector,
const csVector3   pos
[virtual]
 

This routine returns an iterator to iterate over all meshes that are potentially visible as seen from a given position.

This routine assumes full 360 degree visibility. CURRENTLY NOT IMPLEMENTED!

Implements iEngine.

virtual csPtr<iObjectIterator> csEngine::GetVisibleObjects iSector   sector,
const csFrustum   frustum
[virtual]
 

This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.

This routine has a frustum restricting the view. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects.

If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED!

Implements iEngine.

virtual csPtr<iObjectIterator> csEngine::GetVisibleObjects iSector   sector,
const csVector3   pos
[virtual]
 

This routine returns an iterator to iterate over all objects that are potentially visible as seen from a given position.

This routine assumes full 360 degree visibility. You can use SCF_QUERY_INTERFACE to get any interface from the returned objects.

If you only want meshes then use GetVisibleMeshes(). CURRENTLY NOT IMPLEMENTED!

Implements iEngine.

virtual long csEngine::GetWallRenderPriority   const [inline, virtual]
 

Get the render priority for wall objects (attached to 'wall' name).

Implements iEngine.

Definition at line 868 of file csengine/engine.h.

virtual bool csEngine::HandleEvent iEvent   Event [virtual]
 

We need to handle some events.

Referenced by csEngine::EventHandler::HandleEvent.

virtual bool csEngine::Initialize iObjectRegistry   object_reg [virtual]
 

Initialize the engine.

This is automatically called by system driver at startup so that plugin can do basic initialization stuff, register with the system driver and so on.

void csEngine::InvalidateLightmaps  
 

Invalidate all lightmaps.

This can be called after doing a significant change on the static lightmaps (i.e. after doing a radiosity debug function).

virtual csPtr<iMeshFactoryWrapper> csEngine::LoadMeshFactory const char *    name,
const char *    loaderClassId,
iDataBuffer   input
[virtual]
 

Load mesh factory.

Implements iEngine.

virtual csPtr<iMeshWrapper> csEngine::LoadMeshWrapper const char *    name,
const char *    loaderClassId,
iDataBuffer   input,
iSector   sector,
const csVector3   pos
[virtual]
 

Load mesh object.

Implements iEngine.

virtual bool csEngine::Prepare iProgressMeter   meter = 0 [virtual]
 

Prepare the engine.

This function must be called after you loaded/created the world. It will prepare all lightmaps for use and also free all images that were loaded for the texture manager (the texture manager should have them locally now). The optional progress meter will be used to report progress.

Implements iEngine.

virtual void csEngine::PrepareMeshes   [virtual]
 

Calls UpdateMove for all meshes to initialise bsp bounding boxes.

Call this after creating a BSP tree. csEngine::Prepare() will call this function automatically so you normally don't have to call it.

Implements iEngine.

virtual void csEngine::PrepareTextures   [virtual]
 

Prepare the textures.

It will initialise all loaded textures for the texture manager. (Normally you shouldn't call this function directly, because it will be called by Prepare() for you. This function will also prepare all loaded materials after preparing the textures.

Implements iEngine.

bool csEngine::ProcessLastPolygon   [inline, static]
 

Return true if we are processing the last polygon.

Definition at line 628 of file csengine/engine.h.

bool csEngine::ProcessPolygon   [inline, static]
 

Indicate that we will process another polygon.

Returns false if we need to stop.

Definition at line 618 of file csengine/engine.h.

csObject* csEngine::QueryCsObject   [inline]
 

Query the csObject for the engine.

Definition at line 555 of file csengine/engine.h.

virtual iObject* csEngine::QueryObject   [virtual]
 

Query the iObject for the engine.

Implements iEngine.

void csEngine::ReadConfig iConfigFile  
 

Read configuration file (using the system driver) for all engine specific values.

This function is called by Initialize() so you normally do not need to call it yourselves.

virtual void csEngine::RegisterRenderPriority const char *    name,
long    priority,
int    rendsort = CS_RENDPRI_NONE,
bool    do_camera = false
[virtual]
 

Register a new render priority.

Implements iEngine.

virtual void csEngine::RemoveDynLight iDynLight   [virtual]
 

Remove a dynamic light.

Implements iEngine.

void csEngine::RemoveDynLight csDynLight   dyn
 

Remove a dynamic light from the engine.

void csEngine::RemoveHalo csLight   Light
 

Remove halo attached to given light from the engine.

virtual void csEngine::RemoveLight iStatLight   light [virtual]
 

Remove a light and update all lightmaps.

This function only works correctly for pseudo-dynamic static lights. If you give a normal static light then the light will be removed but lightmaps will not be affected. You can call ForceRelight() to force relighting then.

The current flags set with SetLightingCacheMode() controls if the lightmaps will be cached or not.

Implements iEngine.

virtual bool csEngine::RemoveObject iBase   object [virtual]
 

Convenience function to 'remove' a CS object from the engine.

This will not clear the object but it will remove all references to that object that the engine itself keeps. This function works for: iSector, iCollection, iMeshWrapper, iMeshFactoryWrapper, iCameraPosition, iDynLight, iMaterialWrapper, and iTextureWrapper. Note that the object is only removed if the resulting ref count will become zero. So basically this function only releases the references that the engine holds.

This function returns true if the engine recognized the object as one on which it can operate.

This function will also remove the object from the region it may be in.

Implements iEngine.

void csEngine::Report const char *    description,
...   
 

Report a notification message.

void csEngine::ReportBug const char *    description,
...   
 

Report a bug.

virtual void csEngine::ResetWorldSpecificSettings   [virtual]
 

Reset a subset of flags/settings (which may differ from one world/map to another) to its defaults.

This currently includes:

  • clear z buffer flag
  • lightmap cell size
  • maximum lighmap size
  • ambient color

Implements iEngine.

virtual void csEngine::SetAmbientLight const csColor   c [virtual]
 

Set the amount of ambient light.

Implements iEngine.

virtual void csEngine::SetCacheManager iCacheManager   cache_mgr [virtual]
 

Set the cache manager that the engine will use.

If this is not done then the engine will use its own cache manager based on VFS. This will do an incref on the given cache manager and a decref on the old one. The engine will release the cache manager at destruction time.

Implements iEngine.

virtual void csEngine::SetClearScreen bool    yesno [inline, virtual]
 

Set clear screen flag.

Implements iEngine.

Definition at line 689 of file csengine/engine.h.

virtual void csEngine::SetClearZBuf bool    yesno [inline, virtual]
 

Set clear z buffer flag.

Implements iEngine.

Definition at line 677 of file csengine/engine.h.

virtual void csEngine::SetContext iTextureHandle   txt [virtual]
 

Point engine to rendering context (for procedural textures).

Implements iEngine.

virtual bool csEngine::SetCurrentDefaultRenderloop iRenderLoop   loop [virtual]
 

Set the current render loop.

Parameters:
loop  The loop to be made the current render loop.
Returns:
Whether the change was successful (a value of 0 for will let the method fail.)

Implements iEngine.

virtual void csEngine::SetFastMeshThresshold int    th [inline, virtual]
 

Set the fastmesh thresshold.

Implements iEngine.

Definition at line 672 of file csengine/engine.h.

virtual void csEngine::SetLightingCacheMode int    mode [inline, virtual]
 

Set the mode for the lighting cache.

Implements iEngine.

Definition at line 667 of file csengine/engine.h.

References lightcache_mode.

virtual void csEngine::SetMaxLightmapSize int    w,
int    h
[inline, virtual]
 

Set the maximum lightmap dimensions.

Polys with lightmaps larger than this are not lit.

Implements iEngine.

Definition at line 704 of file csengine/engine.h.

References max_lightmap_w.

void csEngine::SetMaxProcessPolygons int    m [inline, static]
 

Set the maximum number of polygons to process in one frame.

This is mainly useful for debugging.

Definition at line 607 of file csengine/engine.h.

virtual void csEngine::SetRenderPriorityCamera long    priority,
bool    do_camera
[virtual]
 

Set the render priority camera flag.

Implements iEngine.

virtual void csEngine::ShineLights iRegion   region = 0,
iProgressMeter   meter = 0
[virtual]
 

Calculate all lighting information.

Normally you shouldn't call this function directly, because it will be called by Prepare(). If the optional 'region' parameter is given then only lights will be recalculated for the given region.

Implements iEngine.

void csEngine::StartEngine  
 

Prepare for creation of a world.

This function is called by Initialize() so you normally do not need to call it yourselves.

virtual void csEngine::WantToDie iMeshWrapper   mesh [virtual]
 

Sometimes a mesh wants to destruct itself (for example a particle system that has only limited lifetime).

It can do that by calling this function on itself. The engine will then remove the object before the next frame.

Implements iEngine.

void csEngine::Warn const char *    description,
...   
 

Report a warning.


Member Data Documentation

csRef<iCacheManager> csEngine::cache_mgr
 

The following variable is only set if the engine had to create its own cache manager.

In that case the engine is also responsible for cleaning this up.

Definition at line 319 of file csengine/engine.h.

csCameraPositionList csEngine::camera_positions
 

The list of all camera position objects.

Definition at line 292 of file csengine/engine.h.

csRefArray<iBase> csEngine::cleanup
 

This is a vector which holds objects of type 'csCleanable'.

They will be destroyed when the engine is destroyed. That's the only special thing. This is useful for holding memory which you allocate locally in a function but you want to reuse accross function invocations. There is no general way to make sure that the memory will be freed it only exists as a static pointer in your function code. Adding a class encapsulating that memory to this array will ensure that the memory is removed once the engine is destroyed.

Definition at line 259 of file csengine/engine.h.

csCollectionList csEngine::collections
 

List of all collections in the engine.

This vector contains objects of type iCollection*.

Definition at line 272 of file csengine/engine.h.

iCamera* csEngine::current_camera
 

The current camera for drawing the world.

Definition at line 475 of file csengine/engine.h.

csEngine* csEngine::current_engine [static]
 

The shared engine instance.

Definition at line 299 of file csengine/engine.h.

iEngine* csEngine::current_iengine [static]
 

The shared engine instance.

Definition at line 301 of file csengine/engine.h.

csRef<iRenderLoop> csEngine::defaultRenderLoop
 

Default render loop.

Definition at line 351 of file csengine/engine.h.

bool csEngine::do_force_revis [static]
 

Option variable: force visibility recalculation?

Definition at line 363 of file csengine/engine.h.

bool csEngine::do_rad_debug [static]
 

Option variable: radiosity debugging (step by step)?

Definition at line 365 of file csengine/engine.h.

csRef<iEngineSequenceManager> csEngine::eseqmgr
 

Pointer to the engine sequence manager.

Definition at line 240 of file csengine/engine.h.

G3D_FOGMETHOD csEngine::fogmethod
 

The fog mode this G3D implements.

Definition at line 321 of file csengine/engine.h.

int csEngine::frame_height [static]
 

Remember dimensions of display.

Definition at line 295 of file csengine/engine.h.

int csEngine::frame_width [static]
 

Remember dimensions of display.

Definition at line 295 of file csengine/engine.h.

csRef<iGraphics2D> csEngine::G2D
 

The 2D driver.

Definition at line 307 of file csengine/engine.h.

csRef<iGraphics3D> csEngine::G3D
 

The 3D driver.

Definition at line 305 of file csengine/engine.h.

csRef<iImageIO> csEngine::ImageLoader
 

The graphics loader.

Definition at line 309 of file csengine/engine.h.

int csEngine::lightcache_mode [static]
 

Option variable: force lightmap recalculation?

Definition at line 359 of file csengine/engine.h.

Referenced by GetLightingCacheMode, and SetLightingCacheMode.

int csEngine::lightmap_quality [static]
 

Option variable: quality for lightmap calculation.

Definition at line 361 of file csengine/engine.h.

int csEngine::max_lightmap_w [static]
 

Maximum lightmap dimensions.

Definition at line 367 of file csengine/engine.h.

Referenced by GetMaxLightmapSize, and SetMaxLightmapSize.

int csEngine::MaxAspectRatio
 

Maximum texture aspect ratio.

Definition at line 325 of file csengine/engine.h.

Referenced by GetMaxLightmapAspectRatio.

csMeshFactoryList csEngine::mesh_factories
 

List of mesh object factories.

This vector contains objects of type csMeshFactoryWrapper*.

Definition at line 278 of file csengine/engine.h.

csEngineMeshList csEngine::meshes
 

List of all meshes in the engine.

This vector contains objects of type csMeshWrapper*. Use RemoveMesh() to remove meshes from this list. This function will take care of correctly removing the meshes from all sectors as well. Note that after you add a mesh to the list you still need to add it to all sectors that you want it to be visible in.

Definition at line 287 of file csengine/engine.h.

bool csEngine::NeedPO2Maps
 

Does the 3D driver require power-of-two lightmaps?

Definition at line 323 of file csengine/engine.h.

Referenced by GetLightmapsRequirePO2.

iObjectRegistry* csEngine::object_reg [static]
 

Remember iObjectRegistry.

Definition at line 297 of file csengine/engine.h.

csRegionList csEngine::regions
 

The list of all regions currently loaded.

Definition at line 327 of file csengine/engine.h.

csStringArray csEngine::render_priorities
 

The list of all named render priorities.

Definition at line 330 of file csengine/engine.h.

csArray<bool> csEngine::render_priority_cameraflags
 

Do_camera flags for the render priorities.

Definition at line 334 of file csengine/engine.h.

long csEngine::render_priority_sky
 

The engine knows about the following render priorities and keeps them here:.

  • "sky": usually rendered using ZFILL or ZNONE
  • "wall": usually rendered using ZFILL
  • "object": usually rendered using ZUSE
  • "alpha": usually rendered using ZTEST

Definition at line 345 of file csengine/engine.h.

Referenced by GetSkyRenderPriority.

csArray<int> csEngine::render_priority_sortflags
 

Sorting flags for the render priorities.

Definition at line 332 of file csengine/engine.h.

csRenderLoopManager* csEngine::renderLoopManager
 

Render loop manager.

Definition at line 353 of file csengine/engine.h.

csRef<iReporter> csEngine::Reporter
 

Pointer to an optional reporter that will be used for notification and warning messages.

Definition at line 246 of file csengine/engine.h.

csEngine::eiComponent csEngine::scfiComponent
 

iComponent implementation.

csEngine::EventHandler * csEngine::scfiEventHandler
 

iEventHandler implementation.

csSectorList csEngine::sectors
 

List of sectors in the engine.

This vector contains objects of type iSector*. Use CreateSector() to add sectors to the engine.

Definition at line 266 of file csengine/engine.h.

csRef<iShaderManager> csEngine::ShaderManager
 

For NR: @ Document me!

@

Definition at line 313 of file csengine/engine.h.

csRef<iStringSet> csEngine::Strings
 

For NR: @ Document me!

@

Definition at line 311 of file csengine/engine.h.

iClipper2D* csEngine::top_clipper
 

The top-level clipper we are currently using for drawing.

Definition at line 480 of file csengine/engine.h.

bool csEngine::use_new_radiosity [static]
 

Need to render using newradiosity?

Definition at line 303 of file csengine/engine.h.

csRef<iVFS> csEngine::VFS
 

This is the Virtual File System object where all the files used by the engine live.

Textures, models, data, everything - reside on this virtual disk volume. You should avoid using the standard file functions (such as fopen(), fread() and so on) since they are highly system-dependent (for example, DOS uses '\' as path separator, Mac uses ':' and Unix uses '/').

Definition at line 235 of file csengine/engine.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14