diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/detect.py | 23 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 6 | ||||
-rw-r--r-- | platform/android/os_android.h | 2 | ||||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 4 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 1 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 5 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 2 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 5 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.h | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 10 | ||||
-rw-r--r-- | platform/server/os_server.cpp | 4 | ||||
-rw-r--r-- | platform/server/os_server.h | 1 | ||||
-rw-r--r-- | platform/uwp/detect.py | 2 | ||||
-rw-r--r-- | platform/uwp/gl_context_egl.cpp | 39 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 5 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 2 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 5 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 4 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 1 |
21 files changed, 29 insertions, 97 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 2666034ef7..966de832e8 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -2,6 +2,7 @@ import os import sys import string import platform +from distutils.version import LooseVersion def is_active(): @@ -25,8 +26,7 @@ def get_opts(): ('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"), EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')), BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True), - BoolVariable('android_stl', 'Enable Android STL support (for modules)', True), - BoolVariable('ndk_unified_headers', 'Enable NDK unified headers', True) + BoolVariable('android_stl', 'Enable Android STL support (for modules)', True) ] @@ -179,26 +179,22 @@ def configure(env): env['RANLIB'] = tools_path + "/ranlib" env['AS'] = tools_path + "/as" - ndk_unified_headers = env['ndk_unified_headers'] - ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) - common_opts = ['-fno-integrated-as', '-gcc-toolchain', gcc_toolchain_path] - if not ndk_unified_headers and ndk_version != None and ndk_version[0] >= 16: - ndk_unified_headers = True - print("Turning NDK unified headers on (starting from r16)") - lib_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + env['ndk_platform'] + "/" + env['ARCH'] ## Compile flags - if ndk_unified_headers: + ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"]) + if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"): + print("Using NDK unified headers") sysroot = env["ANDROID_NDK_ROOT"] + "/sysroot" env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"]) env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath]) # For unified headers this define has to be set manually env.Append(CPPFLAGS=["-D__ANDROID_API__=" + str(int(env['ndk_platform'].split("-")[1]))]) else: + print("Using NDK deprecated headers") env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"]) env.Append(CPPFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split()) @@ -266,8 +262,8 @@ def configure(env): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) env.opus_fixed_point = "yes" -# Return NDK version as [<major>,<minor>,<build>] or None if cannot be figured out (adapted from the Chromium project). -def get_ndk_version (path): +# Return NDK version string in source.properties (adapted from the Chromium project). +def get_ndk_version(path): if path == None: return None prop_file_path = os.path.join(path, "source.properties") @@ -276,8 +272,7 @@ def get_ndk_version (path): for line in prop_file: key_value = map(lambda x: string.strip(x), line.split("=")) if key_value[0] == "Pkg.Revision": - version_parts = key_value[1].split("-")[0].split(".") - return map(int, version_parts[0:3]) + return key_value[1] except: print("Could not read source prop file '%s'" % prop_file_path) return None diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 9d43adf788..970e0cdf68 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -65,12 +65,6 @@ const char *OS_Android::get_video_driver_name(int p_driver) const { return "GLES2"; } - -OS::VideoMode OS_Android::get_default_video_mode() const { - - return OS::VideoMode(); -} - int OS_Android::get_audio_driver_count() const { return 1; diff --git a/platform/android/os_android.h b/platform/android/os_android.h index d9a66b4e3a..fee91b9a55 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -141,8 +141,6 @@ public: 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 int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 7a681d46f7..0c34e39655 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -79,10 +79,6 @@ 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); -} - void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { main_loop = NULL; current_video_mode = p_desired; diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index 501650c94f..86148f1fb4 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -65,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(); diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 13e3b7670a..0685e961c3 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -62,11 +62,6 @@ OSIPhone *OSIPhone::get_singleton() { return (OSIPhone *)OS::get_singleton(); }; -OS::VideoMode OSIPhone::get_default_video_mode() const { - - return video_mode; -}; - uint8_t OSIPhone::get_orientations() const { return supported_orientations; diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index eccd294d63..6627fddf08 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -83,8 +83,6 @@ private: 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_logger(); virtual void initialize_core(); virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 3a57de2646..e5bdcec30d 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -64,11 +64,6 @@ const char *OS_JavaScript::get_video_driver_name(int p_driver) const { return "GLES3"; } -OS::VideoMode OS_JavaScript::get_default_video_mode() const { - - return OS::VideoMode(); -} - int OS_JavaScript::get_audio_driver_count() const { return 1; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 07720e95ec..f478f95dd2 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -83,8 +83,6 @@ public: 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 int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index fba53f61b6..53f45511f9 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -120,7 +120,6 @@ public: 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_logger(); virtual void initialize_core(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 78acc97676..6faa8e12ed 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -899,16 +899,6 @@ const char *OS_OSX::get_video_driver_name(int p_driver) const { return "GLES2"; } -OS::VideoMode OS_OSX::get_default_video_mode() const { - - VideoMode vm; - vm.width = 1024; - vm.height = 600; - vm.fullscreen = false; - vm.resizable = true; - return vm; -} - void OS_OSX::initialize_core() { crash_handler.initialize(); diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 80c04aa5ad..ca73f610e4 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -46,10 +46,6 @@ const char *OS_Server::get_video_driver_name(int p_driver) const { return "Dummy"; } -OS::VideoMode OS_Server::get_default_video_mode() const { - - return OS::VideoMode(800, 600, false); -} void OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 630c82ccdd..03f7c2a6c8 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -66,7 +66,6 @@ class OS_Server : public OS_Unix { 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(); diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index af53f97446..434c597449 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -84,7 +84,7 @@ def configure(env): ## Architecture arch = "" - if os.getenv('Platform') == "ARM": + if str(os.getenv('Platform')).lower() == "arm": print("Compiled program architecture will be an ARM executable. (forcing bits=32).") diff --git a/platform/uwp/gl_context_egl.cpp b/platform/uwp/gl_context_egl.cpp index ed3db65cdf..dafe5d5e25 100644 --- a/platform/uwp/gl_context_egl.cpp +++ b/platform/uwp/gl_context_egl.cpp @@ -101,26 +101,25 @@ Error ContextEGL::initialize() { try { - const EGLint displayAttributes[] = - { - /*EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, - EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, - EGL_NONE,*/ - // These are the default display attributes, used to request ANGLE's D3D11 renderer. - // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+. - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - - // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices. - // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it. - //EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - - // EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call - // the IDXGIDevice3::Trim method on behalf of the application when it gets suspended. - // Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement. - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, - EGL_NONE, - }; + const EGLint displayAttributes[] = { + /*EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, + EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, + EGL_NONE,*/ + // These are the default display attributes, used to request ANGLE's D3D11 renderer. + // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+. + EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + + // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices. + // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it. + //EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, + + // EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call + // the IDXGIDevice3::Trim method on behalf of the application when it gets suspended. + // Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement. + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + EGL_NONE, + }; PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT")); diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 8db2a749df..acb0ba4bca 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -72,11 +72,6 @@ const char *OSUWP::get_video_driver_name(int p_driver) const { return "GLES2"; } -OS::VideoMode OSUWP::get_default_video_mode() const { - - return video_mode; -} - Size2 OSUWP::get_window_size() const { Size2 size; size.width = video_mode.width; diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index e46e4cc020..2931e9b07d 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -154,8 +154,6 @@ 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 int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 01201beccb..0f62dbb9e8 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -146,11 +146,6 @@ const char *OS_Windows::get_video_driver_name(int p_driver) const { return "GLES2"; } -OS::VideoMode OS_Windows::get_default_video_mode() const { - - return VideoMode(1024, 600, false); -} - int OS_Windows::get_audio_driver_count() const { return AudioDriverManager::get_driver_count(); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index c9c00b5e36..fbd60e5f0d 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -142,8 +142,6 @@ 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 int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index fbcc22c58e..f018145d82 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -82,10 +82,6 @@ const char *OS_X11::get_video_driver_name(int p_driver) const { return "GLES3"; } -OS::VideoMode OS_X11::get_default_video_mode() const { - return OS::VideoMode(1024, 600, false); -} - int OS_X11::get_audio_driver_count() const { return AudioDriverManager::get_driver_count(); } diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index bfa8b5b375..0ea5bbfdb6 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -177,7 +177,6 @@ class OS_X11 : public OS_Unix { 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 int get_audio_driver_count() const; virtual const char *get_audio_driver_name(int p_driver) const; |