Main Page   Class Hierarchy   Compound List   File List   Compound Members  

iEngine Struct Reference

This interface is the main interface to the 3D engine. More...

#include <engine.h>

Inheritance diagram for iEngine:

iBase csEngine List of all members.

Public Methods

virtual csEngineGetCsEngine ()=0
 @@KLUDGE: This will no longer be needed once the iEngine interface is complete.

virtual iObjectQueryObject ()=0
 Get the iObject for the engine.

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

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

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

virtual bool IsPVS () const=0
 Return true if engine want to use PVS.

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

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

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

virtual iRegionFindRegion (const char *name) const=0
 Find a region by name.

virtual void DeleteAll ()=0
 Delete everything in the engine.

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

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

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

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

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

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

virtual void ClearRenderPriorities ()=0
 Clear all render priorities.

virtual iMaterialCreateBaseMaterial (iTextureWrapper *txt)=0
 Create a base material that can be used to give to the texture manager.

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

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

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

virtual iSectorCreateSector (const char *iName, bool link=true)=0
 Create a empty sector with given name. More...

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

virtual iSectorList* GetSectors ()=0
 Get the list of sectors.

virtual iMeshFactoryListGetMeshFactories ()=0
 Get the list of mesh factories.

virtual iMeshListGetMeshes ()=0
 Get the list of meshes.

virtual iCollectionList* GetCollections ()=0
 Get the list of collections.

virtual iCameraPositionList* GetCameraPositions ()=0
 Get the list of camera positions.

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

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

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

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

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

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

virtual iCameraCreateCamera ()=0
 Create a new camera.

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

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

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

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

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

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

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

virtual iMeshFactoryWrapperCreateMeshFactory (const char *classId, const char *name)=0
 Conveniance function to create a mesh factory from a given type. More...

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

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

virtual iMeshFactoryWrapperLoadMeshFactory (const char *classId, const char *name, const char *loaderClassId, iDataBuffer *input)=0
 Conveniance function to load a mesh factory from a given loader plugin.

virtual iMeshWrapperCreateMeshWrapper (iMeshFactoryWrapper *factory, const char *name, iSector *sector=NULL, const csVector3 &pos=csVector3(0, 0, 0))=0
 Conveniance function to create a mesh object for a given factory. More...

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

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

virtual iMeshWrapperLoadMeshWrapper (const char *classId, const char *name, const char *loaderClassId, iDataBuffer *input, iSector *sector, const csVector3 &pos)=0
 Conveniance function to load a mesh object from a given loader plugin. More...

virtual iMeshObjectTypeGetThingType () const=0
 @ Temporary function until things are moved to a plugin. More...

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

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

virtual void SetContext (iGraphics3D *)=0
 Set the drawing context.

virtual iGraphics3DGetContext () const=0
 Return the current drawing context.

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

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


Detailed Description

This interface is the main interface to the 3D engine.

The engine is responsible for creating new engine-specific objects such as sectors, things, sprites and so on.


Member Function Documentation

iMaterial * iEngine::CreateBaseMaterial ( iTextureWrapper * txt,
int num_layers,
iTextureWrapper ** wrappers,
csTextureLayer * layers ) [pure virtual]
 

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

This version also supports texture layers.

Reimplemented in csEngine.

iMeshFactoryWrapper * iEngine::CreateMeshFactory ( const char * classId,
const char * name ) [pure virtual]
 

Conveniance function to create a mesh factory from a given type.

The type plugin will only be loaded if needed. 'classId' is the SCF name of the plugin (like 'crystalspace.mesh.object.cube'). Returns NULL on failure. The factory will be registered with the engine under the given name. If there is already a factory with that name no new factory will be created but the found one is returned instead. If the name is NULL then no name will be set and no check will happen if the factory already exists.

Reimplemented in csEngine.

iMeshWrapper * iEngine::CreateMeshWrapper ( iMeshFactoryWrapper * factory,
const char * name,
iSector * sector = NULL,
const csVector3 & pos = csVector3(0, 0, 0) ) [pure virtual]
 

Conveniance function to create a mesh object for a given factory.

If 'sector' is NULL then the mesh object will not be set to a position. Returns NULL on failure. The object will be given the specified name. 'name' can be NULL if no name is wanted. Different mesh objects can have the same name (in contrast with factory objects).

Reimplemented in csEngine.

iSector * iEngine::CreateSector ( const char * iName,
bool link = true ) [pure virtual]
 

Create a empty sector with given name.

If link == true (default) the sector will be linked to the engine.

Reimplemented in csEngine.

iMeshWrapper * iEngine::CreateSectorWallsMesh ( iSector * sector,
const char * name ) [pure 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 and have 'wall' as render priority. This version creates a mesh wrapper.

Reimplemented in csEngine.

void iEngine::Draw ( iCamera * c,
iClipper2D * clipper ) [pure 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 in csEngine.

void iEngine::DrawFunc ( iCamera * c,
iClipper2D * clipper,
iDrawFuncCallback * callback ) [pure 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 in csEngine.

int iEngine::GetBeginDrawFlags ( ) const [pure 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 in csEngine.

int iEngine::GetEngineMode ( ) const [pure 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 in csEngine.

iMeshObjectType * iEngine::GetThingType ( ) const [pure virtual]
 

@ Temporary function until things are moved to a plugin.

@

Reimplemented in csEngine.

iMeshWrapper * iEngine::LoadMeshWrapper ( const char * classId,
const char * name,
const char * loaderClassId,
iDataBuffer * input,
iSector * sector,
const csVector3 & pos ) [pure virtual]
 

Conveniance function to load a mesh object from a given loader plugin.

If sector == NULL the object will not be placed in a sector.

Reimplemented in csEngine.

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

void iEngine::SelectRegion ( iRegion * region ) [pure 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 in csEngine.

void iEngine::SelectRegion ( const char * iName ) [pure 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 in csEngine.

void iEngine::SetAmbientLight ( const csColor & c ) [pure virtual]
 

Set the amount of ambient light.

This has no effect until you recalculate the lightmaps.

Reimplemented in csEngine.

void iEngine::SetEngineMode ( int mode ) [pure 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 in csEngine.

void iEngine::SetLightingCacheMode ( int mode ) [pure virtual]
 

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

Default is CS_ENGINE_CACHE_READ.

Reimplemented in csEngine.

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


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