6
6
7
7
class GraphicsApiStub : public lepus ::gfx::GraphicsApi
8
8
{
9
- private:
10
- // / @brief Pointer to a bool that will be set to true upon Shutdown being called.
11
- bool * m_ShutdownReceiver = nullptr ;
12
-
13
- private:
14
- inline void * GetUniformInternal (const char *) override
15
- {
16
- return (void *)nullptr ;
17
- }
18
-
19
- public:
20
- GraphicsApiStub (GraphicsApiStubOptions* options, bool * shutdownReceiver = nullptr )
21
- {
22
- Init (options);
23
-
24
- m_ShutdownReceiver = shutdownReceiver;
25
- }
26
-
27
- void Init (lepus::gfx::GraphicsApiOptions* options) override
28
- {
29
- InitInternal<GraphicsApiStubOptions>((GraphicsApiStubOptions*)options);
30
- }
31
-
32
- void CreatePipeline () override
33
- {
34
-
35
- }
36
-
37
- void Draw () override
38
- {
39
-
40
- }
41
-
42
- void UpdateUniforms () override
43
- {
44
-
45
- }
46
-
47
- void setOptionsTestValue (long long testValue)
48
- {
49
- GetOptions<GraphicsApiStubOptions>().testValue = testValue;
50
- }
51
-
52
- long long getOptionsTestValue ()
53
- {
54
- return GetOptions<GraphicsApiStubOptions>().testValue ;
55
- }
56
-
57
- void Shutdown () override
9
+ private:
10
+ // / @brief Pointer to a bool that will be set to true upon Shutdown being called.
11
+ bool * m_ShutdownReceiver = nullptr ;
12
+
13
+ private:
14
+ inline void * GetUniformInternal (const char *) override
15
+ {
16
+ return (void *)nullptr ;
17
+ }
18
+
19
+ public:
20
+ GraphicsApiStub (GraphicsApiStubOptions* options, bool * shutdownReceiver = nullptr )
21
+ {
22
+ Init (options);
23
+
24
+ m_ShutdownReceiver = shutdownReceiver;
25
+ }
26
+
27
+ void Init (lepus::gfx::GraphicsApiOptions* options) override
28
+ {
29
+ InitInternal<GraphicsApiStubOptions>((GraphicsApiStubOptions*)options);
30
+ }
31
+
32
+ void CreatePipeline () override
33
+ {
34
+ }
35
+
36
+ void Draw (const lepus::gfx::SceneGraph& scene) override
37
+ {
38
+ }
39
+
40
+ void UpdateUniforms (const lepus::gfx::SceneGraph& scene) override
41
+ {
42
+ }
43
+
44
+ lepus::engine::objects::Mesh* WrapMesh (lepus::engine::objects::Mesh* mesh) override
45
+ {
46
+ return nullptr ;
47
+ }
48
+
49
+ void setOptionsTestValue (long long testValue)
50
+ {
51
+ GetOptions<GraphicsApiStubOptions>().testValue = testValue;
52
+ }
53
+
54
+ long long getOptionsTestValue ()
55
+ {
56
+ return GetOptions<GraphicsApiStubOptions>().testValue ;
57
+ }
58
+
59
+ void Shutdown () override
60
+ {
61
+ GraphicsApi::Shutdown ();
62
+
63
+ if (m_Options)
58
64
{
59
- GraphicsApi::Shutdown ();
60
-
61
- if (m_Options)
62
- {
63
- if (m_ShutdownReceiver)
64
- {
65
- *m_ShutdownReceiver = true ;
66
- }
67
-
68
- // TODO: is this cast needed?
69
- delete (GraphicsApiStubOptions*)m_Options;
70
- m_Options = nullptr ;
71
- }
65
+ if (m_ShutdownReceiver)
66
+ {
67
+ *m_ShutdownReceiver = true ;
68
+ }
69
+
70
+ // TODO: is this cast needed?
71
+ delete (GraphicsApiStubOptions*)m_Options;
72
+ m_Options = nullptr ;
72
73
}
74
+ }
73
75
74
- void ClearFrameBuffer (float r, float g, float b) override
75
- {
76
- // Do nothing.
77
- }
76
+ void ClearFrameBuffer (float r, float g, float b) override
77
+ {
78
+ // Do nothing.
79
+ }
78
80
};
79
81
80
-
81
82
template lepus::gfx::UniformBinding<void *>* const lepus::gfx::GraphicsApi::GetUniform<lepus::gfx::UniformBinding<void *>*>(const char * name);
82
83
83
84
#endif
0 commit comments