diff options
Diffstat (limited to 'platform/haiku')
-rw-r--r-- | platform/haiku/context_gl_haiku.cpp | 2 | ||||
-rw-r--r-- | platform/haiku/context_gl_haiku.h | 2 | ||||
-rw-r--r-- | platform/haiku/detect.py | 2 | ||||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 60 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 11 |
5 files changed, 47 insertions, 30 deletions
diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp index 2b943df5ba..80d0bd78d5 100644 --- a/platform/haiku/context_gl_haiku.cpp +++ b/platform/haiku/context_gl_haiku.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "context_gl_haiku.h" -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow *p_window) { window = p_window; diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h index 40daf43ab9..a9a13a2b7f 100644 --- a/platform/haiku/context_gl_haiku.h +++ b/platform/haiku/context_gl_haiku.h @@ -30,7 +30,7 @@ #ifndef CONTEXT_GL_HAIKU_H #define CONTEXT_GL_HAIKU_H -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) #include "drivers/gl_context/context_gl.h" diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index 50f9783dd2..7c62654ef6 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -67,7 +67,7 @@ def configure(env): ## Flags env.Append(CPPPATH=['#platform/haiku']) - env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL']) + env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED', '-DGLES_OVER_GL']) 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 diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 9f2f88bb4e..ef5a065107 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -76,11 +76,7 @@ int OS_Haiku::get_video_driver_count() const { } const char *OS_Haiku::get_video_driver_name(int p_driver) const { - return "GLES2"; -} - -OS::VideoMode OS_Haiku::get_default_video_mode() const { - return OS::VideoMode(800, 600, false); + return "GLES3"; } void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { @@ -105,12 +101,14 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ window->SetFlags(flags); } -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) context_gl = memnew(ContextGL_Haiku(window)); context_gl->initialize(); context_gl->make_current(); - rasterizer = memnew(RasterizerGLES2); + /* Port to GLES 3 rasterizer */ + //rasterizer = memnew(RasterizerGLES2); + #endif visual_server = memnew(VisualServerRaster(rasterizer)); @@ -130,13 +128,6 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ window->Show(); visual_server->init(); - physics_server = memnew(PhysicsServerSW); - physics_server->init(); - physics_2d_server = memnew(Physics2DServerSW); - // TODO: enable multithreaded PS - //physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>(); - physics_2d_server->init(); - AudioDriverManager::initialize(p_audio_driver); power_manager = memnew(PowerHaiku); @@ -153,15 +144,9 @@ void OS_Haiku::finalize() { memdelete(visual_server); memdelete(rasterizer); - physics_server->finish(); - memdelete(physics_server); - - physics_2d_server->finish(); - memdelete(physics_2d_server); - memdelete(input); -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) memdelete(context_gl); #endif } @@ -331,3 +316,36 @@ bool OS_Haiku::_check_internal_feature_support(const String &p_feature) { return p_feature == "pc" || p_feature == "s3tc"; } + +String OS_Haiku::get_config_path() const { + + if (has_environment("XDG_CONFIG_HOME")) { + return get_environment("XDG_CONFIG_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".config"); + } else { + return "."; + } +} + +String OS_Haiku::get_data_path() const { + + if (has_environment("XDG_DATA_HOME")) { + return get_environment("XDG_DATA_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".local/share"); + } else { + return get_config_path(); + } +} + +String OS_Haiku::get_cache_path() const { + + if (has_environment("XDG_CACHE_HOME")) { + return get_environment("XDG_CACHE_HOME"); + } else if (has_environment("HOME")) { + return get_environment("HOME").plus_file(".cache"); + } else { + return get_config_path(); + } +} diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index d2fafb9129..4ee54fb48d 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -38,8 +38,6 @@ #include "main/input_default.h" #include "power_haiku.h" #include "servers/audio_server.h" -#include "servers/physics_2d/physics_2d_server_sw.h" -#include "servers/physics_server.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -52,15 +50,13 @@ private: Rasterizer *rasterizer; VisualServer *visual_server; VideoMode current_video_mode; - PhysicsServer *physics_server; - Physics2DServer *physics_2d_server; PowerHaiku *power_manager; #ifdef MEDIA_KIT_ENABLED AudioDriverMediaKit driver_media_kit; #endif -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_Haiku *context_gl; #endif @@ -69,7 +65,6 @@ private: 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(); @@ -122,6 +117,10 @@ public: virtual int get_power_percent_left(); virtual bool _check_internal_feature_support(const String &p_feature); + + virtual String get_config_path() const; + virtual String get_data_path() const; + virtual String get_cache_path() const; }; #endif |