mirror of
https://github.com/godotengine/godot-platform-haiku.git
synced 2025-12-31 13:48:19 +03:00
Compare commits
14 Commits
3.1-stable
...
3.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0097a4f49c | ||
|
|
df6fd145a4 | ||
|
|
2e98068c7d | ||
|
|
68ea8aaa10 | ||
|
|
4f8866df84 | ||
|
|
289fa4347e | ||
|
|
7ec9c75f82 | ||
|
|
2511f40e25 | ||
|
|
d53c20c5f4 | ||
|
|
02705ef2cb | ||
|
|
fc6c5bd709 | ||
|
|
3b0d863ac7 | ||
|
|
7dd7757708 | ||
|
|
4e32ea9f05 |
20
LICENSE.txt
Normal file
20
LICENSE.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.
|
||||
Copyright (c) 2014-2020 Godot Engine contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
53
README.md
Normal file
53
README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
## Godot Engine platform port for Haiku
|
||||
|
||||
This is the platform port of [Godot Engine](https://godotengine.org) for the
|
||||
[Haiku](https://www.haiku-os.org) operating system.
|
||||
|
||||
Haiku is not an officially supported platform in the main tree of Godot, so
|
||||
this port is kept separate so that it can be contributed to independently of
|
||||
Godot's main release cycle.
|
||||
|
||||
It may imply that this port might not be functional for the latest versions of
|
||||
Godot. For the time being, neither the `3.2` branch nor the `master` branch are
|
||||
functional out-of-the-box on Haiku.
|
||||
|
||||
We welcome all contributions from Haiku developers to ensure that each branch
|
||||
and Git tag of this repository work as expected with the matching branches and
|
||||
tags of the [Godot repository](https://github.com/godotengine/godot/).
|
||||
|
||||
## Usage
|
||||
|
||||
This code is meant to be copied as `platform/haiku` in the Godot Engine
|
||||
[source repository](https://github.com/godotengine/godot/) to make builds of
|
||||
Godot for Haiku.
|
||||
|
||||
It can also be cloned as a Git submodule:
|
||||
|
||||
```
|
||||
git clone https://github.com/godotengine/godot
|
||||
cd godot
|
||||
git submodule add https://github.com/godotengine/godot-haiku-platform platform/haiku
|
||||
```
|
||||
|
||||
Be sure to use compatible branches for the Godot repository and the Haiku port.
|
||||
|
||||
You can then compile Godot for Haiku with:
|
||||
|
||||
```
|
||||
# Editor build, optimized.
|
||||
scons p=haiku tools=yes target=release_debug
|
||||
|
||||
# Export template, debug.
|
||||
scons p=haiku tools=no target=release_debug
|
||||
# Export template, release.
|
||||
scons p=haiku tools=no target=release
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This port is distributed under the MIT license, with the same copyright as the
|
||||
main Godot source repository.
|
||||
|
||||
See [LICENSE.txt](/LICENSE.txt) for details, and
|
||||
[AUTHORS.md](https://github.com/godotengine/godot/blob/master/AUTHORS.md) in
|
||||
the Godot repository for a list of contributors.
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@@ -39,11 +39,11 @@ int32_t *AudioDriverMediaKit::samples_in = NULL;
|
||||
Error AudioDriverMediaKit::init() {
|
||||
active = false;
|
||||
|
||||
mix_rate = 44100;
|
||||
mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
speaker_mode = SPEAKER_MODE_STEREO;
|
||||
channels = 2;
|
||||
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", 25);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
buffer_size = next_power_of_2(latency * mix_rate / 1000);
|
||||
samples_in = memnew_arr(int32_t, buffer_size * channels);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@@ -33,12 +33,10 @@
|
||||
|
||||
#if defined(OPENGL_ENABLED)
|
||||
|
||||
#include "drivers/gl_context/context_gl.h"
|
||||
|
||||
#include "haiku_direct_window.h"
|
||||
#include "haiku_gl_view.h"
|
||||
|
||||
class ContextGL_Haiku : public ContextGL {
|
||||
class ContextGL_Haiku {
|
||||
private:
|
||||
HaikuGLView *view;
|
||||
HaikuDirectWindow *window;
|
||||
@@ -46,18 +44,18 @@ private:
|
||||
bool use_vsync;
|
||||
|
||||
public:
|
||||
virtual Error initialize();
|
||||
virtual void release_current();
|
||||
virtual void make_current();
|
||||
virtual void swap_buffers();
|
||||
virtual int get_window_width();
|
||||
virtual int get_window_height();
|
||||
Error initialize();
|
||||
void release_current();
|
||||
void make_current();
|
||||
void swap_buffers();
|
||||
int get_window_width();
|
||||
int get_window_height();
|
||||
|
||||
virtual void set_use_vsync(bool p_use);
|
||||
virtual bool is_using_vsync() const;
|
||||
void set_use_vsync(bool p_use);
|
||||
bool is_using_vsync() const;
|
||||
|
||||
ContextGL_Haiku(HaikuDirectWindow *p_window);
|
||||
virtual ~ContextGL_Haiku();
|
||||
~ContextGL_Haiku();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
19
detect.py
19
detect.py
@@ -80,7 +80,7 @@ def configure(env):
|
||||
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
||||
|
||||
if not env['builtin_libpng']:
|
||||
env.ParseConfig('pkg-config libpng --cflags --libs')
|
||||
env.ParseConfig('pkg-config libpng16 --cflags --libs')
|
||||
|
||||
if not env['builtin_bullet']:
|
||||
# We need at least version 2.88
|
||||
@@ -95,7 +95,7 @@ def configure(env):
|
||||
if not env['builtin_enet']:
|
||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||
|
||||
if not env['builtin_squish'] and env['tools']:
|
||||
if not env['builtin_squish']:
|
||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||
|
||||
if not env['builtin_zstd']:
|
||||
@@ -128,8 +128,8 @@ def configure(env):
|
||||
if any(platform.machine() in s for s in list_of_x86):
|
||||
env["x86_libtheora_opt_gcc"] = True
|
||||
|
||||
if not env['builtin_libwebsockets']:
|
||||
env.ParseConfig('pkg-config libwebsockets --cflags --libs')
|
||||
if not env['builtin_wslay']:
|
||||
env.ParseConfig('pkg-config libwslay --cflags --libs')
|
||||
|
||||
if not env['builtin_mbedtls']:
|
||||
# mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
|
||||
@@ -137,7 +137,7 @@ def configure(env):
|
||||
|
||||
if not env['builtin_miniupnpc']:
|
||||
# No pkgconfig file so far, hardcode default paths.
|
||||
env.Append(CPPPATH=["/system/develop/headers/x86/miniupnpc"])
|
||||
env.Prepend(CPPPATH=["/system/develop/headers/x86/miniupnpc"])
|
||||
env.Append(LIBS=["miniupnpc"])
|
||||
|
||||
# On Linux wchar_t should be 32-bits
|
||||
@@ -147,9 +147,8 @@ def configure(env):
|
||||
|
||||
## Flags
|
||||
|
||||
env.Append(CPPPATH=['#platform/haiku'])
|
||||
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
|
||||
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
|
||||
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
||||
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
||||
env.Prepend(CPPPATH=['#platform/haiku'])
|
||||
env.Append(CPPDEFINES=['UNIX_ENABLED', 'OPENGL_ENABLED', 'GLES_ENABLED'])
|
||||
env.Append(CPPDEFINES=['MEDIA_KIT_ENABLED'])
|
||||
env.Append(CPPDEFINES=['PTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
||||
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
10
os_haiku.cpp
10
os_haiku.cpp
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@@ -69,7 +69,7 @@ void OS_Haiku::run() {
|
||||
main_loop->finish();
|
||||
}
|
||||
|
||||
String OS_Haiku::get_name() {
|
||||
String OS_Haiku::get_name() const {
|
||||
return "Haiku";
|
||||
}
|
||||
|
||||
@@ -203,6 +203,10 @@ void OS_Haiku::set_cursor_shape(CursorShape p_shape) {
|
||||
//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
|
||||
}
|
||||
|
||||
OS::CursorShape OS_Haiku::get_cursor_shape() const {
|
||||
// TODO: implement get_cursor_shape
|
||||
}
|
||||
|
||||
void OS_Haiku::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
OS_Haiku();
|
||||
void run();
|
||||
|
||||
virtual String get_name();
|
||||
virtual String get_name() const;
|
||||
|
||||
virtual MainLoop *get_main_loop() const;
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
virtual Point2 get_mouse_position() const;
|
||||
virtual int get_mouse_button_state() const;
|
||||
virtual void set_cursor_shape(CursorShape p_shape);
|
||||
virtual CursorShape get_cursor_shape() const;
|
||||
virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
|
||||
|
||||
virtual int get_screen_count() const;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
Reference in New Issue
Block a user