Skip to content

Commit 7b16c6d

Browse files
committed
test(lepus::gfx): updated GraphicsApi stub to fix build
1 parent dca207f commit 7b16c6d

File tree

1 file changed

+68
-67
lines changed

1 file changed

+68
-67
lines changed

tests/L3D/GraphicsEngine/GraphicsApiTests.h

+68-67
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,79 @@
66

77
class GraphicsApiStub : public lepus::gfx::GraphicsApi
88
{
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)
5864
{
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;
7273
}
74+
}
7375

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+
}
7880
};
7981

80-
8182
template lepus::gfx::UniformBinding<void*>* const lepus::gfx::GraphicsApi::GetUniform<lepus::gfx::UniformBinding<void*>*>(const char* name);
8283

8384
#endif

0 commit comments

Comments
 (0)