Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

engine.h

00001 /*
00002     Crystal Space 3D Engine
00003     Copyright (C) 1998-2002 by Jorrit Tyberghein
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __IENGINE_ENGINE_H__
00021 #define __IENGINE_ENGINE_H__
00022 
00023 #include "csutil/scf.h"
00024 #include "csgeom/vector3.h"
00025 
00026 class csEngine;
00027 class csVector3;
00028 class csMatrix3;
00029 class csColor;
00030 struct csTextureLayer;
00031 
00032 struct iSector;
00033 struct iSectorIterator;
00034 struct iObjectIterator;
00035 struct iLight;
00036 struct iStatLight;
00037 struct iDynLight;
00038 struct iSprite;
00039 struct iMeshObject;
00040 struct iMeshObjectFactory;
00041 struct iMeshWrapper;
00042 struct iMeshFactoryWrapper;
00043 struct iMeshObjectType;
00044 struct iMaterial;
00045 struct iMaterialWrapper;
00046 struct iMaterialList;
00047 struct iTextureWrapper;
00048 struct iTextureList;
00049 struct iCameraPosition;
00050 struct iCameraPositionList;
00051 struct iRegion;
00052 struct iGraphics3D;
00053 struct iClipper2D;
00054 struct iObject;
00055 struct iCollection;
00056 struct iCollectionList;
00057 struct iDataBuffer;
00058 struct iCamera;
00059 struct iRenderView;
00060 struct iSectorList;
00061 struct iMeshList;
00062 struct iMeshFactoryList;
00063 struct iProgressMeter;
00064 struct iRegionList;
00065 struct iLoaderContext;
00066 struct iCacheManager;
00067 
00073 #define CS_NLIGHT_SHADOWS 1
00074 
00079 #define CS_NLIGHT_STATIC 2
00080 
00085 #define CS_NLIGHT_DYNAMIC 4
00086 
00091 #define CS_NLIGHT_NEARBYSECTORS 8
00092 
00093 
00098 #define CS_ENGINE_AUTODETECT 0
00099 
00105 #define CS_ENGINE_BACK2FRONT 1
00106 
00111 #define CS_ENGINE_FRONT2BACK 2
00112 
00117 #define CS_ENGINE_ZBUFFER 3
00118 
00123 #define CS_ENGINE_CACHE_READ 1
00124 
00129 #define CS_ENGINE_CACHE_WRITE 2
00130 
00134 #define CS_RENDPRI_NONE 0
00135 
00139 #define CS_RENDPRI_BACK2FRONT 1
00140 
00144 #define CS_RENDPRI_FRONT2BACK 2
00145 
00150 #define CS_CALLBACK_SECTOR 1
00151 #define CS_CALLBACK_SECTOREXIT 2
00152 #define CS_CALLBACK_MESH 3
00153 #define CS_CALLBACK_VISMESH 4
00154 
00155 SCF_VERSION (iDrawFuncCallback, 0, 0, 1);
00156 
00160 struct iDrawFuncCallback : public iBase
00161 {
00172   virtual void DrawFunc (iRenderView* rview, int type, void* entity) = 0;
00173 };
00174 
00175 
00176 SCF_VERSION (iEngine, 0, 7, 5);
00177 
00183 struct iEngine : public iBase
00184 {
00189   virtual csEngine *GetCsEngine () = 0;
00190 
00192   virtual iObject *QueryObject() = 0;
00193 
00202   virtual bool Prepare (iProgressMeter* meter = NULL) = 0;
00203 
00211   virtual void PrepareTextures () = 0;
00212 
00218   virtual void PrepareMeshes () = 0;
00219 
00226   virtual void ShineLights (iRegion* region = NULL,
00227         iProgressMeter* meter = NULL) = 0;
00228 
00233   virtual int GetTextureFormat () const = 0;
00234 
00238   virtual bool IsPVS () const = 0;
00239 
00244   virtual void SelectRegion (const char* name) = 0;
00249   virtual void SelectRegion (iRegion* region) = 0;
00254   virtual iRegion* GetCurrentRegion () const = 0;
00255 
00257   virtual void DeleteAll () = 0;
00258 
00270   virtual void RegisterRenderPriority (const char* name, long priority,
00271         int rendsort = CS_RENDPRI_NONE) = 0;
00273   virtual long GetRenderPriority (const char* name) const = 0;
00275   virtual int GetRenderPrioritySorting (const char* name) const = 0;
00277   virtual int GetRenderPrioritySorting (long priority) const = 0;
00279   virtual long GetSkyRenderPriority () const = 0;
00281   virtual long GetWallRenderPriority () const = 0;
00283   virtual long GetObjectRenderPriority () const = 0;
00285   virtual long GetAlphaRenderPriority () const = 0;
00287   virtual void ClearRenderPriorities () = 0;
00288 
00293   virtual iMaterial* CreateBaseMaterial (iTextureWrapper* txt) = 0;
00294 
00299   virtual iMaterial* CreateBaseMaterial (iTextureWrapper* txt,
00300         int num_layers, iTextureWrapper** wrappers, csTextureLayer* layers) = 0;
00301 
00303   virtual iTextureWrapper* CreateTexture (const char *name,
00304         const char *fileName, csColor *transp, int flags) = 0;
00306   virtual iMaterialWrapper* CreateMaterial (const char *name,
00307         iTextureWrapper* texture) = 0;
00311   virtual iSector *CreateSector (const char *name) = 0;
00312 
00320   virtual iMeshWrapper* CreateSectorWallsMesh (iSector* sector,
00321       const char* name) = 0;
00322 
00324   virtual iSectorList* GetSectors () = 0;
00326   virtual iMeshFactoryList* GetMeshFactories () = 0;
00328   virtual iMeshList* GetMeshes () = 0;
00330   virtual iCollectionList* GetCollections () = 0;
00332   virtual iCameraPositionList* GetCameraPositions () = 0;
00334   virtual iTextureList* GetTextureList () const = 0;
00336   virtual iMaterialList* GetMaterialList () const = 0;
00338   virtual iRegionList* GetRegions () = 0;
00339 
00350   virtual iMaterialWrapper* FindMaterial (const char* name,
00351         iRegion* region = NULL) = 0;
00362   virtual iTextureWrapper* FindTexture (const char* name,
00363         iRegion* region = NULL) = 0;
00374   virtual iSector* FindSector (const char* name,
00375         iRegion* region = NULL) = 0;
00386   virtual iMeshWrapper* FindMeshObject (const char* name,
00387         iRegion* region = NULL) = 0;
00398   virtual iMeshFactoryWrapper* FindMeshFactory (const char* name,
00399         iRegion* region = NULL) = 0;
00410   virtual iCameraPosition* FindCameraPosition (const char* name,
00411         iRegion* region = NULL) = 0;
00422   virtual iCollection* FindCollection (const char* name,
00423         iRegion* region = NULL) = 0;
00424 
00433   virtual void SetLightingCacheMode (int mode) = 0;
00435   virtual int GetLightingCacheMode () = 0;
00436 
00438   virtual int GetLightmapCellSize () const = 0;
00440   virtual void SetLightmapCellSize (int Size) = 0;
00441 
00443   virtual iCamera* CreateCamera () = 0;
00445   virtual iStatLight* CreateLight (const char* name, const csVector3& pos,
00446         float radius, const csColor& color, bool pseudoDyn) = 0;
00448   virtual iStatLight* FindLight (const char *Name, bool RegionOnly = false)
00449     const = 0;
00451   virtual iDynLight* CreateDynLight (const csVector3& pos, float radius,
00452         const csColor& color) = 0;
00454   virtual void RemoveDynLight (iDynLight*) = 0;
00455 
00466   virtual void SetClearZBuf (bool yesno) = 0;
00467 
00471   virtual bool GetClearZBuf () const = 0;
00472 
00479   virtual int GetBeginDrawFlags () const = 0;
00480 
00495   virtual void SetEngineMode (int mode) = 0;
00496 
00502   virtual int GetEngineMode () const = 0;
00503 
00507   virtual iClipper2D* GetTopLevelClipper () const = 0;
00508 
00519   virtual iMeshFactoryWrapper* CreateMeshFactory (const char* classId,
00520         const char* name) = 0;
00521 
00523   virtual iMeshFactoryWrapper* CreateMeshFactory (iMeshObjectFactory *,
00524         const char* name) = 0;
00525 
00527   virtual iMeshFactoryWrapper* CreateMeshFactory (const char* name) = 0;
00528 
00536   virtual iLoaderContext* CreateLoaderContext (iRegion* region = NULL) = 0;
00537 
00541   virtual iMeshFactoryWrapper* LoadMeshFactory (
00542         const char* name, const char* loaderClassId,
00543         iDataBuffer* input) = 0;
00544 
00552   virtual iMeshWrapper* CreateMeshWrapper (iMeshFactoryWrapper* factory,
00553         const char* name, iSector* sector = NULL,
00554         const csVector3& pos = csVector3(0, 0, 0)) = 0;
00556   virtual iMeshWrapper* CreateMeshWrapper (iMeshObject*,
00557         const char* name, iSector* sector = NULL,
00558         const csVector3& pos = csVector3(0, 0, 0)) = 0;
00560   virtual iMeshWrapper* CreateMeshWrapper (const char* name) = 0;
00565   virtual iMeshWrapper* LoadMeshWrapper (
00566         const char* name, const char* loaderClassId,
00567         iDataBuffer* input, iSector* sector, const csVector3& pos) = 0;
00568 
00573   virtual iMeshObjectType* GetThingType () const = 0;
00574 
00582   virtual void Draw (iCamera* c, iClipper2D* clipper) = 0;
00583 
00591   virtual void DrawFunc (iCamera* c, iClipper2D* clipper,
00592     iDrawFuncCallback* callback) = 0;
00593 
00595   virtual void SetContext (iGraphics3D*) = 0;
00597   virtual iGraphics3D *GetContext () const = 0;
00598 
00603   virtual void SetAmbientLight (const csColor &) = 0;
00605   virtual void GetAmbientLight (csColor &) const = 0;
00606 
00626   virtual int GetNearbyLights (iSector* sector, const csVector3& pos,
00627         uint32 flags, iLight** lights, int max_num_lights) = 0;
00628 
00634   virtual iSectorIterator* GetNearbySectors (iSector* sector,
00635         const csVector3& pos, float radius) = 0;
00636 
00644   virtual iObjectIterator* GetNearbyObjects (iSector* sector,
00645     const csVector3& pos, float radius) = 0;
00646 
00664   virtual bool RemoveObject (iBase* object) = 0;
00665 
00673   virtual void SetCacheManager (iCacheManager* cache_mgr) = 0;
00674 
00678   virtual iCacheManager* GetCacheManager () = 0;
00679 };
00680 
00681 #endif // __IENGINE_ENGINE_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000