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
9
11
12namespace {
13 bool g_initialized {};
14}
15
16bool initialize(const std::shared_ptr<Core::VulkanBackend>& backend)
17{
18 if (!backend) {
20 "Cannot initialize Portal::Graphics with null backend");
21 return false;
22 }
23
24 if (g_initialized) {
26 "Portal::Graphics already initialized");
27 return true;
28 }
29
31 "Initializing Portal::Graphics...");
32
33 if (!TextureLoom::instance().initialize(backend)) {
35 "Failed to initialize TextureLoom");
36 return false;
37 }
38
39 if (!SamplerForge::instance().initialize(backend)) {
41 "Failed to initialize SamplerFactory");
42 return false;
43 }
44
45 if (!ShaderFoundry::instance().initialize(backend)) {
47 "Failed to initialize ShaderFoundry");
48 return false;
49 }
50
53 "Failed to initialize ComputePress");
54 return false;
55 }
56
59 "Failed to initialize RenderFlow");
60 return false;
61 }
62
63 g_initialized = true;
65 "Portal::Graphics initialized successfully");
66 return true;
67}
68
70{
71 if (!g_initialized) {
72 return;
73 }
74
76 "Shutting down Portal::Graphics...");
77
81
84
85 g_initialized = false;
86
88 "Portal::Graphics shutdown complete");
89}
90
92{
93 return g_initialized;
94}
95
96} // namespace MayaFlux::Portal::Graphics
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
void shutdown()
Shutdown and cleanup all samplers.
void shutdown()
Shutdown and cleanup all textures.
void initialize()
Definition main.cpp:11
@ API
API calls from external code.
@ Portal
High-level user-facing API layer.
void shutdown()
Shutdown Portal::Graphics subsystem.
Definition Graphics.cpp:69
bool is_initialized()
Check if Portal::Graphics is initialized.
Definition Graphics.cpp:91