summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/detect.py16
-rw-r--r--platform/x11/os_x11.cpp10
-rw-r--r--platform/x11/os_x11.h3
3 files changed, 25 insertions, 4 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 09e16ad078..feaa2e598f 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -62,6 +62,7 @@ def get_opts():
EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')),
BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),
BoolVariable('touch', 'Enable touch events', True),
+ BoolVariable('execinfo', 'Use libexecinfo on systems where glibc is not available', False),
]
@@ -81,14 +82,22 @@ def configure(env):
if (env["target"] == "release"):
# -O3 -ffast-math is identical to -Ofast. We need to split it out so we can selectively disable
# -ffast-math in code for which it generates wrong results.
- env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
+ else: #optimize for size
+ env.Prepend(CCFLAGS=['-Os'])
+
if (env["debug_symbols"] == "yes"):
env.Prepend(CCFLAGS=['-g1'])
if (env["debug_symbols"] == "full"):
env.Prepend(CCFLAGS=['-g2'])
elif (env["target"] == "release_debug"):
- env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+ if (env["optimize"] == "speed"): #optimize for speed (default)
+ env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+ else: #optimize for size
+ env.Prepend(CCFLAGS=['-Os', '-DDEBUG_ENABLED'])
+
if (env["debug_symbols"] == "yes"):
env.Prepend(CCFLAGS=['-g1'])
if (env["debug_symbols"] == "full"):
@@ -276,6 +285,9 @@ def configure(env):
env.Append(LIBS=['dl'])
if (platform.system().find("BSD") >= 0):
+ env["execinfo"] = True
+
+ if env["execinfo"]:
env.Append(LIBS=['execinfo'])
## Cross-compilation
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 2adc8bfb50..af0e02173f 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -84,6 +84,10 @@ void OS_X11::initialize_core() {
OS_Unix::initialize_core();
}
+int OS_X11::get_current_video_driver() const {
+ return video_driver_index;
+}
+
Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
long im_event_mask = 0;
@@ -285,6 +289,8 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
} break;
}
+ video_driver_index = p_video_driver; // FIXME TODO - FIX IF DRIVER DETECTION HAPPENS AND GLES2 MUST BE USED
+
context_gl->set_use_vsync(current_videomode.use_vsync);
#endif
@@ -1825,8 +1831,8 @@ void OS_X11::process_xevents() {
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
}
#ifdef TOUCH_ENABLED
- // Grab touch devices to avoid OS gesture interference
- /*for (int i = 0; i < touch.devices.size(); ++i) {
+ // Grab touch devices to avoid OS gesture interference
+ /*for (int i = 0; i < touch.devices.size(); ++i) {
XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask);
}*/
#endif
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 8cab23fe63..b67bc824be 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -180,6 +180,7 @@ class OS_X11 : public OS_Unix {
CrashHandler crash_handler;
+ int video_driver_index;
int audio_driver_index;
unsigned int capture_idle;
bool maximized;
@@ -195,6 +196,8 @@ class OS_X11 : public OS_Unix {
Bool xrandr_ext_ok;
protected:
+ virtual int get_current_video_driver() const;
+
virtual void initialize_core();
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
virtual void finalize();