From d046bd88ad84f99789fbc7e544e8c8b929f14faf Mon Sep 17 00:00:00 2001 From: Rhody Lugo Date: Thu, 8 Jan 2015 02:56:27 -0430 Subject: OS X: Add keyboard layout detection and fix build --- platform/osx/detect.py | 2 +- platform/osx/os_osx.h | 2 ++ platform/osx/os_osx.mm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 1b32838525..141a876657 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -78,7 +78,7 @@ def configure(env): env.Append(LIBS=['pthread']) #env.Append(CPPFLAGS=['-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-mmacosx-version-min=10.4']) #env.Append(LINKFLAGS=['-mmacosx-version-min=10.4', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk']) - env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit','-lz']) + env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit','-lz']) if (env["CXX"]=="clang++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 5df85bca2a..24f7115938 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -156,6 +156,8 @@ public: virtual String get_executable_path() const; + virtual LatinKeyboardVariant get_latin_keyboard_variant() const; + virtual void move_window_to_foreground(); void run(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 1703ae4c49..f8902283c6 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -27,6 +27,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #import + +#include #include #include #include @@ -835,11 +837,24 @@ void OS_OSX::initialize_core() { } +static bool keyboard_layout_dirty = true; +static void keyboardLayoutChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { + keyboard_layout_dirty = true; +} + void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio_driver) { /*** OSX INITIALIZATION ***/ /*** OSX INITIALIZATION ***/ /*** OSX INITIALIZATION ***/ + + keyboard_layout_dirty = true; + + // Register to be notified on keyboard layout changes + CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), + NULL, keyboardLayoutChanged, + kTISNotifySelectedKeyboardInputSourceChanged, NULL, + CFNotificationSuspensionBehaviorDeliverImmediately); window_delegate = [[GodotWindowDelegate alloc] init]; @@ -1007,6 +1022,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi } void OS_OSX::finalize() { + CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL); + } void OS_OSX::set_main_loop( MainLoop * p_main_loop ) { @@ -1241,6 +1258,85 @@ String OS_OSX::get_executable_path() const { } +// Returns string representation of keys, if they are printable. +// +static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) { + + TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource(); + if (!currentKeyboard) + return nil; + + CFDataRef layoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData); + if (!layoutData) + return nil; + + const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout *)CFDataGetBytePtr(layoutData); + + OSStatus err; + CFMutableStringRef output = CFStringCreateMutable(NULL, 0); + + for (int i=0; i Date: Thu, 8 Jan 2015 10:31:10 -0430 Subject: Create the test string to detect kb layouts directly from the unicode chars --- platform/osx/os_osx.mm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index f8902283c6..5bc47a74c1 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1297,9 +1297,7 @@ static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) { return nil; } - CFStringRef chararter = CFStringCreateWithCharacters(kCFAllocatorDefault, chars, 1); - CFStringAppend(output, chararter); - CFRelease(chararter); + CFStringAppendCharacters(output, chars, 1); } //CFStringUppercase(output, NULL); -- cgit v1.2.3 From 89970848311ee2d49040a148a56d80590091877c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 10 Jan 2015 17:35:26 -0300 Subject: 2D Rewrite Step [1] -=-=-=-=-=-=-=-=-=- -Moved drawing code to a single function that takes linked list (should make it easier to optimize in the future). -Implemented Z ordering of 2D nodes. Node2D and those that inherit have a visibility/Z property that affects drawing order (besides the tree order) -Removed OpenGL ES 1.x support. Good riddance! --- platform/android/detect.py | 6 +++--- platform/android/globals/global_defaults.cpp | 2 +- platform/android/java_glue.cpp | 5 +---- platform/android/os_android.cpp | 10 +++++----- platform/iphone/SCsub | 2 -- platform/iphone/detect.py | 3 +-- platform/iphone/gl_view.mm | 4 ---- platform/iphone/os_iphone.cpp | 8 ++------ platform/iphone/platform_config.h | 2 +- platform/isim/SCsub | 2 -- platform/nacl/os_nacl.cpp | 2 +- platform/windows/detect.py | 4 ++-- platform/windows/os_windows.cpp | 6 +++--- platform/windows/platform_config.h | 2 +- platform/x11/detect.py | 2 +- platform/x11/os_x11.cpp | 9 ++++----- platform/x11/platform_config.h | 2 +- 17 files changed, 27 insertions(+), 44 deletions(-) (limited to 'platform') diff --git a/platform/android/detect.py b/platform/android/detect.py index 695caf1e5d..4cf12538db 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -124,11 +124,11 @@ def configure(env): # env['CCFLAGS'] = string.split('-DNO_THREADS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED ') if env['x86']=='yes': - env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED -DGLES1_ENABLED') + env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED') elif env["armv6"]!="no": - env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=softfp -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED -DGLES1_ENABLED') + env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=softfp -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED') else: - env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED -DGLES1_ENABLED') + env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED') env.Append(LDPATH=[ld_path]) env.Append(LIBS=['OpenSLES']) diff --git a/platform/android/globals/global_defaults.cpp b/platform/android/globals/global_defaults.cpp index 84a586d22d..824a4e3606 100644 --- a/platform/android/globals/global_defaults.cpp +++ b/platform/android/globals/global_defaults.cpp @@ -10,5 +10,5 @@ void register_android_global_defaults() { GLOBAL_DEF("display.Android/driver","GLES2"); // GLOBAL_DEF("rasterizer.Android/trilinear_mipmap_filter",false); - Globals::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2")); + Globals::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2")); } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 3d3ba5d276..89a9091baa 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -821,10 +821,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, String vd = Globals::get_singleton()->get("display/driver"); - if (vd.to_upper()=="GLES1") - env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean)false); - else - env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean)true); + env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean)true); __android_log_print(ANDROID_LOG_INFO,"godot","**START"); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 833de059f7..6f1c03b593 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "os_android.h" #include "drivers/gles2/rasterizer_gles2.h" -#include "drivers/gles1/rasterizer_gles1.h" + #include "core/io/file_access_buffered_fa.h" #include "drivers/unix/file_access_unix.h" #include "drivers/unix/dir_access_unix.h" @@ -49,11 +49,11 @@ int OS_Android::get_video_driver_count() const { - return 2; + return 1; } const char * OS_Android::get_video_driver_name(int p_driver) const { - return p_driver==0?"GLES2":"GLES1"; + return "GLES2"; } OS::VideoMode OS_Android::get_default_video_mode() const { @@ -123,13 +123,13 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_ AudioDriverManagerSW::add_driver(&audio_driver_android); - if (use_gl2) { + if (true) { RasterizerGLES2 *rasterizer_gles22=memnew( RasterizerGLES2(false,use_reload_hooks,false,use_reload_hooks ) ); if (gl_extensions) rasterizer_gles22->set_extensions(gl_extensions); rasterizer = rasterizer_gles22; } else { - rasterizer = memnew( RasterizerGLES1(use_reload_hooks, use_reload_hooks) ); + //rasterizer = memnew( RasterizerGLES1(use_reload_hooks, use_reload_hooks) ); } diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index 9fc90bc84e..d495e3b5fc 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -25,8 +25,6 @@ env_ios = env.Clone(); if env['ios_gles22_override'] == "yes": env_ios.Append(CPPFLAGS=['-DGLES2_OVERRIDE']) -if env['ios_GLES1_override'] == "yes": - env_ios.Append(CPPFLAGS=['-DGLES1_OVERRIDE']) if env['ios_appirater'] == "yes": env_ios.Append(CPPFLAGS=['-DAPPIRATER_ENABLED']) diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index f8d86a3c7a..fb57876a83 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -26,7 +26,6 @@ def get_opts(): ('game_center', 'Support for game center', 'yes'), ('store_kit', 'Support for in-app store', 'yes'), ('ios_gles22_override', 'Force GLES2.0 on iOS', 'yes'), - ('ios_GLES1_override', 'Force legacy GLES (1.1) on iOS', 'no'), ('ios_appirater', 'Enable Appirater', 'no'), ('ios_exceptions', 'Use exceptions when compiling on playbook', 'yes'), ] @@ -130,7 +129,7 @@ def configure(env): env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' - env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES1_ENABLED', '-DMPC_FIXED_POINT']) + env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT']) if env['ios_exceptions'] == 'yes': env.Append(CPPFLAGS=['-fexceptions']) else: diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 4dd2084c20..bee01d3c72 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -307,11 +307,7 @@ static void clear_touches() { nil]; // Create our EAGLContext, and if successful make it current and create our framebuffer. -#ifdef GLES1_OVERRIDE - context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; -#else context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; -#endif if(!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer]) { diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 812879d427..aee5f76684 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -31,7 +31,7 @@ #include "os_iphone.h" #include "drivers/gles2/rasterizer_gles2.h" -#include "drivers/gles1/rasterizer_gles1.h" + #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" @@ -52,7 +52,7 @@ int OSIPhone::get_video_driver_count() const { const char * OSIPhone::get_video_driver_name(int p_driver) const { - return "openglES"; + return "GLES2"; }; OSIPhone* OSIPhone::get_singleton() { @@ -106,13 +106,9 @@ void OSIPhone::initialize(const VideoMode& p_desired,int p_video_driver,int p_au supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical", false)?1:0) << PortraitDown); supported_orientations |= ((GLOBAL_DEF("video_mode/allow_vertical_flipped", false)?1:0) << PortraitUp); -#ifdef GLES1_OVERRIDE - rasterizer = memnew( RasterizerGLES1 ); -#else rasterizer_gles22 = memnew( RasterizerGLES2(false, false, false) ); rasterizer = rasterizer_gles22; rasterizer_gles22->set_base_framebuffer(gl_view_base_fb); -#endif visual_server = memnew( VisualServerRaster(rasterizer) ); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { diff --git a/platform/iphone/platform_config.h b/platform/iphone/platform_config.h index 7e961176d9..3d6300d8e0 100644 --- a/platform/iphone/platform_config.h +++ b/platform/iphone/platform_config.h @@ -28,6 +28,6 @@ /*************************************************************************/ #include #define GLES2_INCLUDE_H -#define GLES1_INCLUDE_H + #define PLATFORM_REFCOUNT diff --git a/platform/isim/SCsub b/platform/isim/SCsub index 07761486a9..2bd65cb49b 100644 --- a/platform/isim/SCsub +++ b/platform/isim/SCsub @@ -25,8 +25,6 @@ env_ios = env.Clone(); if env['ios_gles22_override'] == "yes": env_ios.Append(CPPFLAGS=['-DGLES2_OVERRIDE']) -if env['ios_GLES1_override'] == "yes": - env_ios.Append(CPPFLAGS=['-DGLES1_OVERRIDE']) if env['ios_appirater'] == "yes": env_ios.Append(CPPFLAGS=['-DAPPIRATER_ENABLED']) diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp index d97195c50d..65f66b0354 100644 --- a/platform/nacl/os_nacl.cpp +++ b/platform/nacl/os_nacl.cpp @@ -64,7 +64,7 @@ int OSNacl::get_video_driver_count() const { }; const char * OSNacl::get_video_driver_name(int p_driver) const { - return "gles2"; + return "GLES2"; }; OS::VideoMode OSNacl::get_default_video_mode() const { diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 245d6f1bd3..16dd695c59 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -113,7 +113,7 @@ def configure(env): env.Append(CCFLAGS=['/DTYPED_METHOD_BIND']) env.Append(CCFLAGS=['/DGLES2_ENABLED']) - env.Append(CCFLAGS=['/DGLES1_ENABLED']) + env.Append(CCFLAGS=['/DGLEW_ENABLED']) LIBS=['winmm','opengl32','dsound','kernel32','ole32','user32','gdi32', 'IPHLPAPI', 'wsock32', 'shell32','advapi32'] env.Append(LINKFLAGS=[p+env["LIBSUFFIX"] for p in LIBS]) @@ -228,7 +228,7 @@ def configure(env): env.Append(CCFLAGS=['-DWINDOWS_ENABLED','-mwindows']) env.Append(CPPFLAGS=['-DRTAUDIO_ENABLED']) - env.Append(CCFLAGS=['-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLEW_ENABLED']) + env.Append(CCFLAGS=['-DGLES2_ENABLED','-DGLEW_ENABLED']) env.Append(LIBS=['mingw32','opengl32', 'dsound', 'ole32', 'd3d9','winmm','gdi32','iphlpapi','wsock32','kernel32']) if (env["bits"]=="32" and env["mingw64_for_32"]!="yes"): diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a10152a025..a3a26ddb25 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "drivers/gles2/rasterizer_gles2.h" -#include "drivers/gles1/rasterizer_gles1.h" + #include "os_windows.h" #include "drivers/nedmalloc/memory_pool_static_nedmalloc.h" #include "drivers/unix/memory_pool_static_malloc.h" @@ -130,11 +130,11 @@ void RedirectIOToConsole() { int OS_Windows::get_video_driver_count() const { - return 2; + return 1; } const char * OS_Windows::get_video_driver_name(int p_driver) const { - return p_driver==0?"GLES2":"GLES1"; + return p_driver=="GLES2"; } OS::VideoMode OS_Windows::get_default_video_mode() const { diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h index 7bc3e42833..a7e7f9c370 100644 --- a/platform/windows/platform_config.h +++ b/platform/windows/platform_config.h @@ -31,5 +31,5 @@ //#include //#endif #define GLES2_INCLUDE_H "gl_context/glew.h" -#define GLES1_INCLUDE_H "gl_context/glew.h" + diff --git a/platform/x11/detect.py b/platform/x11/detect.py index dd5fa827ff..621a0c66a0 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -122,7 +122,7 @@ def configure(env): else: print("PulseAudio development libraries not found, disabling driver") - env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLES_OVER_GL']) + env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL']) env.Append(LIBS=['GL', 'GLU', 'pthread','asound','z']) #TODO detect linux/BSD! #env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index aa9e4c63c9..a40af8d2a9 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -28,7 +28,6 @@ /*************************************************************************/ #include "servers/visual/visual_server_raster.h" #include "drivers/gles2/rasterizer_gles2.h" -#include "drivers/gles1/rasterizer_gles1.h" #include "os_x11.h" #include "key_mapping_x11.h" #include @@ -63,11 +62,11 @@ int OS_X11::get_video_driver_count() const { - return 2; + return 1; } const char * OS_X11::get_video_driver_name(int p_driver) const { - return p_driver==0?"GLES2":"GLES1"; + return "GLES2"; } OS::VideoMode OS_X11::get_default_video_mode() const { @@ -166,10 +165,10 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) ); context_gl->initialize(); - if (p_video_driver == 0) { + if (true) { rasterizer = memnew( RasterizerGLES2 ); } else { - rasterizer = memnew( RasterizerGLES1 ); + //rasterizer = memnew( RasterizerGLES1 ); }; #endif diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index 21703969cc..f372f8c2cb 100644 --- a/platform/x11/platform_config.h +++ b/platform/x11/platform_config.h @@ -34,5 +34,5 @@ #endif #define GLES2_INCLUDE_H "gl_context/glew.h" -#define GLES1_INCLUDE_H "gl_context/glew.h" + -- cgit v1.2.3 From 66afddb3e8db03a675e744f74b07acc4db8f2aa1 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 11 Jan 2015 11:43:31 -0300 Subject: -Initial (untested) implementation of 2D shaders. Probably broken, will be fixed later. -fixed issue of opacity not working --- platform/windows/os_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a3a26ddb25..45d13da828 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -134,7 +134,7 @@ int OS_Windows::get_video_driver_count() const { } const char * OS_Windows::get_video_driver_name(int p_driver) const { - return p_driver=="GLES2"; + return "GLES2"; } OS::VideoMode OS_Windows::get_default_video_mode() const { -- cgit v1.2.3 From f9a4e6890bf5b21ae39c12f920e11005b07df9aa Mon Sep 17 00:00:00 2001 From: hurikhan Date: Mon, 12 Jan 2015 12:54:17 +0800 Subject: SCons: colored compilation --- platform/server/detect.py | 3 +++ platform/x11/detect.py | 3 +++ 2 files changed, 6 insertions(+) (limited to 'platform') diff --git a/platform/server/detect.py b/platform/server/detect.py index 24b36d3188..e2d64c6545 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -40,6 +40,9 @@ def configure(env): env["CC"]="clang" env["CXX"]="clang++" env["LD"]="clang++" + if (env["colored"]=="yes"): + if sys.stdout.isatty(): + env.Append(CXXFLAGS=["-fcolor-diagnostics"]) is64=sys.maxsize > 2**32 diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 621a0c66a0..2b38099a74 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -81,6 +81,9 @@ def configure(env): env.extra_suffix=".llvms" else: env.extra_suffix=".llvm" + if (env["colored"]=="yes"): + if sys.stdout.isatty(): + env.Append(CXXFLAGS=["-fcolor-diagnostics"]) -- cgit v1.2.3 From 067a0d0e640e5c478715b55cd2f6fec39bf21326 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Mon, 12 Jan 2015 14:04:25 +0800 Subject: osx support for llvm coloring added --- platform/osx/detect.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform') diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 141a876657..08784be810 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -84,6 +84,9 @@ def configure(env): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env["CC"]="clang" env["LD"]="clang++" + if (env["colored"]=="yes"): + if sys.stdout.isatty(): + env.Append(CXXFLAGS=["-fcolor-diagnostics"]) import methods -- cgit v1.2.3 From 928e068f71afed015bdf6851dad7d4f57f827ef6 Mon Sep 17 00:00:00 2001 From: hurikhan Date: Tue, 13 Jan 2015 12:54:23 +0800 Subject: -try fixing LLVM color diagnostic on osx --- platform/osx/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 08784be810..5703cbc546 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -86,7 +86,7 @@ def configure(env): env["LD"]="clang++" if (env["colored"]=="yes"): if sys.stdout.isatty(): - env.Append(CXXFLAGS=["-fcolor-diagnostics"]) + env.Append(CPPFLAGS=["-fcolor-diagnostics"]) import methods -- cgit v1.2.3 From 7c7ab30c4ef74f3e7a90ab6d23d69d545fac7cf3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 13 Jan 2015 11:22:56 -0300 Subject: fixes --- platform/android/java_glue.cpp | 1 + platform/x11/detect.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'platform') diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 3d3ba5d276..a6abbc22d5 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -205,6 +205,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { String name = _get_class_name(env, c, &array); //print_line("name is " + name + ", array "+Variant(array)); + print_line("ARGNAME: "+name); if (name == "java.lang.String") { return String::utf8(env->GetStringUTFChars( (jstring)obj, NULL )); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index dd5fa827ff..a4c06be447 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -47,6 +47,7 @@ def get_opts(): return [ ('use_llvm','Use llvm compiler','no'), ('use_sanitizer','Use llvm compiler sanitize address','no'), + ('pulseaudio','Detect & Use pulseaudio','yes'), ] def get_flags(): @@ -115,12 +116,13 @@ def configure(env): env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) env.Append(CPPFLAGS=["-DALSA_ENABLED"]) - if not os.system("pkg-config --exists libpulse-simple"): - print("Enabling PulseAudio") - env.Append(CPPFLAGS=["-DPULSEAUDIO_ENABLED"]) - env.ParseConfig('pkg-config --cflags --libs libpulse-simple') - else: - print("PulseAudio development libraries not found, disabling driver") + if (env["pulseaudio"]=="yes"): + if not os.system("pkg-config --exists libpulse-simple"): + print("Enabling PulseAudio") + env.Append(CPPFLAGS=["-DPULSEAUDIO_ENABLED"]) + env.ParseConfig('pkg-config --cflags --libs libpulse-simple') + else: + print("PulseAudio development libraries not found, disabling driver") env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLES_OVER_GL']) env.Append(LIBS=['GL', 'GLU', 'pthread','asound','z']) #TODO detect linux/BSD! -- cgit v1.2.3 From c2ffdb05d4bffd75fd28fb791882c14ec6758b8c Mon Sep 17 00:00:00 2001 From: Nathan Warden Date: Thu, 15 Jan 2015 13:00:33 -0500 Subject: Set the default Linux extension to nothing. --- platform/x11/export/export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index b17b92bccf..bed57fbe9f 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -11,7 +11,7 @@ void register_x11_exporter() { { Ref exporter = Ref( memnew(EditorExportPlatformPC) ); - exporter->set_binary_extension("bin"); + exporter->set_binary_extension(""); exporter->set_release_binary32("linux_x11_32_release"); exporter->set_debug_binary32("linux_x11_32_debug"); exporter->set_release_binary64("linux_x11_64_release"); -- cgit v1.2.3 From 726d379775b4c8e1fc2b72f0c35829cd3151c880 Mon Sep 17 00:00:00 2001 From: the_mech Date: Sat, 17 Jan 2015 02:48:35 +0100 Subject: added nvidia optimus enablement --- platform/windows/os_windows.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 45d13da828..ce79133664 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -56,6 +56,9 @@ #include "shlobj.h" static const WORD MAX_CONSOLE_LINES = 1500; +extern "C" { + _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +} //#define STDOUT_FILE -- cgit v1.2.3 From 9f61a4881e018508e1914ddbb4e7740c11f0a272 Mon Sep 17 00:00:00 2001 From: marynate Date: Sun, 18 Jan 2015 02:06:29 +0800 Subject: Fix mingw windows build error --- platform/windows/os_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index ce79133664..4fa061886d 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -57,7 +57,11 @@ static const WORD MAX_CONSOLE_LINES = 1500; extern "C" { +#ifdef _MSC_VER _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +#else + __attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001; +#endif } //#define STDOUT_FILE -- cgit v1.2.3