mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Fix drivers coding for WinRT
- Add a proper function to retrieve IP addresses. - Solve issues with Windows FileAccess and DirAccess to use the same code for WinRT. - Add patches to the GLES2 rasterizer to workaround ANGLE issues.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
/*************************************************************************/
|
||||
#include "ip_unix.h"
|
||||
|
||||
#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) && !defined(WINRT_ENABLED)
|
||||
#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED)
|
||||
|
||||
|
||||
#ifdef WINDOWS_ENABLED
|
||||
@@ -83,6 +83,19 @@ IP_Address IP_Unix::_resolve_hostname(const String& p_hostname) {
|
||||
|
||||
void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
|
||||
|
||||
using namespace Windows::Networking;
|
||||
using namespace Windows::Networking::Connectivity;
|
||||
|
||||
auto hostnames = NetworkInformation::GetHostNames();
|
||||
|
||||
for (int i = 0; i < hostnames->Size; i++) {
|
||||
|
||||
if (hostnames->GetAt(i)->Type == HostNameType::Ipv4 && hostnames->GetAt(i)->IPInformation != nullptr) {
|
||||
|
||||
r_addresses->push_back(IP_Address(String(hostnames->GetAt(i)->CanonicalName->Data())));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user