1 | #pragma once
|
---|
2 |
|
---|
3 | //disable inheritance warning caused by multiple inheritance
|
---|
4 | #if _WIN32
|
---|
5 | #if _MSC_VER
|
---|
6 | #pragma warning(disable: 4250)
|
---|
7 | #endif
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #include "OgreRenderTechnique.h"
|
---|
11 | #include "SBBRenderTechnique.h"
|
---|
12 | #include "Ogre.h"
|
---|
13 |
|
---|
14 | using namespace Ogre;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | @brief SBBRenderTechnique used in an OGRE environment.
|
---|
18 | */
|
---|
19 | class __declspec( dllexport ) OgreSBBRenderTechnique : public OgreRenderTechnique,
|
---|
20 | public SBBRenderTechnique,
|
---|
21 | public RenderTargetListener,
|
---|
22 | public FrameListener,
|
---|
23 | public UpdateListener
|
---|
24 | {
|
---|
25 | public:
|
---|
26 | /**
|
---|
27 | @brief Constructor.
|
---|
28 |
|
---|
29 | @param depthTexID the id of the texture unit state the resulting
|
---|
30 | scene depth map should be bound to
|
---|
31 | @param pass the pass to operate on
|
---|
32 | @param parentRenderable the object to operate on
|
---|
33 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
34 | */
|
---|
35 | OgreSBBRenderTechnique( unsigned char depthTexID,
|
---|
36 | bool bindTexture,
|
---|
37 | Pass* pass,
|
---|
38 | OgreRenderable* parentRenderable,
|
---|
39 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
40 | );
|
---|
41 | virtual ~OgreSBBRenderTechnique();
|
---|
42 |
|
---|
43 | //inherited
|
---|
44 | virtual void update(unsigned long frameNum);
|
---|
45 | //inherited
|
---|
46 | void preRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
47 | //inherited
|
---|
48 | void postRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
49 | //inherited
|
---|
50 | bool frameEnded (const FrameEvent &evt);
|
---|
51 | //inherited
|
---|
52 | void preAllUpdates();
|
---|
53 | //inherited
|
---|
54 | void postAllUpdates();
|
---|
55 |
|
---|
56 | protected:
|
---|
57 | /**
|
---|
58 | &brief the id of the texture unit state the resulting scene depth map should be bound to
|
---|
59 | */
|
---|
60 | unsigned char depthTexID;
|
---|
61 | bool bindTexture;
|
---|
62 | bool lastVisibility;
|
---|
63 |
|
---|
64 | };
|
---|
65 |
|
---|
66 | /**
|
---|
67 | @brief RenderTechniqueFactory to create OgreSBBRenderTechnique instances.
|
---|
68 | */
|
---|
69 | class __declspec( dllexport ) OgreSBBRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
70 | {
|
---|
71 | public:
|
---|
72 |
|
---|
73 | OgreSBBRenderTechniqueFactory();
|
---|
74 |
|
---|
75 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
76 | Pass* pass,
|
---|
77 | OgreRenderable* parentRenderable,
|
---|
78 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
79 |
|
---|
80 |
|
---|
81 | unsigned char depthTexID;
|
---|
82 | bool bindTexture;
|
---|
83 | };
|
---|
84 |
|
---|
85 |
|
---|