MayaFlux 0.2.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
69void stop()
70{
71 if (!g_initialized) {
72 return;
73 }
74
76 "Stopping Portal::Graphics...");
77
79
82
84 "Portal::Graphics stopped");
85}
86
88{
89 if (!g_initialized) {
90 return;
91 }
92
94 "Shutting down Portal::Graphics...");
95
99
102
103 g_initialized = false;
104
106 "Portal::Graphics shutdown complete");
107}
108
110{
111 return g_initialized;
112}
113
114} // 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 ShaderFoundry resources.
void stop()
Stop active command recording and free command buffers.
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 stop()
Stop all Portal::Graphics operations.
Definition Graphics.cpp:69
void shutdown()
Shutdown Portal::Graphics subsystem.
Definition Graphics.cpp:87
bool is_initialized()
Check if Portal::Graphics is initialized.
Definition Graphics.cpp:109