diff options
author | Kostadin Damyanov <maxmight@gmail.com> | 2015-05-24 23:22:51 +0300 |
---|---|---|
committer | Kostadin Damyanov <maxmight@gmail.com> | 2015-05-24 23:22:51 +0300 |
commit | 4a56f72f5be6cd34c96a082e3697f4eecd744e75 (patch) | |
tree | 92957fb8dc1d813427274fba90e2b8eb840683f5 /platform/haiku | |
parent | f8f3362cab16ddfbc1d954ecadbccd4838200769 (diff) |
Haiku: Initial support.
Diffstat (limited to 'platform/haiku')
-rw-r--r-- | platform/haiku/SCsub | 10 | ||||
-rw-r--r-- | platform/haiku/detect.py | 42 | ||||
-rw-r--r-- | platform/haiku/godot_haiku.cpp | 19 | ||||
-rw-r--r-- | platform/haiku/logo.png | bin | 0 -> 2055 bytes | |||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 0 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 42 | ||||
-rw-r--r-- | platform/haiku/platform_config.h | 1 |
7 files changed, 114 insertions, 0 deletions
diff --git a/platform/haiku/SCsub b/platform/haiku/SCsub new file mode 100644 index 0000000000..8ae489cf54 --- /dev/null +++ b/platform/haiku/SCsub @@ -0,0 +1,10 @@ +Import('env') + +common_haiku = [ + 'os_haiku.cpp' +] + +env.Program( + '#bin/godot', + ['godot_haiku.cpp'] + common_haiku +) diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py new file mode 100644 index 0000000000..992c73ee79 --- /dev/null +++ b/platform/haiku/detect.py @@ -0,0 +1,42 @@ +import os +import sys + +def is_active(): + return True + +def get_name(): + return "Haiku" + +def can_build(): + if (os.name != "posix"): + return False + + if (sys.platform == "darwin"): + return False + + return True + +def get_opts(): + return [] + +def get_flags(): + return [ + ('builtin_zlib', 'no') + ] + +def configure(env): + is64=sys.maxsize > 2**32 + + if (env["bits"]=="default"): + if (is64): + env["bits"]="64" + else: + env["bits"]="32" + + env.Append(CPPPATH = ['#platform/haiku']) + env["CC"] = "gcc-x86" + env["CXX"] = "g++-x86" + env.Append(CPPFLAGS = ['-DDEBUG_METHODS_ENABLED']) + + env.Append(CPPFLAGS = ['-DUNIX_ENABLED']) + #env.Append(LIBS = ['be']) diff --git a/platform/haiku/godot_haiku.cpp b/platform/haiku/godot_haiku.cpp new file mode 100644 index 0000000000..b4e5e50891 --- /dev/null +++ b/platform/haiku/godot_haiku.cpp @@ -0,0 +1,19 @@ +#include "main/main.h" +#include "os_haiku.h" + +int main(int argc, char* argv[]) { + OS_Haiku os; + + Error error = Main::setup(argv[0], argc-1, &argv[1]); + if (error != OK) { + return 255; + } + + if (Main::start()) { + os.run(); + } + + Main::cleanup(); + + return os.get_exit_code(); +} diff --git a/platform/haiku/logo.png b/platform/haiku/logo.png Binary files differnew file mode 100644 index 0000000000..c40214d6de --- /dev/null +++ b/platform/haiku/logo.png diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/platform/haiku/os_haiku.cpp diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h new file mode 100644 index 0000000000..ee1283f018 --- /dev/null +++ b/platform/haiku/os_haiku.h @@ -0,0 +1,42 @@ +#ifndef OS_HAIKU_H +#define OS_HAIKU_H + +#include "drivers/unix/os_unix.h" + + +class OS_Haiku : public OS_Unix { +private: + virtual void delete_main_loop(); + +protected: + virtual int get_video_driver_count() const; + virtual const char* get_video_driver_name(int p_driver) const; + virtual VideoMode get_default_video_mode() const; + + virtual void initialize(const VideoMode& p_desired, int p_video_driver, int p_audio_driver); + virtual void finalize(); + + virtual void set_main_loop(MainLoop* p_main_loop); + +public: + OS_Haiku(); + void run(); + + virtual String get_name(); + + virtual MainLoop *get_main_loop() const; + virtual bool can_draw() const; + + virtual Point2 get_mouse_pos() const; + virtual int get_mouse_button_state() const; + virtual void set_cursor_shape(CursorShape p_shape); + + virtual void set_window_title(const String& p_title); + virtual Size2 get_window_size() 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; + virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen=0) const; +}; + +#endif diff --git a/platform/haiku/platform_config.h b/platform/haiku/platform_config.h new file mode 100644 index 0000000000..dad24432a5 --- /dev/null +++ b/platform/haiku/platform_config.h @@ -0,0 +1 @@ +#include <alloca.h> |