MayaFlux
0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Graphics.cpp
Go to the documentation of this file.
1
#include "
Graphics.hpp
"
2
3
#include "
ComputePress.hpp
"
4
#include "
RenderFlow.hpp
"
5
#include "
SamplerForge.hpp
"
6
#include "
TextureLoom.hpp
"
7
8
#include "
MayaFlux/Journal/Archivist.hpp
"
9
10
namespace
MayaFlux::Portal::Graphics
{
11
12
namespace
{
13
bool
g_initialized {};
14
}
15
16
bool
initialize
(
const
std::shared_ptr<Core::VulkanBackend>& backend)
17
{
18
if
(!backend) {
19
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
20
"Cannot initialize Portal::Graphics with null backend"
);
21
return
false
;
22
}
23
24
if
(g_initialized) {
25
MF_WARN
(
Journal::Component::Portal
,
Journal::Context::API
,
26
"Portal::Graphics already initialized"
);
27
return
true
;
28
}
29
30
MF_INFO
(
Journal::Component::Portal
,
Journal::Context::API
,
31
"Initializing Portal::Graphics..."
);
32
33
if
(!
TextureLoom::instance
().
initialize
(backend)) {
34
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
35
"Failed to initialize TextureLoom"
);
36
return
false
;
37
}
38
39
if
(!
SamplerForge::instance
().
initialize
(backend)) {
40
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
41
"Failed to initialize SamplerFactory"
);
42
return
false
;
43
}
44
45
if
(!
ShaderFoundry::instance
().
initialize
(backend)) {
46
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
47
"Failed to initialize ShaderFoundry"
);
48
return
false
;
49
}
50
51
if
(!
ComputePress::instance
().
initialize
()) {
52
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
53
"Failed to initialize ComputePress"
);
54
return
false
;
55
}
56
57
if
(!
RenderFlow::instance
().
initialize
()) {
58
MF_ERROR
(
Journal::Component::Portal
,
Journal::Context::API
,
59
"Failed to initialize RenderFlow"
);
60
return
false
;
61
}
62
63
g_initialized =
true
;
64
MF_INFO
(
Journal::Component::Portal
,
Journal::Context::API
,
65
"Portal::Graphics initialized successfully"
);
66
return
true
;
67
}
68
69
void
shutdown
()
70
{
71
if
(!g_initialized) {
72
return
;
73
}
74
75
MF_INFO
(
Journal::Component::Portal
,
Journal::Context::API
,
76
"Shutting down Portal::Graphics..."
);
77
78
RenderFlow::instance
().
shutdown
();
79
ComputePress::instance
().
shutdown
();
80
ShaderFoundry::instance
().
shutdown
();
81
82
SamplerForge::instance
().
shutdown
();
83
TextureLoom::instance
().
shutdown
();
84
85
g_initialized =
false
;
86
87
MF_INFO
(
Journal::Component::Portal
,
Journal::Context::API
,
88
"Portal::Graphics shutdown complete"
);
89
}
90
91
bool
is_initialized
()
92
{
93
return
g_initialized;
94
}
95
96
}
// namespace MayaFlux::Portal::Graphics
MF_INFO
#define MF_INFO(comp, ctx,...)
Definition
Archivist.hpp:374
MF_ERROR
#define MF_ERROR(comp, ctx,...)
Definition
Archivist.hpp:382
MF_WARN
#define MF_WARN(comp, ctx,...)
Definition
Archivist.hpp:378
Archivist.hpp
ComputePress.hpp
Graphics.hpp
RenderFlow.hpp
SamplerForge.hpp
TextureLoom.hpp
MayaFlux::Portal::Graphics::ComputePress::shutdown
void shutdown()
Definition
ComputePress.cpp:36
MayaFlux::Portal::Graphics::ComputePress::instance
static ComputePress & instance()
Definition
ComputePress.hpp:26
MayaFlux::Portal::Graphics::RenderFlow::instance
static RenderFlow & instance()
Definition
RenderFlow.hpp:197
MayaFlux::Portal::Graphics::RenderFlow::shutdown
void shutdown()
Definition
RenderFlow.cpp:86
MayaFlux::Portal::Graphics::SamplerForge::instance
static SamplerForge & instance()
Definition
SamplerForge.hpp:32
MayaFlux::Portal::Graphics::SamplerForge::shutdown
void shutdown()
Shutdown and cleanup all samplers.
Definition
SamplerForge.cpp:42
MayaFlux::Portal::Graphics::ShaderFoundry::shutdown
void shutdown()
Shutdown and cleanup.
Definition
ShaderFoundry.cpp:54
MayaFlux::Portal::Graphics::ShaderFoundry::instance
static ShaderFoundry & instance()
Definition
ShaderFoundry.hpp:194
MayaFlux::Portal::Graphics::TextureLoom::instance
static TextureLoom & instance()
Definition
TextureLoom.hpp:70
MayaFlux::Portal::Graphics::TextureLoom::shutdown
void shutdown()
Shutdown and cleanup all textures.
Definition
TextureLoom.cpp:41
initialize
void initialize()
Definition
main.cpp:11
MayaFlux::Journal::Context::API
@ API
API calls from external code.
MayaFlux::Journal::Component::Portal
@ Portal
High-level user-facing API layer.
MayaFlux::Portal::Graphics::shutdown
void shutdown()
Shutdown Portal::Graphics subsystem.
Definition
Graphics.cpp:69
MayaFlux::Portal::Graphics::is_initialized
bool is_initialized()
Check if Portal::Graphics is initialized.
Definition
Graphics.cpp:91
MayaFlux::Portal::Graphics
Definition
ComputePress.cpp:7
src
MayaFlux
Portal
Graphics
Graphics.cpp
Generated by
1.9.8