summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorBil Bas (Spooner) <bil.bagpuss@gmail.com>2015-02-01 20:29:11 +0000
committerBil Bas (Spooner) <bil.bagpuss@gmail.com>2015-02-01 20:29:11 +0000
commit2c1a3dfed6f9a474ace9123b46edca77be548d3e (patch)
treee1cd0db9257a5a241a1db3906041dbb9c1295c74 /platform
parentaf7c8bdf236b7c572bc33a44e3bb64fecdaa99d9 (diff)
parent67d357191ff74b2cfc80015941363a97e7ee19fd (diff)
Merge branch 'master' of https://github.com/okamstudio/godot into add_sprintf
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py6
-rw-r--r--platform/android/globals/global_defaults.cpp2
-rw-r--r--platform/android/java_glue.cpp6
-rw-r--r--platform/android/os_android.cpp10
-rw-r--r--platform/iphone/SCsub2
-rw-r--r--platform/iphone/detect.py3
-rwxr-xr-xplatform/iphone/gl_view.mm4
-rw-r--r--platform/iphone/os_iphone.cpp8
-rw-r--r--platform/iphone/platform_config.h2
-rw-r--r--platform/isim/SCsub2
-rw-r--r--platform/nacl/os_nacl.cpp2
-rw-r--r--platform/osx/detect.py5
-rw-r--r--platform/osx/os_osx.h2
-rw-r--r--platform/osx/os_osx.mm94
-rw-r--r--platform/server/detect.py3
-rw-r--r--platform/windows/detect.py4
-rw-r--r--platform/windows/os_windows.cpp13
-rw-r--r--platform/windows/platform_config.h2
-rw-r--r--platform/x11/detect.py19
-rw-r--r--platform/x11/export/export.cpp2
-rw-r--r--platform/x11/os_x11.cpp9
-rw-r--r--platform/x11/platform_config.h2
22 files changed, 150 insertions, 52 deletions
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..0312d13644 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 ));
@@ -821,10 +822,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 <alloca.h>
#define GLES2_INCLUDE_H <ES2/gl.h>
-#define GLES1_INCLUDE_H <ES1/gl.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/osx/detect.py b/platform/osx/detect.py
index 1b32838525..5703cbc546 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -78,12 +78,15 @@ 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'])
env["CC"]="clang"
env["LD"]="clang++"
+ if (env["colored"]=="yes"):
+ if sys.stdout.isatty():
+ env.Append(CPPFLAGS=["-fcolor-diagnostics"])
import methods
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..5bc47a74c1 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 <Cocoa/Cocoa.h>
+
+#include <Carbon/Carbon.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
@@ -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,83 @@ 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<length; ++i) {
+
+ UInt32 keysDown = 0;
+ UniChar chars[4];
+ UniCharCount realLength;
+
+ err = UCKeyTranslate(keyboardLayout,
+ keyCode[i],
+ kUCKeyActionDisplay,
+ 0,
+ LMGetKbdType(),
+ kUCKeyTranslateNoDeadKeysBit,
+ &keysDown,
+ sizeof(chars) / sizeof(chars[0]),
+ &realLength,
+ chars);
+
+ if (err != noErr) {
+ CFRelease(output);
+ return nil;
+ }
+
+ CFStringAppendCharacters(output, chars, 1);
+ }
+
+ //CFStringUppercase(output, NULL);
+
+ return (NSString *)output;
+}
+OS::LatinKeyboardVariant OS_OSX::get_latin_keyboard_variant() const {
+
+ static LatinKeyboardVariant layout = LATIN_KEYBOARD_QWERTY;
+
+ if (keyboard_layout_dirty) {
+
+ layout = LATIN_KEYBOARD_QWERTY;
+
+ CGKeyCode keys[] = {kVK_ANSI_Q, kVK_ANSI_W, kVK_ANSI_E, kVK_ANSI_R, kVK_ANSI_T, kVK_ANSI_Y};
+ NSString *test = createStringForKeys(keys, 6);
+
+ if ([test isEqualToString:@"qwertz"]) {
+ layout = LATIN_KEYBOARD_QWERTZ;
+ } else if ([test isEqualToString:@"azerty"]) {
+ layout = LATIN_KEYBOARD_AZERTY;
+ } else if ([test isEqualToString:@"qzerty"]) {
+ layout = LATIN_KEYBOARD_QZERTY;
+ } else if ([test isEqualToString:@"',.pyf"]) {
+ layout = LATIN_KEYBOARD_DVORAK;
+ } else if ([test isEqualToString:@"xvlcwk"]) {
+ layout = LATIN_KEYBOARD_NEO;
+ }
+
+ [test release];
+
+ keyboard_layout_dirty = false;
+ return layout;
+ }
+
+ return layout;
+}
void OS_OSX::process_events() {
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/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..4fa061886d 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"
@@ -56,6 +56,13 @@
#include "shlobj.h"
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
@@ -130,11 +137,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 "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 <alloca.h>
//#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..5171bc972d 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():
@@ -81,6 +82,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"])
@@ -115,14 +119,15 @@ 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(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/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<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>( 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");
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 <stdio.h>
@@ -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"
+