summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/SCsub2
-rw-r--r--platform/windows/detect.py33
-rw-r--r--platform/windows/os_windows.cpp18
-rw-r--r--platform/windows/os_windows.h7
-rw-r--r--platform/windows/platform_config.h4
5 files changed, 44 insertions, 20 deletions
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 914cee0fa1..e53eb7af34 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
Import('env')
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 0548b84cfa..a5b26930be 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -1,10 +1,11 @@
#
-# tested on | Windows native | Linux cross-compilation
-# ------------------------+-------------------+---------------------------
-# MSVS C++ 2010 Express | WORKS | n/a
-# Mingw-w64 | WORKS | WORKS
-# Mingw-w32 | WORKS | WORKS
-# MinGW | WORKS | untested
+# tested on | Windows native | Linux cross-compilation
+# ----------------------------+-------------------+---------------------------
+# MSVS C++ 2010 Express | WORKS | n/a
+# Visual C++ Build Tools 2015 | WORKS | n/a
+# Mingw-w64 | WORKS | WORKS
+# Mingw-w32 | WORKS | WORKS
+# MinGW | WORKS | untested
#
#####
# Notes about MSVS C++ :
@@ -12,6 +13,12 @@
# - MSVC2010-Express compiles to 32bits only.
#
#####
+# Note about Visual C++ Build Tools :
+#
+# - Visual C++ Build Tools is the standalone MSVC compiler :
+# http://landinghub.visualstudio.com/visual-cpp-build-tools
+#
+#####
# Notes about Mingw-w64 and Mingw-w32 under Windows :
#
# - both can be installed using the official installer :
@@ -78,7 +85,7 @@
#####
# TODO :
-#
+#
# - finish to cleanup this script to remove all the remains of previous hacks and workarounds
# - make it work with the Windows7 SDK that is supposed to enable 64bits compilation for MSVC2010-Express
# - confirm it works well with other Visual Studio versions.
@@ -102,7 +109,7 @@ def can_build():
if (os.name=="nt"):
#building natively on windows!
- if (os.getenv("VSINSTALLDIR")):
+ if ( methods.msvc_is_detected() ):
return True
else:
print("\nMSVC not detected, attempting Mingw.")
@@ -169,7 +176,7 @@ def get_opts():
def get_flags():
return [
- ('glew','yes'),
+ ('builtin_zlib', 'yes'),
('openssl','builtin'), #use builtin openssl
]
@@ -197,7 +204,7 @@ def configure(env):
env.Append(CPPPATH=['#platform/windows'])
env['is_mingw']=False
- if (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None):
+ if (os.name=="nt" and methods.msvc_is_detected() ):
#build using visual studio
env['ENV']['TMP'] = os.environ['TMP']
env.Append(CPPPATH=['#platform/windows/include'])
@@ -272,13 +279,13 @@ def configure(env):
# Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the propper command prompt
# that decide the architecture that is build for. Scons can only detect the os.getenviron (because vsvarsall.bat sets a lot of stuff for cl.exe to work with)
env["bits"]="32"
- env["x86_opt_vc"]=True
+ env["x86_libtheora_opt_vc"]=True
print "Detected MSVC compiler: "+compiler_version_str
# If building for 64bit architecture, disable assembly optimisations for 32 bit builds (theora as of writting)... vc compiler for 64bit can not compile _asm
if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"):
env["bits"]="64"
- env["x86_opt_vc"]=False
+ env["x86_libtheora_opt_vc"]=False
print "Compiled program architecture will be a 64 bit executable (forcing bits=64)."
elif (compiler_version_str=="x86" or compiler_version_str == "amd64_x86"):
print "Compiled program architecture will be a 32 bit executable. (forcing bits=32)."
@@ -358,7 +365,7 @@ def configure(env):
env['AR'] = mingw_prefix+"ar"
env['RANLIB'] = mingw_prefix+"ranlib"
env['LD'] = mingw_prefix+"g++"
- env["x86_opt_gcc"]=True
+ env["x86_libtheora_opt_gcc"]=True
#env['CC'] = "winegcc"
#env['CXX'] = "wineg++"
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index cebafdabce..38e738a414 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -29,7 +29,6 @@
#include "drivers/gles2/rasterizer_gles2.h"
#include "os_windows.h"
-#include "drivers/nedmalloc/memory_pool_static_nedmalloc.h"
#include "drivers/unix/memory_pool_static_malloc.h"
#include "os/memory_pool_dynamic_static.h"
#include "drivers/windows/thread_windows.h"
@@ -1312,10 +1311,13 @@ void OS_Windows::finalize_core() {
void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) {
- char buf[16384+1];
- int len = vsnprintf(buf,16384,p_format,p_list);
+ const unsigned int BUFFER_SIZE = 16384;
+ char buf[BUFFER_SIZE+1]; // +1 for the terminating character
+ int len = vsnprintf(buf,BUFFER_SIZE,p_format,p_list);
if (len<=0)
return;
+ if(len >= BUFFER_SIZE)
+ len = BUFFER_SIZE; // Output is too big, will be truncated
buf[len]=0;
@@ -2154,10 +2156,15 @@ String OS_Windows::get_stdin_string(bool p_block) {
}
+void OS_Windows::enable_for_stealing_focus(ProcessID pid) {
+
+ AllowSetForegroundWindow(pid);
+
+}
+
void OS_Windows::move_window_to_foreground() {
SetForegroundWindow(hWnd);
- BringWindowToTop(hWnd);
}
@@ -2411,6 +2418,9 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
#ifdef RTAUDIO_ENABLED
AudioDriverManagerSW::add_driver(&driver_rtaudio);
#endif
+#ifdef XAUDIO2_ENABLED
+ AudioDriverManagerSW::add_driver(&driver_xaudio2);
+#endif
}
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index e3e037e57b..903dd10c70 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -41,6 +41,9 @@
#include "servers/audio/audio_server_sw.h"
#include "servers/audio/sample_manager_sw.h"
#include "drivers/rtaudio/audio_driver_rtaudio.h"
+#ifdef XAUDIO2_ENABLED
+#include "drivers/xaudio2/audio_driver_xaudio2.h"
+#endif
#include "servers/spatial_sound/spatial_sound_server_sw.h"
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
#include "drivers/unix/ip_unix.h"
@@ -137,6 +140,9 @@ class OS_Windows : public OS {
#ifdef RTAUDIO_ENABLED
AudioDriverRtAudio driver_rtaudio;
#endif
+#ifdef XAUDIO2_ENABLED
+ AudioDriverXAudio2 driver_xaudio2;
+#endif
void _drag_event(int p_x, int p_y, int idx);
void _touch_event(bool p_pressed, int p_x, int p_y, int idx);
@@ -269,6 +275,7 @@ public:
virtual String get_locale() const;
virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
+ virtual void enable_for_stealing_focus(ProcessID pid);
virtual void move_window_to_foreground();
virtual String get_data_dir() const;
virtual String get_system_dir(SystemDir p_dir) const;
diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h
index 9e20750816..31512a1054 100644
--- a/platform/windows/platform_config.h
+++ b/platform/windows/platform_config.h
@@ -30,6 +30,4 @@
//#else
//#include <alloca.h>
//#endif
-#define GLES2_INCLUDE_H "gl_context/GL/glew.h"
-
-
+#define GLES2_INCLUDE_H "GL/glew.h"