This commit is contained in:
arthur.jamet
2021-06-16 11:52:32 +02:00
parent cbd2f5496d
commit 0d63fbab6c
4 changed files with 88 additions and 3 deletions
+10 -1
View File
@@ -70,11 +70,20 @@ bool RAY::Window::isFocused(void) const
return IsWindowFocused();
}
const RAY::Vector2 &RAY::Window::getDimensions(void) const
const RAY::Vector2 &RAY::Window::getDimensions(void)
{
this->_dimensions.x = GetScreenWidth();
this->_dimensions.y = GetScreenHeight();
return this->_dimensions;
}
RAY::Window &RAY::Window::setDimensions(const Vector2 &dims)
{
this->_dimensions = dims;
SetWindowSize(dims.x, dims.y);
return *this;
}
void RAY::Window::setVisibleCursor(bool visible)
{
if (visible)
+5 -2
View File
@@ -38,7 +38,7 @@ namespace RAY {
static Window &getInstance();
//! @return A widow insta,ce. Only one window can be open at a time
static Window &getInstance(int width, int height, const std::string &title, unsigned flags = 0, bool openNow = true) noexcept;
static Window &getInstance(int width, int height, const std::string &title, unsigned flags = FLAG_WINDOW_RESIZABLE, bool openNow = true) noexcept;
//! @brief A window is movable.
Window(Window &&) = default;
@@ -64,8 +64,11 @@ namespace RAY {
//! @brief Check if window is currently focused
bool isFocused(void) const;
//! @brief Get window dimensions
const RAY::Vector2 &getDimensions(void);
//! @brief Set window dimensions
const RAY::Vector2 &getDimensions(void) const;
RAY::Window &setDimensions(const Vector2 &dims);
//! @brief Set the cursor visibility
//! @param visible True if the cursor is visible