55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
#pragma once
|
|
#include "../architecture/Plot_Render_Context.h"
|
|
#include "../architecture/Renderable.h"
|
|
#include "../base/Color.h"
|
|
#include "../base/Geometry.h"
|
|
#include "../event/Event.h"
|
|
#include "../flow/Frame_Flow.h"
|
|
#include "../flow/Present_Surface_Lease.h"
|
|
#include "Presentation_Sink.h"
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace renderive {
|
|
|
|
class Plot_Core_Private;
|
|
|
|
class Plot_Core {
|
|
public:
|
|
explicit Plot_Core(std::unique_ptr<Frame_Flow> flow);
|
|
~Plot_Core();
|
|
|
|
void init();
|
|
|
|
[[nodiscard]] std::shared_ptr<Plot_Render_Context> render_context() const;
|
|
[[nodiscard]] std::shared_ptr<Renderable> root_renderable() const;
|
|
[[nodiscard]] std::shared_ptr<Renderable> create_renderable_node(
|
|
const std::shared_ptr<Renderable>& parent, std::string object_name = {});
|
|
|
|
void remove_renderable(const std::shared_ptr<Renderable>& renderable);
|
|
|
|
void set_background_color(Color color);
|
|
[[nodiscard]] Color background_color() const;
|
|
|
|
void set_viewport_size(Size size);
|
|
[[nodiscard]] Size viewport_size() const;
|
|
|
|
void dispatch_event(const Event& event);
|
|
void notify_model_dirty();
|
|
void request_explicit_render();
|
|
|
|
void activate_view();
|
|
void deactivate_view();
|
|
[[nodiscard]] bool view_active() const;
|
|
|
|
void set_presentation_sink(std::weak_ptr<Presentation_Sink> sink);
|
|
|
|
Present_Surface_Lease begin_present();
|
|
void end_present(Present_Surface_Lease&& frame, std::uint64_t paint_begin_ns, std::uint64_t paint_end_ns);
|
|
|
|
private:
|
|
std::shared_ptr<Plot_Core_Private> d;
|
|
};
|
|
|
|
} // namespace renderive
|