Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlInputContext.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_fwd.h"
6
7#include <Common/assertion.h>
8
9#include <utility>
10#include <string>
11#include <type_traits>
12
13namespace ph
14{
15
18class SdlInputContext final : public SdlIOContext
19{
20public:
22
23 explicit SdlInputContext(
24 const Path* workingDirectory,
25 const SdlClass* srcClass = nullptr,
26 const SdlStruct* srcStruct = nullptr);
27
29 const ISdlReferenceGroup* srcResources,
30 const ISdlDataPacketGroup* srcDataPackets,
31 const Path* workingDirectory,
32 const SdlClass* srcClass = nullptr,
33 const SdlStruct* srcStruct = nullptr);
34
39
44
45private:
46 const ISdlReferenceGroup* m_srcResources;
47 const ISdlDataPacketGroup* m_srcDataPackets;
48};
49
50// Try to make the context trivially copyable, so mock contexts and copy-and-modified contexts can
51// be cheaper to create.
52static_assert(std::is_trivially_copyable_v<SdlInputContext>);
53
54// In-header Implementation:
55
57
58 : SdlIOContext()
59
60 , m_srcResources(nullptr)
61 , m_srcDataPackets(nullptr)
62{}
63
65 const Path* const workingDirectory,
66 const SdlClass* const srcClass,
67 const SdlStruct* const srcStruct)
68
70 nullptr,
71 nullptr,
72 workingDirectory,
73 srcClass,
74 srcStruct)
75{}
76
78 const ISdlReferenceGroup* const srcResources,
79 const ISdlDataPacketGroup* const srcDataPackets,
80 const Path* const workingDirectory,
81 const SdlClass* const srcClass,
82 const SdlStruct* const srcStruct)
83
85 workingDirectory,
86 srcClass,
87 srcStruct)
88
89 , m_srcResources(srcResources)
90 , m_srcDataPackets(srcDataPackets)
91{}
92
94{
95 return m_srcResources;
96}
97
99{
100 return m_srcDataPackets;
101}
102
103}// end namespace ph
View for a group of named data packets.
Definition ISdlDataPacketGroup.h:15
View for a group of SDL references.
Definition ISdlReferenceGroup.h:18
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition SdlClass.h:25
Data that SDL input/output process can rely on.
Definition SdlIOContext.h:17
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
SdlInputContext()
Definition SdlInputContext.h:56
const ISdlDataPacketGroup * getSrcDataPackets() const
Definition SdlInputContext.h:98
const ISdlReferenceGroup * getSrcResources() const
Definition SdlInputContext.h:93
Definition SdlStruct.h:25
The root for all renderer implementations.
Definition EEngineProject.h:6