PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
graphics_state_internal.h
1#pragma once
2
3#include "pixelbullet/graphics/gpu_session.h"
4#include "pixelbullet/graphics/graphics_runtime_backend_internal.h"
5#include "pixelbullet/graphics/render_device.h"
6
7#include <filesystem>
8#include <memory>
9#include <optional>
10#include <string_view>
11
12namespace pixelbullet
13{
14class Renderer;
15class Window;
16
17namespace graphics_internal
18{
20} // namespace graphics_internal
21
23{
24public:
25 static GraphicsState& GetState(Graphics& graphics) noexcept;
26 static const GraphicsState& GetState(const Graphics& graphics) noexcept;
27};
28
29class GraphicsState
30{
31public:
32 GraphicsState(Graphics& owner, GraphicsConfig config, Window& window);
33 ~GraphicsState();
34
35 Graphics::FrameOutcome Update();
36 GraphicsFrameRuntimeAccess::PrepareFrameOutcome PrepareFrame();
37 GraphicsFrameRuntimeAccess::RenderFrameOutcome RenderPreparedFrame();
38 void WaitIdle() const;
39 void CaptureScreenshot(const std::filesystem::path& filename, std::size_t id) const;
40
41 void SetRenderer(std::unique_ptr<Renderer>&& renderer);
42 std::optional<RenderTargetView> GetRenderTarget(std::string_view name) const;
43 void SetFramebufferResized(std::size_t id);
44 uint32_t GetFrameImageCount() const;
45 const Window& GetWindow() const noexcept;
46 Window& GetWindow() noexcept;
47 GraphicsApplicationInfo GetGraphicsApplicationInfo() const;
48 GraphicsDeviceProperties GetActiveGraphicsDeviceProperties() const;
49 const GraphicsDeviceSelectionSession& GetGraphicsDeviceSelectionSession() const noexcept;
50 void SetGraphicsDeviceSelectionSession(const GraphicsDeviceSelectionSession& session);
51
52 const graphics_internal::GraphicsRuntimeBackend& GetRuntimeBackendForBackendAccess() const noexcept;
53 RenderDevice& GetRenderDevice() noexcept;
54 const RenderDevice& GetRenderDevice() const noexcept;
55
56private:
57 RenderDevice render_device_;
58 Window& window_;
59 GraphicsDeviceSelectionSession device_selection_session_;
60 std::unique_ptr<graphics_internal::GraphicsRuntimeBackend> runtime_;
61};
62} // namespace pixelbullet
Definition graphics_state_internal.h:23
Definition graphics_state_internal.h:30
Host-facing graphics subsystem shell.
Definition graphics.h:21
Definition render_device.h:15
Definition renderer.h:17
Definition window.h:30
Definition graphics_runtime_backend_internal.h:25
Definition graphics_config.h:11
Definition graphics_config.h:19
Definition gpu_diagnostics.h:24