Skip to content

Commit

Permalink
window: Update API for C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Dec 25, 2024
1 parent 0db2a07 commit fa3bbb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/private/window_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class window_impl : public window
window& setSize(int width, int height) override;
window& setPosition(int x, int y) override;
window& setIcon(const unsigned char* icon, size_t iconSize) override;
window& setWindowName(const std::string& windowName) override;
window& setWindowName(std::string_view windowName) override;
point3_t getWorldFromDisplay(const point3_t& displayPoint) const override;
point3_t getDisplayFromWorld(const point3_t& worldPoint) const override;
///@}
Expand Down
2 changes: 1 addition & 1 deletion library/public/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class F3D_EXPORT window
/**
* Set the window name to be shown by a window manager.
*/
virtual window& setWindowName(const std::string& windowName) = 0;
virtual window& setWindowName(std::string_view windowName) = 0;

/**
* Convert a point in display coordinate to world coordinate.
Expand Down
4 changes: 2 additions & 2 deletions library/src/window_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ window& window_impl::setIcon(const unsigned char* icon, size_t iconSize)
}

//----------------------------------------------------------------------------
window& window_impl::setWindowName(const std::string& windowName)
window& window_impl::setWindowName(std::string_view windowName)
{
this->Internals->RenWin->SetWindowName(windowName.c_str());
this->Internals->RenWin->SetWindowName(windowName.data());
return *this;
}

Expand Down

0 comments on commit fa3bbb7

Please sign in to comment.