22 std::optional<Surface> g_inspect_nodes_surface;
23 std::optional<Surface> g_inspect_buffers_surface;
24 std::optional<Surface> g_inspect_scheduler_surface;
25 std::optional<Surface> g_inspect_events_surface;
26 std::vector<std::unique_ptr<Surface>> g_inspect_surfaces;
28 constexpr uint32_t k_inspect_w = 480;
29 constexpr uint32_t k_inspect_h = 900;
31 void discard_inspect_surface(std::optional<Surface>& surface)
36 surface->layer().clear();
47 std::shared_ptr<Nodes::NodeGraphManager> node_graph_manager,
48 std::shared_ptr<Buffers::BufferManager> buffer_manager,
49 std::shared_ptr<Vruta::TaskScheduler> scheduler,
50 std::shared_ptr<Vruta::EventManager> event_manager,
51 std::shared_ptr<Core::WindowManager> window_manager)
54 std::move(node_graph_manager), std::move(buffer_manager),
55 std::move(scheduler), std::move(event_manager), std::move(window_manager));
60 g_inspect_nodes_surface.reset();
61 g_inspect_buffers_surface.reset();
62 g_inspect_scheduler_surface.reset();
63 g_inspect_events_surface.reset();
64 g_inspect_surfaces.clear();
79std::pair<std::shared_ptr<Layer>, std::shared_ptr<Context>>
112std::pair<Mapped<std::shared_ptr<Kakshya::PlotContainer>>, Surface>
117 std::shared_ptr<Kakshya::PlotContainer> container,
127 .name =
window->get_create_info().title,
139 std::optional<uint32_t> background_id;
145 background_id = bg.element.id;
152 surface.layer().relate(mapped.element.id, *background_id);
153 surface.layer().send_to_back(*background_id);
158 return { std::move(mapped), std::move(surface) };
169 if (g_inspect_nodes_surface && g_inspect_nodes_surface->window()
170 && !g_inspect_nodes_surface->window()->should_close()) {
171 g_inspect_nodes_surface->window()->show();
175 if (g_inspect_nodes_surface) {
179 discard_inspect_surface(g_inspect_nodes_surface);
188 .layer = std::move(layer),
189 .ctx = std::move(ctx),
194 result.group.header.header_id, [&result] { result.tap_all(); });
201 if (g_inspect_buffers_surface && g_inspect_buffers_surface->window()
202 && !g_inspect_buffers_surface->window()->should_close()) {
203 g_inspect_buffers_surface->window()->show();
207 if (g_inspect_buffers_surface) {
211 discard_inspect_surface(g_inspect_buffers_surface);
220 .layer = std::move(layer),
221 .ctx = std::move(ctx),
226 result.group.header.header_id, [&result] { result.tap_all(); });
233 if (g_inspect_scheduler_surface && g_inspect_scheduler_surface->window()
234 && !g_inspect_scheduler_surface->window()->should_close()) {
235 g_inspect_scheduler_surface->window()->show();
239 if (g_inspect_scheduler_surface) {
243 discard_inspect_surface(g_inspect_scheduler_surface);
252 .layer = std::move(layer),
253 .ctx = std::move(ctx),
258 result.group.header.header_id, [&result] { result.tap_all(); });
265 if (g_inspect_events_surface && g_inspect_events_surface->window()
266 && !g_inspect_events_surface->window()->should_close()) {
267 g_inspect_events_surface->window()->show();
271 if (g_inspect_events_surface) {
275 discard_inspect_surface(g_inspect_events_surface);
284 .layer = std::move(layer),
285 .ctx = std::move(ctx),
290 result.group.header.header_id, [&result] { result.tap_all(); });
293void inspect(
const std::shared_ptr<Nodes::Node>& node)
302 g_inspect_surfaces.push_back(std::make_unique<Surface>(
SurfaceConfig {
304 .layer = std::move(layer),
305 .ctx = std::move(ctx),
307 auto& surface = *g_inspect_surfaces.back();
309 auto result = std::make_shared<InspectResult>(atelier.
inspector().
node(node, surface, cursor));
311 result->group.header.header_id, [result] { result->tap_all(); });
314void inspect(
const std::shared_ptr<Buffers::Buffer>& buf)
323 g_inspect_surfaces.push_back(std::make_unique<Surface>(
SurfaceConfig {
325 .layer = std::move(layer),
326 .ctx = std::move(ctx),
328 auto& surface = *g_inspect_surfaces.back();
330 auto result = std::make_shared<InspectResult>(atelier.
inspector().
buffer(buf, surface, cursor));
332 result->group.header.header_id, [result] { result->tap_all(); });
335void inspect(
const std::shared_ptr<Nodes::Network::NodeNetwork>& net)
343 g_inspect_surfaces.push_back(std::make_unique<Surface>(
SurfaceConfig {
345 .layer = std::move(layer),
346 .ctx = std::move(ctx),
348 auto& surface = *g_inspect_surfaces.back();
350 auto result = std::make_shared<InspectResult>(atelier.
inspector().
node_network(net, surface, cursor));
352 result->group.header.header_id, [result] { result->tap_all(); });
355void inspect(
const std::shared_ptr<Vruta::Event>& ev, std::string_view
name)
358 const std::string title =
name.empty() ?
"Event" :
"Event: " + std::string(
name);
364 g_inspect_surfaces.push_back(std::make_unique<Surface>(
SurfaceConfig {
366 .layer = std::move(layer),
367 .ctx = std::move(ctx),
369 auto& surface = *g_inspect_surfaces.back();
371 auto result = std::make_shared<InspectResult>(atelier.
inspector().
event(ev,
name, surface, cursor));
373 result->group.header.header_id, [result] { result->tap_all(); });
std::weak_ptr< Core::Window > window
void unbind(uint32_t id)
Remove all callbacks registered for an element id.
std::string short_dynamic_type_name(const T &obj) noexcept
Returns the unqualified dynamic type name of obj.
std::string title
Window title/identifier.
Configuration for creating a single window instance.
std::vector< std::pair< std::string, std::shared_ptr< Core::VKImage > > > additional_textures
std::string fragment_shader
Unified rendering configuration for graphics buffers.