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
3
#include "
SDL/Introspect/SdlIOContext.h
"
4
#include "
SDL/sdl_fwd.h
"
5
#include "
DataIO/FileSystem/Path.h
"
6
7
#include <Common/assertion.h>
8
9
#include <utility>
10
#include <string>
11
#include <type_traits>
12
13
namespace
ph
14
{
15
18
class
SdlInputContext
final :
public
SdlIOContext
19
{
20
public
:
21
SdlInputContext
();
22
23
explicit
SdlInputContext
(
24
const
Path
* workingDirectory,
25
const
SdlClass
* srcClass =
nullptr
,
26
const
SdlStruct
* srcStruct =
nullptr
);
27
28
SdlInputContext
(
29
const
ISdlReferenceGroup
* srcResources,
30
const
ISdlDataPacketGroup
* srcDataPackets,
31
const
Path
* workingDirectory,
32
const
SdlClass
* srcClass =
nullptr
,
33
const
SdlStruct
* srcStruct =
nullptr
);
34
38
const
ISdlReferenceGroup
*
getSrcResources
()
const
;
39
43
const
ISdlDataPacketGroup
*
getSrcDataPackets
()
const
;
44
45
private
:
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.
52
static_assert
(std::is_trivially_copyable_v<SdlInputContext>);
53
54
// In-header Implementation:
55
56
inline
SdlInputContext::SdlInputContext
()
57
58
:
SdlIOContext
()
59
60
, m_srcResources(nullptr)
61
, m_srcDataPackets(nullptr)
62
{}
63
64
inline
SdlInputContext::SdlInputContext
(
65
const
Path
*
const
workingDirectory,
66
const
SdlClass
*
const
srcClass,
67
const
SdlStruct
*
const
srcStruct)
68
69
:
SdlInputContext
(
70
nullptr,
71
nullptr,
72
workingDirectory,
73
srcClass,
74
srcStruct)
75
{}
76
77
inline
SdlInputContext::SdlInputContext
(
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
84
:
SdlIOContext
(
85
workingDirectory,
86
srcClass,
87
srcStruct)
88
89
, m_srcResources(srcResources)
90
, m_srcDataPackets(srcDataPackets)
91
{}
92
93
inline
const
ISdlReferenceGroup
*
SdlInputContext::getSrcResources
()
const
94
{
95
return
m_srcResources;
96
}
97
98
inline
const
ISdlDataPacketGroup
*
SdlInputContext::getSrcDataPackets
()
const
99
{
100
return
m_srcDataPackets;
101
}
102
103
}
// end namespace ph
Path.h
SdlIOContext.h
ph::ISdlDataPacketGroup
View for a group of named data packets.
Definition
ISdlDataPacketGroup.h:15
ph::ISdlReferenceGroup
View for a group of SDL references.
Definition
ISdlReferenceGroup.h:18
ph::Path
General path representation. Does not check whether the target actually exists (e....
Definition
Path.h:21
ph::SdlClass
Definition
SdlClass.h:25
ph::SdlIOContext
Data that SDL input/output process can rely on.
Definition
SdlIOContext.h:17
ph::SdlInputContext
Data that SDL input process can rely on.
Definition
SdlInputContext.h:19
ph::SdlInputContext::SdlInputContext
SdlInputContext()
Definition
SdlInputContext.h:56
ph::SdlInputContext::getSrcDataPackets
const ISdlDataPacketGroup * getSrcDataPackets() const
Definition
SdlInputContext.h:98
ph::SdlInputContext::getSrcResources
const ISdlReferenceGroup * getSrcResources() const
Definition
SdlInputContext.h:93
ph::SdlStruct
Definition
SdlStruct.h:25
ph
The root for all renderer implementations.
Definition
EEngineProject.h:6
sdl_fwd.h
Source
SDL
Introspect
SdlInputContext.h
Generated by
1.11.0