renderable.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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