Skip to content

Commit

Permalink
[renderer] add default argument for constructor facade
Browse files Browse the repository at this point in the history
constructor for le::RenderPass must be callable without arguments, so
that it may work with initializer lists and perfect forwarding,
apparently.
  • Loading branch information
tgfrerer committed Nov 27, 2024
1 parent 3342f92 commit 6e47661
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/le_renderer/le_renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ class RenderPass {
le_renderpass_o* self;

public:
RenderPass( const char* name_, const le::QueueFlagBits& type_ = le::QueueFlagBits::eGraphics )
// We must allow for this constructor to be called with no name, so that it can be used with initializer lists
// and perfect forwarding (this is necessary if you want to throw a RenderPass into a std::unordered_map, for
// example.
RenderPass( const char* name_ = "", const le::QueueFlagBits& type_ = le::QueueFlagBits::eGraphics )
: self( le_renderer::renderpass_i.create( name_, type_ ) ) {
}

Expand All @@ -256,7 +259,7 @@ class RenderPass {
}

// Create facade from pointer
RenderPass( le_renderpass_o* self_ )
explicit RenderPass( le_renderpass_o* self_ )
: self( self_ ) {
le_renderer::renderpass_i.ref_inc( self );
}
Expand Down

0 comments on commit 6e47661

Please sign in to comment.