renderable.h

Go to the documentation of this file.
00001 /*
00002  Copyright (C) 2001-2006, William Joseph.
00003  All Rights Reserved.
00004 
00005  This file is part of GtkRadiant.
00006 
00007  GtkRadiant is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by
00009  the Free Software Foundation; either version 2 of the License, or
00010  (at your option) any later version.
00011 
00012  GtkRadiant is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU General Public License for more details.
00016 
00017  You should have received a copy of the GNU General Public License
00018  along with GtkRadiant; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #if !defined(INCLUDED_RENDERABLE_H)
00023 #define INCLUDED_RENDERABLE_H
00024 
00025 #include "generic/constant.h"
00026 
00027 class Shader;
00028 class OpenGLRenderable;
00029 class LightList;
00030 class Matrix4;
00031 
00048 class Renderer
00049 {
00050     public:
00051         enum EHighlightMode
00052         {
00053             eFace = 1 << 0,
00055             ePrimitive = 1 << 1,
00056         };
00057 
00058         enum EStyle
00059         {
00060             eWireframeOnly, eFullMaterials,
00061         };
00062 
00063         virtual ~Renderer ()
00064         {
00065         }
00066 
00067         virtual void PushState () = 0;
00068         virtual void PopState () = 0;
00069         virtual void SetState (Shader* state, EStyle mode) = 0;
00070         virtual const EStyle getStyle () const = 0;
00071         virtual void Highlight (EHighlightMode mode, bool bEnable = true) = 0;
00072         virtual void setLights (const LightList& lights)
00073         {
00074         }
00075         virtual void addRenderable (const OpenGLRenderable& renderable, const Matrix4& world) = 0;
00076 };
00077 
00078 class VolumeTest;
00079 
00084 class Renderable
00085 {
00086     public:
00087         STRING_CONSTANT(Name, "Renderable");
00088 
00089         virtual ~Renderable ()
00090         {
00091         }
00092 
00094         virtual void renderSolid (Renderer& renderer, const VolumeTest& volume) const = 0;
00096         virtual void renderWireframe (Renderer& renderer, const VolumeTest& volume) const = 0;
00097         virtual void renderComponents (Renderer&, const VolumeTest&) const
00098         {
00099         }
00100         virtual void viewChanged () const
00101         {
00102         }
00103 };
00104 
00105 #endif

Generated by  doxygen 1.6.2