From 4a56f72f5be6cd34c96a082e3697f4eecd744e75 Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Sun, 24 May 2015 23:22:51 +0300 Subject: Haiku: Initial support. --- platform/haiku/SCsub | 10 ++++++++++ platform/haiku/detect.py | 42 +++++++++++++++++++++++++++++++++++++++ platform/haiku/godot_haiku.cpp | 19 ++++++++++++++++++ platform/haiku/logo.png | Bin 0 -> 2055 bytes platform/haiku/os_haiku.cpp | 0 platform/haiku/os_haiku.h | 42 +++++++++++++++++++++++++++++++++++++++ platform/haiku/platform_config.h | 1 + 7 files changed, 114 insertions(+) create mode 100644 platform/haiku/SCsub create mode 100644 platform/haiku/detect.py create mode 100644 platform/haiku/godot_haiku.cpp create mode 100644 platform/haiku/logo.png create mode 100644 platform/haiku/os_haiku.cpp create mode 100644 platform/haiku/os_haiku.h create mode 100644 platform/haiku/platform_config.h (limited to 'platform') 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 new file mode 100644 index 0000000000..c40214d6de Binary files /dev/null and b/platform/haiku/logo.png differ diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp new file mode 100644 index 0000000000..e69de29bb2 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 *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 -- cgit v1.2.3