1 | #pragma once
|
---|
2 | #include "Node.h"
|
---|
3 | #include <boost/shared_ptr.hpp>
|
---|
4 |
|
---|
5 | class Scene;
|
---|
6 |
|
---|
7 | #define SPTR boost::shared_ptr
|
---|
8 | #define WPTR boost::weak_ptr
|
---|
9 |
|
---|
10 | class Renderer
|
---|
11 | {
|
---|
12 | public:
|
---|
13 | friend class RenderPass;
|
---|
14 |
|
---|
15 | Renderer(void);
|
---|
16 | virtual ~Renderer(void);
|
---|
17 | void setNode(WPTR<Node> &_myNode);
|
---|
18 | void setScene(Scene &scene);
|
---|
19 |
|
---|
20 | void setRenderPriority(int _priority);
|
---|
21 | int getRenderPriority();
|
---|
22 |
|
---|
23 | //Funktionen die eventuell von RenderPass aufgerufen werden
|
---|
24 | virtual void setWorldMatrix(D3DXMATRIX &_worldMat);
|
---|
25 | virtual void setViewMatrix(D3DXMATRIX &_viewMat);
|
---|
26 | virtual void setProjectionMatrix(D3DXMATRIX &_projMat);
|
---|
27 |
|
---|
28 | virtual void render() = 0;
|
---|
29 | virtual void init() = 0;
|
---|
30 | virtual bool isLowerThan(Renderer* renderer) = 0;
|
---|
31 | friend class Scene;
|
---|
32 |
|
---|
33 | virtual void OnLostDevice( void* pUserContext ) = 0;
|
---|
34 | virtual void OnDestroyDevice( void* pUserContext ) = 0;
|
---|
35 | virtual HRESULT OnResetDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext ) = 0;
|
---|
36 |
|
---|
37 | virtual void setCurrentTexture(IDirect3DTexture9* texture);
|
---|
38 |
|
---|
39 | bool isA(int _rendererType);
|
---|
40 | static const int RENDERER_HUD = 1;
|
---|
41 | static const int RENDERER_OCEAN = 2;
|
---|
42 | static const int RENDERER_PARTICLE = 4;
|
---|
43 | static const int RENDERER_RAYTRACE = 8;
|
---|
44 | static const int RENDERER_SIMPLEMESH = 16;
|
---|
45 | static const int RENDERER_SKYBOX = 32;
|
---|
46 | static const int RENDERER_TERRAIN = 64;
|
---|
47 |
|
---|
48 | virtual bool needsExtraPass();
|
---|
49 |
|
---|
50 | WPTR<Node> myNode;
|
---|
51 | protected:
|
---|
52 | IDirect3DDevice9 *device;
|
---|
53 | Scene *myScene;
|
---|
54 |
|
---|
55 | bool nodeAdded;
|
---|
56 | int rendererType;
|
---|
57 | int myRenderPriority;
|
---|
58 | };
|
---|