Line | |
---|
1 | #ifndef __RENDERQUEUE_H
|
---|
2 | #define __RENDERQUEUE_H
|
---|
3 |
|
---|
4 | #include "common.h"
|
---|
5 |
|
---|
6 | namespace CHCDemoEngine
|
---|
7 | {
|
---|
8 |
|
---|
9 | class RenderState;
|
---|
10 |
|
---|
11 |
|
---|
12 | /** This class implements a render queue that sorts entities according to
|
---|
13 | their materials.
|
---|
14 | */
|
---|
15 | class RenderQueue
|
---|
16 | {
|
---|
17 | public:
|
---|
18 |
|
---|
19 | /** Default constructor
|
---|
20 | */
|
---|
21 | RenderQueue();
|
---|
22 | /** Constructor taking a render queue
|
---|
23 | */
|
---|
24 | RenderQueue(RenderState *state);
|
---|
25 | /** Enqueues an entity
|
---|
26 | */
|
---|
27 | void Enqueue(SceneEntity *entity);
|
---|
28 | /** Renders the contents of the render queue.
|
---|
29 | */
|
---|
30 | void Render();
|
---|
31 | /** Sets the current render state
|
---|
32 | */
|
---|
33 | void SetRenderState(RenderState *state);
|
---|
34 | /** Clears the render queue
|
---|
35 | */
|
---|
36 | void Clear();
|
---|
37 |
|
---|
38 | int GetSize() const { return (int)mEntities.size(); }
|
---|
39 |
|
---|
40 | protected:
|
---|
41 |
|
---|
42 | /** Sorts the render queue according to some parameters.
|
---|
43 | */
|
---|
44 | void Sort();
|
---|
45 |
|
---|
46 |
|
---|
47 | ///////////
|
---|
48 |
|
---|
49 | RenderState *mState;
|
---|
50 | SceneEntityContainer mEntities;
|
---|
51 | int mMinSizeForSorting;
|
---|
52 | };
|
---|
53 |
|
---|
54 | }
|
---|
55 |
|
---|
56 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.