-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIRender.h
More file actions
90 lines (75 loc) · 1.71 KB
/
IRender.h
File metadata and controls
90 lines (75 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* IRender.h
*
* Created on: Mar 14, 2013
* Author: CodeArt
*/
#ifndef IRENDER_H_
#define IRENDER_H_
// TODO SCENE MIGHT NEED AN INTERFACE!
namespace MoGraph
{
class Scene;
/**
* \brief Render
* Base class used for all render objects like Bars, Text, Lines
* contains a reference to the scene,
* the scene objects has all relevant information about the scene
*/
class IRender
{
public:
/**
* \brief ~Render , Destructor
*/
virtual~IRender() {};
/**
* \brief init(), generic init function for all Renderable objects
* that inherits Render class
*/
virtual void init() = 0;
/**
* \brief draw(), generic draw function for all Renderable objects
* that inherits Render class
*/
virtual void draw() = 0;
/**
* \brief getScene(), get the Scene class reference
* which this objects belongs to, (parent)
* @return Scene
*/
virtual Scene *getScene() = 0;
};
class Render : public IRender
{
public:
/**
* \brief Render , Constructor
* @param scene , input parameter for reference store to scene
*/
Render(Scene *scene) : mScene(scene) {}
/**
* \brief ~Render , Destructor
*/
virtual~Render() {};
/**
* \brief init(), generic init function for all Renderable objects
* that inherits Render class
*/
virtual void init() {};
/**
* \brief draw(), generic draw function for all Renderable objects
* that inherits Render class
*/
virtual void draw() {};
/**
* \brief getScene(), get the Scene class reference
* which this objects belongs to, (parent)
* @return Scene
*/
virtual Scene *getScene() {return mScene;}
protected:
Scene *mScene; // Scene reference
};
}
#endif /* IRENDER_H_ */