1 | #pragma once
|
---|
2 |
|
---|
3 | #include "RenderTechnique.h"
|
---|
4 |
|
---|
5 | /**
|
---|
6 | @brief Base abstract class __declspec( dllexport ) of the illumination manager.
|
---|
7 |
|
---|
8 | The illumination manager is responsible for refreshing rendering techniques connected to visible renderables.
|
---|
9 | It also has the resposibility to manage shared runs, to join and split them if needed.
|
---|
10 | */
|
---|
11 | class __declspec( dllexport ) IlluminationManager
|
---|
12 | {
|
---|
13 | protected:
|
---|
14 |
|
---|
15 |
|
---|
16 | public:
|
---|
17 |
|
---|
18 | /**
|
---|
19 | @brief The function to be called to render one frame.
|
---|
20 |
|
---|
21 | This is the main refreshing function. It seasrches for visible objects, manages shared runs and updates render techniques.
|
---|
22 | It should be called after all animations are done and before rendering to the frame buffer.
|
---|
23 |
|
---|
24 | @param frameNumber current framenumber
|
---|
25 | */
|
---|
26 | virtual void update(unsigned long frameNumber) = 0;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | @brief The function to be called when a shared run is splitted.
|
---|
30 |
|
---|
31 | @param old pointer to the SharedRuns instance that is split
|
---|
32 | @param new1 pointer to one of the SharedRuns instance that remain after split
|
---|
33 | @param new2 pointer to the other SharedRuns instance that remain after split
|
---|
34 | */
|
---|
35 | virtual void sharedRunSplit(SharedRuns* old, SharedRuns* new1, SharedRuns* new2){};
|
---|
36 | /**
|
---|
37 | @brief The function to be called when two shared runs are joined.
|
---|
38 |
|
---|
39 | @param old1 pointer to one of the SharedRuns instance that are joined
|
---|
40 | @param old2 pointer to the other SharedRuns instance that are joined
|
---|
41 | @param newsr pointer to the resulting parent SharedRuns instance
|
---|
42 | */
|
---|
43 | virtual void sharedRunJoin(SharedRuns* old1, SharedRuns* old2, SharedRuns* newsr){};
|
---|
44 | /**
|
---|
45 | @brief Joins shared runs if needed.
|
---|
46 |
|
---|
47 | Searches the registered shared run roots and join them if necessary (they are close enough).
|
---|
48 | */
|
---|
49 | virtual void joinSharedRuns(){};
|
---|
50 | /**
|
---|
51 | @brief Register a shared run object.
|
---|
52 |
|
---|
53 | Only called when new techniques are created.
|
---|
54 |
|
---|
55 | @param runs pointer to the SharedRuns instance to add
|
---|
56 | */
|
---|
57 | virtual void addSharedRuns(SharedRuns* runs){};
|
---|
58 |
|
---|
59 | };
|
---|