2022-07-27 11:25:25 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <aurora/event.h>
|
|
|
|
|
|
2026-06-04 23:43:13 -06:00
|
|
|
#include <memory>
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
2022-07-27 11:25:25 -04:00
|
|
|
union SDL_Event;
|
2022-08-02 16:37:56 -04:00
|
|
|
|
|
|
|
|
namespace wgpu {
|
|
|
|
|
class RenderPassEncoder;
|
|
|
|
|
} // namespace wgpu
|
2022-07-27 11:25:25 -04:00
|
|
|
|
|
|
|
|
namespace aurora::imgui {
|
2026-06-04 23:43:13 -06:00
|
|
|
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;
|
2026-06-04 23:43:13 -06:00
|
|
|
DrawData freeze() noexcept;
|
|
|
|
|
void render(const wgpu::RenderPassEncoder& pass, const DrawData& drawData) noexcept;
|
2022-07-27 11:25:25 -04:00
|
|
|
} // namespace aurora::imgui
|