source: GTP/branches/IllumWPdeliver2008dec/IlluminationWP/precompiled/include/IllumModule/RenderTechnique.h @ 3255

Revision 3255, 2.9 KB checked in by szirmay, 15 years ago (diff)
Line 
1#pragma once
2#include "ElementaryRenderable.h"
3#include "SharedRuns.h"
4
5class __declspec( dllexport ) TechniqueGroup;
6
7/**
8        @brief Base class __declspec( dllexport ) for a rendering technique.
9
10        A RenderTechnique gives a  description about how to render an object, and what kind of resources are needed to do this.
11        A RenderTechnique does not define the whole process of rendering only one property of the display,
12        example: this object will need a cubemap or this object is going to be a caustic caster.
13        RenderTechniques usually operate on one pass of the rendering, and bind some resources to this pass
14        (for example it can bind a texture or cubemap tho the given pass).
15
16        RenderTechniques are always bound to a Renderable, and a SharedRuns object. The Renderable defines the object to
17        operate on. SharedRuns is to register RenderingRuns which can be shared between other RenderTechniques
18        (example: a cubemap can be used by other techniques too, or even more than one object can share a single cubemap).
19*/
20class __declspec( dllexport ) RenderTechnique
21{
22        public:
23                /**
24                        @brief Constructor.
25
26                        @param parentRenderable the object to operate on
27                        @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
28                */
29                RenderTechnique(
30                                                ElementaryRenderable* parentRenderable,
31                                                TechniqueGroup* parentTechniqueGroup);
32               
33                /**
34                        @brief Updates the resources in the given frame.
35                       
36                        A RenderTechnique is usually need some resources from several runs, so these runs will be updated.
37                       
38                        @param frameNum the actual framenumber
39                */
40                virtual void update(unsigned long frameNum){}
41                /**
42                        @brief Called after one of he shared runs changes.
43                       
44                        @param runType enum describing the type of the changed run
45                        @param run pointer to the changed RenderingRun
46                */
47                virtual void runChanged(RenderingRunType runType, RenderingRun* run){}
48                /**
49                        @brief Called after one of he shared runs updates.
50                       
51                        @param runType enum describing the type of the updated run
52                        @param run pointer to the updated RenderingRun
53                */
54                virtual void runUpdated(RenderingRunType runType, RenderingRun* run){}
55                /**
56                        @brief Conversion to OgreRenderTechnique.
57
58                        This function is needed because of virtual inheritance.
59                */
60                virtual class __declspec( dllexport ) OgreRenderTechnique* asOgreRenderTechnique(){return 0;}
61                /**
62                        @brief Retrieves the renderable this technique operates on.
63                */
64                ElementaryRenderable* getParentRenderable(){return parentRenderable;}
65                               
66        protected:
67
68                /**
69                        @brief The renderable this technique operates on.
70                */
71                ElementaryRenderable* parentRenderable;
72                /**
73                        @brief The TechniqueGroup this RenderedTechnique is attached to.
74                */
75                TechniqueGroup* parentTechniqueGroup;
76                /**
77                        @brief The SharedRuns this RenderedTechnique is attached to.
78                */
79                SharedRuns* sharedRuns;
80               
81               
82               
83};
Note: See TracBrowser for help on using the repository browser.