summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-01 08:42:57 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-12-01 08:45:36 -0300
commit0243803117b2a67a33a9e01cf97e79ea4cf48c54 (patch)
treef17c3f1bc5905dda81c04808f83a0a374493cdda /platform/windows
parentd81c5004b1eb7e2041e18e8f4af1a6ac38be3fce (diff)
Properly take into consideration that VERTEX must be written to in opaque pre pass, does some speed up to scenes using triplanar.
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/os_windows.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 3bdc307c3a..9bcbb6ddb6 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -69,8 +69,26 @@ __attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001;
#define WM_TOUCH 576
#endif
+static String format_error_message(DWORD id) {
+
+ LPWSTR messageBuffer = NULL;
+ size_t size = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0, NULL);
+
+ String msg = "Error "+itos(id)+": "+String(messageBuffer,size);
+
+ LocalFree(messageBuffer);
+
+ return msg;
+
+}
+
+
+
extern HINSTANCE godot_hinstance;
+
+
void RedirectIOToConsole() {
int hConHandle;
@@ -1604,7 +1622,7 @@ Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_han
}
if (!p_library_handle) {
- ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError()));
+ ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + format_error_message(GetLastError()));
ERR_FAIL_V(ERR_CANT_OPEN);
}
return OK;