29 window_.set_size(w, h);
35 auto size = window_.get_size();
37 bool needs_recreate =
true;
40 auto surf_size = surface_->get_size();
41 needs_recreate = surf_size.width !=
size.w || surf_size.
height !=
size.h;
46 surface_ = std::make_shared<gfx::frame_buffer>(window_.get_native_handle(),
47 static_cast<std::uint16_t
>(
size.w),
48 static_cast<std::uint16_t
>(
size.h));
64 pass_ = std::make_unique<gfx::render_pass>(
"present_to_window_pass");
65 pass_->bind(surface_.get());
~render_window()
Destructor for the render window.
std::shared_ptr< gfx::frame_buffer > graphics_surface_t
auto get_surface() -> graphics_surface_t &
Gets the rendering surface.
void prepare_surface()
Prepares the rendering surface.
void destroy_surface()
Destroys the rendering surface.
auto begin_present_pass() -> gfx::render_pass &
Begins the present render pass.
void resize(uint32_t w, uint32_t h)
Resizes the render window to the specified width and height.
auto get_window() -> os::window &
Gets the associated OS window.
render_window(os::window &&win)
Constructs a render window with the specified OS window.
auto get_present_pass() -> gfx::render_pass &
Gets the present render pass.