Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSdl.h
Go to the documentation of this file.
1#pragma once
2
9#include "SDL/sdl_traits.h"
10
11#include <type_traits>
12#include <concepts>
13#include <memory>
14
15namespace ph
16{
17
18class Path;
19class ISdlResource;
20class SdlClass;
21
22namespace detail
23{
24
25std::shared_ptr<ISdlResource> load_single_resource(const SdlClass* resourceClass, const Path& file);
26void save_single_resource(const std::shared_ptr<ISdlResource>& resource, const Path& file);
27
28}// end namespace detail
29
30template<typename StaticT = void>
31class TSdl final
32{};
33
36template<>
37class TSdl<void> final
38{
39public:
43 static std::shared_ptr<ISdlResource> makeResource(const SdlClass* clazz);
44};
45
48template<CSdlResource T>
49class TSdl<T> final
50{
51public:
57 static constexpr ESdlTypeCategory getCategory();
58
62 static std::shared_ptr<T> makeResource();
63
67 template<typename... DeducedArgs>
68 static T make(DeducedArgs&&... args);
69 // FIXME: struct needs to have its own specialization of TSdl
70
74 static std::shared_ptr<T> loadResource(const Path& file);
75
78 static void saveResource(const std::shared_ptr<T>& resource, const Path& file);
79};
80
81}// end namespace ph
82
83#include "SDL/TSdl.ipp"
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition SdlClass.h:25
Definition TSdl.h:32
std::shared_ptr< ISdlResource > load_single_resource(const SdlClass *resourceClass, const Path &file)
Definition TSdl.cpp:20
void save_single_resource(const std::shared_ptr< ISdlResource > &resource, const Path &file)
Definition TSdl.cpp:65
The root for all renderer implementations.
Definition EEngineProject.h:6
ESdlTypeCategory
Definition ESdlTypeCategory.h:15