| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#if !defined( INCLUDED_RENDERABLE_H ) |
| 23 |
#define INCLUDED_RENDERABLE_H |
| 24 |
|
| 25 |
#include "generic/constant.h" |
| 26 |
|
| 27 |
class Shader; |
| 28 |
class OpenGLRenderable; |
| 29 |
class LightList; |
| 30 |
class Matrix4; |
| 31 |
|
| 32 |
class Renderer |
| 33 |
{ |
| 34 |
public: |
| 35 |
enum EHighlightMode |
| 36 |
{ |
| 37 |
eFace = 1 << 0, |
| 38 |
|
| 39 |
ePrimitive = 1 << 1, |
| 40 |
}; |
| 41 |
|
| 42 |
enum EStyle |
| 43 |
{ |
| 44 |
eWireframeOnly, |
| 45 |
eFullMaterials, |
| 46 |
}; |
| 47 |
|
| 48 |
virtual void PushState() = 0; |
| 49 |
virtual void PopState() = 0; |
| 50 |
virtual void SetState( Shader* state, EStyle mode ) = 0; |
| 51 |
virtual EStyle getStyle() const = 0; |
| 52 |
virtual void Highlight( EHighlightMode mode, bool bEnable = true ) = 0; |
| 53 |
virtual void setLights( const LightList& lights ){ |
| 54 |
} |
| 55 |
virtual void addRenderable( const OpenGLRenderable& renderable, const Matrix4& world ) = 0; |
| 56 |
}; |
| 57 |
|
| 58 |
class VolumeTest; |
| 59 |
|
| 60 |
class Renderable |
| 61 |
{ |
| 62 |
public: |
| 63 |
virtual ~Renderable() = default; |
| 64 |
STRING_CONSTANT( Name, "Renderable" ); |
| 65 |
|
| 66 |
virtual void renderSolid( Renderer& renderer, const VolumeTest& volume ) const = 0; |
| 67 |
virtual void renderWireframe( Renderer& renderer, const VolumeTest& volume ) const = 0; |
| 68 |
virtual void renderComponents( Renderer&, const VolumeTest& ) const { |
| 69 |
} |
| 70 |
virtual void viewChanged() const { |
| 71 |
} |
| 72 |
}; |
| 73 |
|
| 74 |
#endif |