Line | |
---|
1 | #include "Shape.h"
|
---|
2 | #include "Material.h"
|
---|
3 | #include "RenderState.h"
|
---|
4 | #include "Geometry.h"
|
---|
5 | #include "SceneEntity.h"
|
---|
6 |
|
---|
7 | #include "glInterface.h"
|
---|
8 | #include <Cg/cg.h>
|
---|
9 | #include <Cg/cgGL.h>
|
---|
10 |
|
---|
11 |
|
---|
12 | namespace CHCDemoEngine
|
---|
13 | {
|
---|
14 |
|
---|
15 | Shape::Shape(Geometry *geometry, Material *mat, SceneEntity *parent):
|
---|
16 | mGeometry(geometry),
|
---|
17 | mMaterial(mat),
|
---|
18 | mParent(parent),
|
---|
19 | mRenderQueueBucket(NULL)
|
---|
20 | {
|
---|
21 | }
|
---|
22 |
|
---|
23 |
|
---|
24 | Shape::~Shape()
|
---|
25 | {}
|
---|
26 |
|
---|
27 |
|
---|
28 | void Shape::Render(RenderState *state)
|
---|
29 | {
|
---|
30 | if (mMaterial) mMaterial->Render(state);
|
---|
31 |
|
---|
32 | mGeometry->Render(state);
|
---|
33 | }
|
---|
34 |
|
---|
35 |
|
---|
36 | void Shape::SetGeometry(Geometry *geom)
|
---|
37 | {
|
---|
38 | mGeometry = geom;
|
---|
39 | }
|
---|
40 |
|
---|
41 |
|
---|
42 | void Shape::SetMaterial(Material *mat)
|
---|
43 | {
|
---|
44 | mMaterial = mat;
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.