Files

40 lines
1006 B
C++
Raw Permalink Normal View History

2022-07-27 11:25:25 -04:00
#pragma once
#include <aurora/event.h>
#include <memory>
#include <utility>
2022-07-27 11:25:25 -04:00
union SDL_Event;
namespace wgpu {
class RenderPassEncoder;
} // namespace wgpu
2022-07-27 11:25:25 -04:00
namespace aurora::imgui {
class DrawData {
public:
DrawData() noexcept = default;
[[nodiscard]] explicit operator bool() const noexcept { return m_impl != nullptr; }
private:
struct Impl;
explicit DrawData(std::shared_ptr<Impl> impl) noexcept : m_impl(std::move(impl)) {}
std::shared_ptr<Impl> m_impl;
friend DrawData freeze() noexcept;
friend void render(const wgpu::RenderPassEncoder& pass, const DrawData& drawData) noexcept;
};
2022-07-27 11:25:25 -04:00
void create_context() noexcept;
void initialize() noexcept;
void shutdown() noexcept;
void process_event(const SDL_Event& event) noexcept;
2026-05-01 21:52:55 -06:00
bool wants_capture_event(const SDL_Event& event) noexcept;
2022-07-27 11:25:25 -04:00
void new_frame(const AuroraWindowSize& size) noexcept;
DrawData freeze() noexcept;
void render(const wgpu::RenderPassEncoder& pass, const DrawData& drawData) noexcept;
2022-07-27 11:25:25 -04:00
} // namespace aurora::imgui