Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csEngine Class Reference

The 3D engine. More...

#include <engine.h>

Inheritance diagram for csEngine:

iEngine iBase List of all members.

Public Methods

 CS_DECLARE_GROWING_ARRAY (render_priority_sortflags, int)
 Sorting flags for the render priorities.

 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.

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

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

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=NULL, iProgressMeter *meter=NULL)
 Calculate all lighting information. More...

virtual iObjectQueryObject ()
 Query the iObject for the engine.

csObjectQueryCsObject ()
 Query the csObject for the engine.

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

csRadiosityGetRadiosity () const
 Get the pointer to the radiosity object (used with step-by-step debugging).

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

virtual void SetEngineMode (int mode)
 Set the desired engine mode. More...

virtual int GetEngineMode () const
 Get the current engine mode. More...

virtual void SetClearZBuf (bool yesno)
 Require that the Z-buffer is cleared every frame. More...

virtual bool GetClearZBuf () const
 Get the value of the clear Z-buffer flag set with SetClearZBuf().

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.

void InitCuller ()
 Initialize the culler.

csCBufferGetCBuffer () const
 Return c-buffer (or NULL if not used).

csCBufferCubeGetCBufCube () const
 Return cbuffer cube.

void EnablePVS ()
 Enable PVS.

void DisablePVS ()
 Disable PVS.

virtual bool IsPVS () const
 Is PVS enabled?

void EnablePVSOnly ()
 Use only PVS for culling. More...

void DisablePVSOnly ()
 Don't use only PVS for culling.

bool IsPVSOnly ()
 Is PVS only enabled?

void FreezePVS (const csVector3 &pos)
 Freeze the PVS for some position.

void UnfreezePVS ()
 Unfreeze the PVS.

bool IsPVSFrozen ()
 Is the PVS frozen?

const csVector3GetFrozenPosition () const
 Return the frozen position for the PVS.

virtual void SetLightingCacheMode (int mode)
 Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???). More...

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

virtual int GetLightmapCellSize () const
 Return current lightmap cell size.

virtual void SetLightmapCellSize (int Size)
 Set lightmap cell size.

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.

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

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

virtual 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 iMaterialListGetMaterialList () const
 Get the list of all materials.

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

virtual iRegionListGetRegions ()
 Get the list of all regions.

iMeshWrapperCreateSectorWallsMesh (csSector *sector, const char *name)
 Conveniance function to create the thing containing the convex outline of a sector. More...

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

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

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

csDynLightGetFirstDynLight () const
 Return the first dynamic light in this engine.

virtual int GetNearbyLights (iSector *sector, const csVector3 &pos, uint32 flags, iLight **lights, int max_num_lights)
 This routine returns all lights which might affect an object at some position according to the following flags:
.
More...


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

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

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

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

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

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

virtual void DrawFunc (iCamera *c, iClipper2D *clipper, iDrawFuncCallback *callback)
 This function is similar to Draw. More...

csLightIt* NewLightIterator (iRegion *region=NULL)
 Create an iterator to iterate over all static lights of the engine.

void AddToCurrentRegion (csObject *obj)
 Add an object to the current region.

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

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

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

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

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

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

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

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

virtual void ClearRenderPriorities ()
 Clear all render priorities.

virtual iMeshObjectTypeGetThingType () const
 @@ This function is deprecated! Please don't use it! Only the engine and thing mesh objects should use this now.

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

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

virtual csEngine* GetCsEngine ()
 @@KLUDGE: This will no longer be needed once the iEngine interface is complete.

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

virtual void SelectRegion (const char *iName)
 Create or select a new region (name can be NULL for the default main region). More...

virtual void SelectRegion (iRegion *region)
 Create or select a new region (region can be NULL for the default main region). More...

virtual iRegionGetCurrentRegion () const
 Get a reference to the current region (or NULL if the default main region is selected).

virtual void DeleteAll ()
 Clear the entire engine.

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

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

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

virtual iSectorListGetSectors ()
 Return the list of sectors.

virtual iMeshFactoryListGetMeshFactories ()
 Return the list of mesh factories.

virtual iMeshListGetMeshes ()
 Return the list of meshes.

virtual iCollectionList* GetCollections ()
 Return the list of collections.

virtual iCameraPositionListGetCameraPositions ()
 Return the list of camera positions.

virtual iCameraCreateCamera ()
 Create a new camera.

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

virtual iStatLightFindLight (unsigned long light_id) const
 Find a static/pseudo-dynamic light by ID.

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

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

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

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

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

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

virtual iLoaderContextCreateLoaderContext (iRegion *region=NULL)
 Create a loader context that you can give to loader plugins. More...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

virtual iCollectionFindCollection (const char *name, iRegion *region=NULL)
 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.

virtual void SetContext (iGraphics3D *g3d)
 Point engine to rendering context.

virtual iGraphics3DGetContext () const
 Return the current drawing context.


Public Attributes

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

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

csObjVector cleanup
 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.

csPoly2DPoolrender_pol2d_pool
 An object pool for 2D polygons used by the rendering process.

csLightPatchPoollightpatch_pool
 An object pool for lightpatches.

iGraphics3DG3D
 The 3D driver.

iGraphics2DG2D
 The 2D driver.

iImageIO* ImageLoader
 The graphics loader.

G3D_FOGMETHOD fogmethod
 The fog mode this G3D implements.

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

int MaxAspectRatio
 Maximum texture aspect ratio.

iRegionregion
 A pointer to the current region.

csRegionList regions
 The list of all regions currently loaded.

csVector render_priorities
 The list of all named render priorities.

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

long render_priority_wall
long render_priority_object
long render_priority_alpha
iCameracurrent_camera
 The current camera for drawing the world.

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

csThingObjectTypething_type
 @ Temporary until things move to their own mesh plugin system. More...

 SCF_DECLARE_IBASE
csEngine::eiComponent  scfiComponent
csEngine::EventHandler *  scfiEventHandler
csEngineConfig scfiConfig

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.

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

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


Static Public Attributes

int frame_width
 Remember dimensions of display.

int frame_height
 Remember dimensions of display.

iObjectRegistryobject_reg
 Remember iObjectRegistry.

csEngine* current_engine
 The shared engine instance.

iEnginecurrent_iengine
 The shared engine instance.

bool use_new_radiosity
 Need to render using newradiosity?

int lightcache_mode
 Option variable: force lightmap recalculation?

int lightmap_quality
 Option variable: quality for lightmap calculation.

bool do_force_revis
 Option variable: force visibility recalculation?

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


Friends

class  csEngineState

Detailed Description

The 3D engine.

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


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()).

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

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 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.

Reimplemented from iEngine.

virtual iLoaderContext* csEngine::CreateLoaderContext ( iRegion * region = NULL ) [virtual]
 

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

It will basically allow loader plugins to find materials, ... If region != NULL then only that region will be searched. Destroy this object with DecRef(). The engine itself does not keep track of it.

Reimplemented from iEngine.

iMeshWrapper * csEngine::CreateSectorWallsMesh ( iSector * sector,
const char * name ) [virtual]
 

Conveniance 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. This version creates a mesh wrapper.

Reimplemented from iEngine.

iMeshWrapper * csEngine::CreateSectorWallsMesh ( csSector * sector,
const char * name )
 

Conveniance 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. This version creates a mesh wrapper.

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.

Reimplemented from iEngine.

void csEngine::DrawFunc ( iCamera * c,
iClipper2D * clipper,
iDrawFuncCallback * callback ) [virtual]
 

This function is similar to Draw.

It will do all the stuff that Draw would do except for one important thing: it will not draw anything. Instead it will call a callback function for every entity that it was planning to draw. This allows you to show or draw debugging information (2D egdes for example).

Reimplemented from iEngine.

void csEngine::EnablePVSOnly ( ) [inline]
 

Use only PVS for culling.

This flag only makes sense when PVS is enabled.

virtual iCameraPosition* csEngine::FindCameraPosition ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iCollection* csEngine::FindCollection ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iMaterialWrapper* csEngine::FindMaterial ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iMeshFactoryWrapper* csEngine::FindMeshFactory ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iMeshWrapper* csEngine::FindMeshObject ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iSector* csEngine::FindSector ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

virtual iTextureWrapper* csEngine::FindTexture ( const char * name,
iRegion * region = NULL ) [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 NULL 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 NULL if that region doesn't contain the object or the region doesn't exist. In this case the region parameter is ignored.

Reimplemented from iEngine.

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.

Reimplemented from iEngine.

int csEngine::GetEngineMode ( ) const [inline, virtual]
 

Get the current engine mode.

If called between SetEngineMode() and the first Draw() it is possible that this mode will still be CS_ENGINE_AUTODETECT.

Reimplemented from iEngine.

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

This routine returns all lights which might affect an object at some position according to the following flags:
.

  • CS_NLIGHT_SHADOWS: detect shadows and don't return lights for which the object is shadowed (not implemented yet).
  • CS_NLIGHT_STATIC: return static lights.
  • CS_NLIGHT_DYNAMIC: return dynamic lights.
  • CS_NLIGHT_NEARBYSECTORS: Also check lights in nearby sectors (not implemented yet).

It will only return as many lights as the size that you specified for the light array. The returned lights are not guaranteed to be sorted but they are guaranteed to be the specified number of lights closest to the given position.
This function returns the actual number of lights added to the 'lights' array.

Reimplemented from iEngine.

iObjectIterator * csEngine::GetNearbyObjects ( iSector * sector,
const csVector3 & pos,
float radius ) [virtual]
 

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

You can use SCF_QUERY_INTERFACE to get any interface from the returned objects.

Delete the iterator with 'DecRef()' when ready.

Reimplemented from iEngine.

iSectorIterator * csEngine::GetNearbySectors ( iSector * sector,
const csVector3 & pos,
float radius ) [virtual]
 

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

Delete the iterator with 'DecRef()' when ready.

Reimplemented from iEngine.

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).

bool csEngine::Prepare ( iProgressMeter * meter = NULL ) [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.

Reimplemented from iEngine.

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.

Reimplemented from iEngine.

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.

Reimplemented from iEngine.

bool csEngine::ProcessPolygon ( ) [inline, static]
 

Indicate that we will process another polygon.

Returns false if we need to stop.

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 bool csEngine::RemoveObject ( iBase * object ) [virtual]
 

Conveniance 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. In addition this function also knows about iCurveTemplate and iPolyTxtPlane from the thing environment and will be able to clean those up too. 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.

Reimplemented from iEngine.

void csEngine::SelectRegion ( iRegion * region ) [virtual]
 

Create or select a new region (region can be NULL for the default main region).

All new objects will be marked as belonging to this region.

Reimplemented from iEngine.

void csEngine::SelectRegion ( const char * iName ) [virtual]
 

Create or select a new region (name can be NULL for the default main region).

All new objects will be marked as belonging to this region.

Reimplemented from 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.

Reimplemented from iEngine.

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

Require that the Z-buffer is cleared every frame.

The engine itself will not use this setting but will only return the correct flag in GetBeginDrawFlags() so that the Z-buffer is actually cleared. Note that this requires that the application actually uses GetBeginDrawFlags() in the call to g3d->BeginDraw() (which it should). By default this flag is false. It is useful to set this flag to true if you have a level that doesn't itself have another way to initialize the Z-buffer.

Reimplemented from iEngine.

void csEngine::SetEngineMode ( int mode ) [inline, virtual]
 

Set the desired engine mode.

One of the CS_ENGINE_... flags. Default is CS_ENGINE_AUTODETECT. If you select CS_ENGINE_AUTODETECT then the mode will be auto-detected (depending on level and/or hardware capabilities) the first time csEngine::Draw() is called.

Reimplemented from iEngine.

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

Set the mode for the lighting cache (combination of CS_ENGINE_CACHE_???).

Default is CS_ENGINE_CACHE_READ.

Reimplemented from iEngine.

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

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

This is mainly useful for debugging.

void csEngine::ShineLights ( iRegion * region = NULL,
iProgressMeter * meter = NULL ) [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.

Reimplemented from 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.


Member Data Documentation

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 '/').

csObjVector 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.

csCollectionList csEngine::collections
 

List of all collections in the engine.

This vector contains objects of type iCollection*.

csMeshFactoryList csEngine::mesh_factories
 

List of mesh object factories.

This vector contains objects of type csMeshFactoryWrapper*.

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.

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

csSectorList csEngine::sectors
 

List of sectors in the engine.

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

csThingObjectType * csEngine::thing_type
 

@ Temporary until things move to their own mesh plugin system.

@


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000