Haiku: Initial support.
This commit is contained in:
parent
f8f3362cab
commit
4a56f72f5b
7 changed files with 114 additions and 0 deletions
10
platform/haiku/SCsub
Normal file
10
platform/haiku/SCsub
Normal file
|
@ -0,0 +1,10 @@
|
|||
Import('env')
|
||||
|
||||
common_haiku = [
|
||||
'os_haiku.cpp'
|
||||
]
|
||||
|
||||
env.Program(
|
||||
'#bin/godot',
|
||||
['godot_haiku.cpp'] + common_haiku
|
||||
)
|
42
platform/haiku/detect.py
Normal file
42
platform/haiku/detect.py
Normal file
|
@ -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'])
|
19
platform/haiku/godot_haiku.cpp
Normal file
19
platform/haiku/godot_haiku.cpp
Normal file
|
@ -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();
|
||||
}
|
BIN
platform/haiku/logo.png
Normal file
BIN
platform/haiku/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
0
platform/haiku/os_haiku.cpp
Normal file
0
platform/haiku/os_haiku.cpp
Normal file
42
platform/haiku/os_haiku.h
Normal file
42
platform/haiku/os_haiku.h
Normal file
|
@ -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
|
1
platform/haiku/platform_config.h
Normal file
1
platform/haiku/platform_config.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <alloca.h>
|
Loading…
Reference in a new issue