iengine/rview.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- File List
- File Members

iengine/rview.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2000 by Jorrit Tyberghein
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Library General Public
    00006     License as published by the Free Software Foundation; either
    00007     version 2 of the License, or (at your option) any later version.
    00008
    00009     This library is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012     Library General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Library General Public
    00015     License along with this library; if not, write to the Free
    00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00017 */
    00018
    00019 #ifndef __CS_IENGINE_RVIEW_H__
    00020 #define __CS_IENGINE_RVIEW_H__
    00021
    00029 #include "csutil/scf.h"
    00030
    00031 #include "csgeom/plane3.h"
    00032
    00033 struct iCamera;
    00034 struct iClipper2D;
    00035 struct iEngine;
    00036 struct iGraphics2D;
    00037 struct iGraphics3D;
    00038 struct iPortal;
    00039 struct iSector;
    00040
    00041 struct csFog;
    00042
    00043 class csBox3;
    00044 class csReversibleTransform;
    00045 class csSphere;
    00046 class csVector3;
    00047
    00055 class csFogInfo
    00056 {
    00057 public:
    00059   csFogInfo* next;
    00060
    00062   csPlane3 incoming_plane;
    00064   csPlane3 outgoing_plane;
    00069   bool has_incoming_plane;
    00070
    00076   bool has_outgoing_plane;
    00077
    00079   csFog* fog;
    00080 };
    00081
    00088 class csRenderContext
    00089 {
    00090 public:
    00092   csRenderContext* previous;
    00093
    00095   csRef<iCamera> icamera;
    00097   csRef<iClipper2D> iview;
    00099   csPlane3 frustum[5];
    00100
    00102   csPlane3 clip_planes[7];
    00104   uint32 clip_planes_mask;
    00105
    00107   iPortal* last_portal;
    00109   iSector* previous_sector;
    00111   iSector* this_sector;
    00112
    00117   csPlane3 clip_plane;
    00118
    00129   bool do_clip_plane;
    00130
    00139   bool do_clip_frustum;
    00140
    00145   csFogInfo* fog_info;
    00146
    00151   bool added_fog_info;
    00152
    00158   int draw_rec_level;
    00159
    00165   uint32 context_id;
    00166 };
    00167
    00178 struct iRenderView : public virtual iBase
    00179 {
    00180   SCF_INTERFACE(iRenderView, 2,2,0);
    00182   virtual csRenderContext* GetRenderContext () = 0;
    00183
    00185   virtual iEngine* GetEngine () = 0;
    00187   virtual iGraphics2D* GetGraphics2D () = 0;
    00189   virtual iGraphics3D* GetGraphics3D () = 0;
    00193   virtual void GetFrustum (float& lx, float& rx, float& ty, float& by) = 0;
    00194
    00195   //-----------------------------------------------------------------
    00196   // The following functions operate on the current render context.
    00197   //-----------------------------------------------------------------
    00198
    00200   virtual iClipper2D* GetClipper () = 0;
    00201
    00205   virtual iCamera* GetCamera () = 0;
    00206
    00210   virtual iSector* GetThisSector () = 0;
    00211
    00215   virtual iSector* GetPreviousSector () = 0;
    00216
    00220   virtual iPortal* GetLastPortal () = 0;
    00221
    00226   virtual iCamera* GetOriginalCamera () const = 0;
    00227
    00231   virtual uint GetCurrentFrameNumber () const = 0;
    00232
    00240   virtual void CreateRenderContext () = 0;
    00246   virtual void RestoreRenderContext () = 0;
    00247
    00251   virtual void DestroyRenderContext (csRenderContext* context) = 0;
    00252 };
    00253
    00256 #endif // __CS_IENGINE_RVIEW_H__
    00257