diff options
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/SCsub | 4 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 31 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 2 |
3 files changed, 25 insertions, 12 deletions
diff --git a/platform/windows/SCsub b/platform/windows/SCsub index aa9eb3e69b..5a253d5db5 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -28,7 +28,7 @@ obj = env.RES(restarget, 'godot_res.rc') common_win.append(obj) -binary = env.Program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) +prog = env.add_program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) # Microsoft Visual Studio Project Generation if env['vsproj']: @@ -38,4 +38,4 @@ if env['vsproj']: if not os.getenv("VCINSTALLDIR"): if env["debug_symbols"] == "full" or env["debug_symbols"] == "yes": - env.AddPostAction(binary, make_debug_mingw) + env.AddPostAction(prog, make_debug_mingw) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 284dfaf904..3bdc307c3a 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1044,12 +1044,6 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); } - if (!is_no_window_mode_enabled()) { - ShowWindow(hWnd, SW_SHOW); // Show The Window - SetForegroundWindow(hWnd); // Slightly Higher Priority - SetFocus(hWnd); // Sets Keyboard Focus To - } - /* DEVMODE dmScreenSettings; // Device Mode memset(&dmScreenSettings,0,sizeof(dmScreenSettings)); // Makes Sure Memory's Cleared @@ -1087,6 +1081,12 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int DragAcceptFiles(hWnd, true); move_timer_id = 1; + + if (!is_no_window_mode_enabled()) { + ShowWindow(hWnd, SW_SHOW); // Show The Window + SetForegroundWindow(hWnd); // Slightly Higher Priority + SetFocus(hWnd); // Sets Keyboard Focus To + } } void OS_Windows::set_clipboard(const String &p_text) { @@ -1588,8 +1588,21 @@ void OS_Windows::_update_window_style(bool repaint) { } } -Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle) { - p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data()); +Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { + + + DLL_DIRECTORY_COOKIE cookie; + + if (p_also_set_library_path) { + cookie = AddDllDirectory(p_path.get_base_dir().c_str()); + } + + p_library_handle = (void *)LoadLibraryExW(p_path.c_str(), NULL, p_also_set_library_path ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0); + + if (p_also_set_library_path) { + RemoveDllDirectory(cookie); + } + if (!p_library_handle) { ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError())); ERR_FAIL_V(ERR_CANT_OPEN); @@ -1954,7 +1967,7 @@ void OS_Windows::set_icon(const Ref<Image> &p_icon) { bool OS_Windows::has_environment(const String &p_var) const { - return getenv(p_var.utf8().get_data()) != NULL; + return _wgetenv(p_var.c_str()) != NULL; }; String OS_Windows::get_environment(const String &p_var) const { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 4367297262..e98f8277df 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -212,7 +212,7 @@ public: virtual void set_borderless_window(int p_borderless); virtual bool get_borderless_window(); - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle); + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle,bool p_also_set_library_path=false); virtual Error close_dynamic_library(void *p_library_handle); virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false); |