Utility/Enums: Change WindowStyleFlags to the new flags format
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Nz
|
||||
{
|
||||
public:
|
||||
RenderWindow() = default;
|
||||
RenderWindow(VideoMode mode, const String& title, UInt32 style = WindowStyle_Default, const ContextParameters& parameters = ContextParameters());
|
||||
RenderWindow(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default, const ContextParameters& parameters = ContextParameters());
|
||||
RenderWindow(WindowHandle handle, const ContextParameters& parameters = ContextParameters());
|
||||
RenderWindow(const RenderWindow&) = delete;
|
||||
RenderWindow(RenderWindow&&) = delete; ///TODO
|
||||
@@ -39,7 +39,7 @@ namespace Nz
|
||||
bool CopyToImage(AbstractImage* image, const Vector3ui& dstPos = Vector3ui(0U)) const;
|
||||
bool CopyToImage(AbstractImage* image, const Rectui& rect, const Vector3ui& dstPos = Vector3ui(0U)) const;
|
||||
|
||||
bool Create(VideoMode mode, const String& title, UInt32 style = WindowStyle_Default, const ContextParameters& parameters = ContextParameters());
|
||||
bool Create(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default, const ContextParameters& parameters = ContextParameters());
|
||||
bool Create(WindowHandle handle, const ContextParameters& parameters = ContextParameters());
|
||||
|
||||
void Display();
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef NAZARA_ENUMS_UTILITY_HPP
|
||||
#define NAZARA_ENUMS_UTILITY_HPP
|
||||
|
||||
#include <Nazara/Core/Flags.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
enum AnimationType
|
||||
@@ -430,20 +432,29 @@ namespace Nz
|
||||
WindowEventType_Max = WindowEventType_TextEntered
|
||||
};
|
||||
|
||||
enum WindowStyleFlags
|
||||
enum WindowStyle
|
||||
{
|
||||
WindowStyle_None = 0x0, ///< Window has no border nor titlebar.
|
||||
WindowStyle_Fullscreen = 0x1, ///< At the window creation, the OS tries to set it in fullscreen.
|
||||
WindowStyle_None, ///< Window has no border nor titlebar.
|
||||
WindowStyle_Fullscreen, ///< At the window creation, the OS tries to set it in fullscreen.
|
||||
|
||||
WindowStyle_Closable = 0x2, ///< Allows the window to be closed by a button in the titlebar, generating a Quit event.
|
||||
WindowStyle_Resizable = 0x4, ///< Allows the window to be resized by dragging its corners or by a button of the titlebar.
|
||||
WindowStyle_Titlebar = 0x8, ///< Adds a titlebar to the window, this option is automatically enabled if buttons of the titlebar are enabled.
|
||||
WindowStyle_Closable, ///< Allows the window to be closed by a button in the titlebar, generating a Quit event.
|
||||
WindowStyle_Resizable, ///< Allows the window to be resized by dragging its corners or by a button of the titlebar.
|
||||
WindowStyle_Titlebar, ///< Adds a titlebar to the window, this option is automatically enabled if buttons of the titlebar are enabled.
|
||||
|
||||
WindowStyle_Threaded = 0x10, ///< Runs the window into a thread, allowing the application to keep updating while resizing/dragging the window.
|
||||
WindowStyle_Threaded, ///< Runs the window into a thread, allowing the application to keep updating while resizing/dragging the window.
|
||||
|
||||
WindowStyle_Default = WindowStyle_Closable | WindowStyle_Resizable | WindowStyle_Titlebar,
|
||||
WindowStyle_Max = WindowStyle_Threaded*2-1
|
||||
WindowStyle_Max = WindowStyle_Threaded
|
||||
};
|
||||
|
||||
template<>
|
||||
struct EnableFlagsOperators<WindowStyle>
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
using WindowStyleFlags = Flags<WindowStyle>;
|
||||
|
||||
constexpr WindowStyleFlags WindowStyle_Default = WindowStyle_Closable | WindowStyle_Resizable | WindowStyle_Titlebar;
|
||||
}
|
||||
|
||||
#endif // NAZARA_ENUMS_UTILITY_HPP
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Nz
|
||||
|
||||
public:
|
||||
inline Window();
|
||||
inline Window(VideoMode mode, const String& title, UInt32 style = WindowStyle_Default);
|
||||
inline Window(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default);
|
||||
inline Window(WindowHandle handle);
|
||||
Window(const Window&) = delete;
|
||||
inline Window(Window&& window) noexcept;
|
||||
@@ -44,7 +44,7 @@ namespace Nz
|
||||
|
||||
inline void Close();
|
||||
|
||||
bool Create(VideoMode mode, const String& title, UInt32 style = WindowStyle_Default);
|
||||
bool Create(VideoMode mode, const String& title, WindowStyleFlags style = WindowStyle_Default);
|
||||
bool Create(WindowHandle handle);
|
||||
|
||||
void Destroy();
|
||||
@@ -62,7 +62,7 @@ namespace Nz
|
||||
unsigned int GetHeight() const;
|
||||
Vector2i GetPosition() const;
|
||||
Vector2ui GetSize() const;
|
||||
UInt32 GetStyle() const;
|
||||
WindowStyleFlags GetStyle() const;
|
||||
String GetTitle() const;
|
||||
unsigned int GetWidth() const;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline Window::Window(VideoMode mode, const String& title, UInt32 style) :
|
||||
inline Window::Window(VideoMode mode, const String& title, WindowStyleFlags style) :
|
||||
Window()
|
||||
{
|
||||
ErrorFlags flags(ErrorFlag_ThrowException, true);
|
||||
|
||||
Reference in New Issue
Block a user