diff options
author | Kostadin Damyanov <maxmight@gmail.com> | 2015-06-23 21:22:12 +0300 |
---|---|---|
committer | Kostadin Damyanov <maxmight@gmail.com> | 2015-06-23 21:22:12 +0300 |
commit | 7ad89c7e8383144292609f857803a4c57f852259 (patch) | |
tree | 5825cb7898e3c2defa9b8c68b6ffb9f229cbe30a /platform/haiku | |
parent | 174df9a276b26eb6594e3387f71e3fe8c1706253 (diff) |
Haiku: implement some more window-related methods
Diffstat (limited to 'platform/haiku')
-rw-r--r-- | platform/haiku/os_haiku.cpp | 44 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 6 |
2 files changed, 49 insertions, 1 deletions
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 230340f325..b4b7877038 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -20,7 +20,6 @@ void OS_Haiku::run() { } main_loop->init(); - window->Show(); window->StartMessageRunner(); app->Run(); window->StopMessageRunner(); @@ -56,6 +55,16 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_ window = new HaikuDirectWindow(frame); + if (current_video_mode.fullscreen) { + window->SetFullScreen(true); + } + + if (!current_video_mode.resizable) { + uint32 flags = window->Flags(); + flags |= B_NOT_RESIZABLE; + window->SetFlags(flags); + } + #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) context_gl = memnew(ContextGL_Haiku(window)); context_gl->initialize(); @@ -98,6 +107,7 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_ input = memnew(InputDefault); window->SetInput(input); + window->Show(); } void OS_Haiku::finalize() { @@ -246,6 +256,38 @@ bool OS_Haiku::is_window_fullscreen() const { return current_video_mode.fullscreen; } +void OS_Haiku::set_window_resizable(bool p_enabled) { + uint32 flags = window->Flags(); + + if (p_enabled) { + flags &= ~(B_NOT_RESIZABLE); + } else { + flags |= B_NOT_RESIZABLE; + } + + window->SetFlags(flags); +} + +bool OS_Haiku::is_window_resizable() const { + return !(window->Flags() & B_NOT_RESIZABLE); +} + +void OS_Haiku::set_window_minimized(bool p_enabled) { + window->Minimize(p_enabled); +} + +bool OS_Haiku::is_window_minimized() const { + return window->IsMinimized(); +} + +void OS_Haiku::set_window_maximized(bool p_enabled) { + window->Minimize(!p_enabled); +} + +bool OS_Haiku::is_window_maximized() const { + return !window->IsMinimized(); +} + void OS_Haiku::set_video_mode(const VideoMode& p_video_mode, int p_screen) { ERR_PRINT("set_video_mode() NOT IMPLEMENTED"); } diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index 983fbc33a9..a7a8bee522 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -81,6 +81,12 @@ public: virtual void set_window_position(const Point2& p_position); virtual void set_window_fullscreen(bool p_enabled); virtual bool is_window_fullscreen() const; + virtual void set_window_resizable(bool p_enabled); + virtual bool is_window_resizable() const; + virtual void set_window_minimized(bool p_enabled); + virtual bool is_window_minimized() const; + virtual void set_window_maximized(bool p_enabled); + virtual bool is_window_maximized() const; virtual void set_video_mode(const VideoMode& p_video_mode, int p_screen=0); virtual VideoMode get_video_mode(int p_screen=0) const; |