CrystalSpace

Public API Reference

cstool/csview.h

Go to the documentation of this file.
00001 /*
00002     CrystalSpace 3D renderer view
00003     Copyright (C) 1998-2001 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 __CS_CSVIEW_H__
00021 #define __CS_CSVIEW_H__
00022 
00027 #include "csextern.h"
00028 
00029 #include "csutil/ref.h"
00030 #include "csutil/scf_implementation.h"
00031 #include "ivaria/view.h"
00032 
00033 class csBox2;
00034 class csPoly2D;
00035 
00040 class CS_CRYSTALSPACE_EXPORT csView : 
00041   public scfImplementation1<csView, iView>
00042 {
00043 private:
00045   csRef<iEngine> Engine;
00047   csRef<iGraphics3D> G3D;
00049   int OldWidth, OldHeight;
00050 
00052   csRef<iCamera> Camera;
00053 
00055   csBox2* RectView;
00057   csPoly2D* PolyView;
00059   csRef<iClipper2D> Clipper;
00060 
00062   void UpdateView ();
00063 
00065   bool AutoResize;
00066 
00067 public:
00069   csView (iEngine *iEngine, iGraphics3D* ig3d);
00071   virtual ~csView ();
00072 
00074   virtual iEngine* GetEngine ();
00076   virtual void SetEngine (iEngine* e);
00077 
00079   virtual iCamera* GetCamera ();
00081   virtual void SetCamera (iCamera* c);
00082 
00084   virtual iGraphics3D* GetContext ();
00086   virtual void SetContext (iGraphics3D *ig3d);
00087 
00089   virtual void SetRectangle (int x, int y, int w, int h);
00091   virtual void ClearView ();
00093   virtual void AddViewVertex (int x, int y);
00095   virtual void RestrictClipperToScreen ();
00096 
00098   virtual void SetAutoResize (bool state) { AutoResize = state; }
00099 
00101   virtual void UpdateClipper();
00103   virtual iClipper2D* GetClipper ();
00105   virtual void Draw (iMeshWrapper* mesh = 0);
00106 };
00107 
00108 #endif // __CS_CSVIEW_H__

Generated for Crystal Space by doxygen 1.4.7