summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKarroffel <therzog@mail.de>2017-04-03 16:11:38 +0200
committerKarroffel <therzog@mail.de>2017-04-03 17:20:11 +0200
commitfd553087867187220d4f6b8217854dd8e9be2667 (patch)
treeba4c8b2611b1a574056e2f4ae694f18b737ee0e6 /platform
parent67f59bc2d9e2ce5faa9507017d49827753981e1e (diff)
added dlscript module
This module was written by bojidar-bg and me, with the help of ClikCode and touilleMan. This adds a module to Godot that enables the use of dynamic libraries as a source for scripts. That also allows third party libraries to be linked to Godot more easily and without creating modules. For a readme see https://github.com/GodotNativeTools/godot_headers/blob/master/README.md
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp12
-rw-r--r--platform/windows/os_windows.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 75dc2ef696..cfc97d57da 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1582,8 +1582,8 @@ bool OS_Windows::get_borderless_window() {
return video_mode.borderless_window;
}
-Error 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) {
+ p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data());
if (!p_library_handle) {
ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError()));
ERR_FAIL_V(ERR_CANT_OPEN);
@@ -1591,16 +1591,16 @@ Error open_dynamic_library(const String p_path, void* &p_library_handle) {
return OK;
}
-Error close_dynamic_library(void* p_library_handle) {
- if (!FreeLibrary((HMODULE) p_library_handle)) {
+Error OS_Windows::close_dynamic_library(void *p_library_handle) {
+ if (!FreeLibrary((HMODULE)p_library_handle)) {
return FAILED;
}
return OK;
}
-Error get_dynamic_library_symbol_handle(void* p_library_handle, const String p_name, void* &p_symbol_handle) {
+Error OS_Windows::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) {
char *error;
- p_symbol_handle = (void *) GetProcAddress((HMODULE) p_library_handle, p_name.utf8().get_data());
+ p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data());
if (!p_symbol_handle) {
ERR_EXPLAIN("Can't resolve symbol " + p_name + ". Error: " + String::num(GetLastError()));
ERR_FAIL_V(ERR_CANT_RESOLVE);
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index ed197b7685..050067ad7d 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -222,9 +222,9 @@ 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 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);
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle);
+ 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);
virtual MainLoop *get_main_loop() const;