diff --git a/project/Build.xml b/project/Build.xml
index d79d04e9b..efc1c53a9 100644
--- a/project/Build.xml
+++ b/project/Build.xml
@@ -10,7 +10,7 @@
-
+
@@ -18,11 +18,11 @@
-
+
-
+
@@ -34,7 +34,8 @@
-
+
+
@@ -227,12 +228,14 @@
@@ -394,7 +397,12 @@
-
+
+
+
+
+
+
diff --git a/project/include/system/System.h b/project/include/system/System.h
index 9336b5d74..79a5a3f11 100644
--- a/project/include/system/System.h
+++ b/project/include/system/System.h
@@ -42,13 +42,13 @@ namespace lime {
static std::wstring* GetPlatformName ();
static std::wstring* GetPlatformVersion ();
static double GetTimer ();
- #ifdef HX_WINDOWS
+ #if defined(HX_WINDOWS) && !defined (HX_WINRT)
static int GetWindowsConsoleMode (int handleType);
#endif
static void OpenFile (const char* path);
static void OpenURL (const char* url, const char* target);
static bool SetAllowScreenTimeout (bool allow);
- #ifdef HX_WINDOWS
+ #if defined(HX_WINDOWS) && !defined (HX_WINRT)
static bool SetWindowsConsoleMode (int handleType, int mode);
#endif
diff --git a/project/lib/freetype b/project/lib/freetype
index e3d968b0b..9f3065663 160000
--- a/project/lib/freetype
+++ b/project/lib/freetype
@@ -1 +1 @@
-Subproject commit e3d968b0bd1e6c53c46b665ac7bef5bdaa9eb6a5
+Subproject commit 9f306566315a7853c525e70eb667ec36c3b7391e
diff --git a/project/lib/sdl b/project/lib/sdl
index 2d67dc5e4..c0b93d999 160000
--- a/project/lib/sdl
+++ b/project/lib/sdl
@@ -1 +1 @@
-Subproject commit 2d67dc5e467179860e0acf6d18c01e96778f4f70
+Subproject commit c0b93d999463eeb6ba655f5bbe6a5820e866bf06
diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp
index 4bae1b0bf..ee719b986 100644
--- a/project/src/ExternalInterface.cpp
+++ b/project/src/ExternalInterface.cpp
@@ -2927,7 +2927,7 @@ namespace lime {
int lime_system_get_windows_console_mode (int handleType) {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return System::GetWindowsConsoleMode (handleType);
#else
return 0;
@@ -2938,7 +2938,7 @@ namespace lime {
HL_PRIM int hl_lime_system_get_windows_console_mode (int handleType) {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return System::GetWindowsConsoleMode (handleType);
#else
return 0;
@@ -2999,7 +2999,7 @@ namespace lime {
bool lime_system_set_windows_console_mode (int handleType, int mode) {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return System::SetWindowsConsoleMode (handleType, mode);
#else
return false;
@@ -3010,7 +3010,7 @@ namespace lime {
HL_PRIM bool hl_lime_system_set_windows_console_mode (int handleType, int mode) {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return System::SetWindowsConsoleMode (handleType, mode);
#else
return false;
diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp
index f2a6f0cb0..c41a0c647 100644
--- a/project/src/backend/sdl/SDLSystem.cpp
+++ b/project/src/backend/sdl/SDLSystem.cpp
@@ -133,8 +133,8 @@ namespace lime {
#if defined (HX_WINRT)
- Windows::Storage::StorageFolder folder = Windows::Storage::KnownFolders::HomeGroup;
- result = new std::wstring (folder->Begin ());
+ Windows::Storage::StorageFolder^ folder = Windows::Storage::KnownFolders::HomeGroup;
+ result = new std::wstring (folder->Path->Data ());
#elif defined (HX_WINDOWS)
@@ -170,8 +170,8 @@ namespace lime {
#if defined (HX_WINRT)
- Windows::Storage::StorageFolder folder = Windows::Storage::KnownFolders::DocumentsLibrary;
- result = std::wstring (folder->Begin ());
+ Windows::Storage::StorageFolder^ folder = Windows::Storage::KnownFolders::DocumentsLibrary;
+ result = new std::wstring (folder->Path->Data ());
#elif defined (HX_WINDOWS)
@@ -248,8 +248,8 @@ namespace lime {
#if defined (HX_WINRT)
- Windows::Storage::StorageFolder folder = Windows::Storage::ApplicationData::Current->RoamingFolder;
- result = new std::wstring (folder->Begin ());
+ Windows::Storage::StorageFolder^ folder = Windows::Storage::ApplicationData::Current->RoamingFolder;
+ result = new std::wstring (folder->Path->Data ());
#elif defined (HX_WINDOWS)
diff --git a/project/src/backend/sdl/SDLWindow.cpp b/project/src/backend/sdl/SDLWindow.cpp
index dd8e02c78..36e2c3711 100644
--- a/project/src/backend/sdl/SDLWindow.cpp
+++ b/project/src/backend/sdl/SDLWindow.cpp
@@ -56,7 +56,7 @@ namespace lime {
if (flags & WINDOW_FLAG_ALWAYS_ON_TOP) sdlWindowFlags |= SDL_WINDOW_ALWAYS_ON_TOP;
#endif
- #if defined (HX_WINDOWS) && defined (NATIVE_TOOLKIT_SDL_ANGLE)
+ #if defined (HX_WINDOWS) && defined (NATIVE_TOOLKIT_SDL_ANGLE) && !defined (HX_WINRT)
OSVERSIONINFOEXW osvi = { sizeof (osvi), 0, 0, 0, 0, {0}, 0, 0 };
DWORDLONG const dwlConditionMask = VerSetConditionMask (VerSetConditionMask (VerSetConditionMask (0, VER_MAJORVERSION, VER_GREATER_EQUAL), VER_MINORVERSION, VER_GREATER_EQUAL), VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
osvi.dwMajorVersion = HIBYTE (_WIN32_WINNT_VISTA);
@@ -164,7 +164,7 @@ namespace lime {
}
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
HINSTANCE handle = ::GetModuleHandle (nullptr);
HICON icon = ::LoadIcon (handle, MAKEINTRESOURCE (1));
@@ -309,7 +309,7 @@ namespace lime {
void SDLWindow::Alert (const char* message, const char* title) {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
int count = 0;
int speed = 0;
diff --git a/project/src/graphics/opengl/OpenGLBindings.cpp b/project/src/graphics/opengl/OpenGLBindings.cpp
index 4221666a9..120863af1 100644
--- a/project/src/graphics/opengl/OpenGLBindings.cpp
+++ b/project/src/graphics/opengl/OpenGLBindings.cpp
@@ -5311,6 +5311,9 @@ namespace lime {
#ifdef NATIVE_TOOLKIT_SDL_ANGLE
+ #ifdef HX_WINRT
+ return true;
+ #else
OpenGLBindings::eglHandle = LoadLibraryW (L"libegl.dll");
if (!OpenGLBindings::eglHandle) {
@@ -5319,6 +5322,7 @@ namespace lime {
return result;
}
+ #endif
#endif
diff --git a/project/src/system/System.cpp b/project/src/system/System.cpp
index 019e84832..3b279027c 100644
--- a/project/src/system/System.cpp
+++ b/project/src/system/System.cpp
@@ -42,7 +42,7 @@ namespace lime {
}
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
std::wstring* GetWMIValue (BSTR query, BSTR field) {
HRESULT hres = 0;
@@ -139,7 +139,7 @@ namespace lime {
std::wstring* System::GetDeviceModel () {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_ComputerSystemProduct"), L"Version");
#endif
@@ -150,7 +150,7 @@ namespace lime {
std::wstring* System::GetDeviceVendor () {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_ComputerSystemProduct"), L"Vendor");
#endif
@@ -161,7 +161,7 @@ namespace lime {
std::wstring* System::GetPlatformLabel () {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_OperatingSystem"), L"Caption");
#endif
@@ -179,7 +179,7 @@ namespace lime {
std::wstring* System::GetPlatformVersion () {
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
return GetWMIValue (bstr_t ("SELECT * FROM Win32_OperatingSystem"), L"Version");
#endif
@@ -188,7 +188,7 @@ namespace lime {
}
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
int System::GetWindowsConsoleMode (int handleType) {
HANDLE handle = GetStdHandle ((DWORD)handleType);
@@ -206,7 +206,7 @@ namespace lime {
#endif
- #ifdef HX_WINDOWS
+ #if defined (HX_WINDOWS) && !defined (HX_WINRT)
bool System::SetWindowsConsoleMode (int handleType, int mode) {
HANDLE handle = GetStdHandle ((DWORD)handleType);
diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp
index 6f5f261c7..ed6e95592 100644
--- a/project/src/text/Font.cpp
+++ b/project/src/text/Font.cpp
@@ -16,6 +16,10 @@
#include FT_OUTLINE_H
#endif
+#ifdef GetGlyphIndices
+#undef GetGlyphIndices
+#endif
+
// from http://stackoverflow.com/questions/2948308/how-do-i-read-utf-8-characters-via-a-pointer
#define IS_IN_RANGE(c, f, l) (((c) >= (f)) && ((c) <= (l)))
@@ -240,17 +244,17 @@ namespace {
}
- int outline_cubic_to (FVecPtr ctl1, FVecPtr ctl2, FVecPtr to, void *user) {
+ int outline_cubic_to (FVecPtr control1, FVecPtr control2, FVecPtr to, void *user) {
glyph *g = static_cast (user);
g->pts.push_back (PT_CUBIC);
- g->pts.push_back (ctl1->x - g->x);
- g->pts.push_back (ctl1->y - g->y);
- g->pts.push_back (ctl2->x - ctl1->x);
- g->pts.push_back (ctl2->y - ctl1->y);
- g->pts.push_back (to->x - ctl2->x);
- g->pts.push_back (to->y - ctl2->y);
+ g->pts.push_back (control1->x - g->x);
+ g->pts.push_back (control1->y - g->y);
+ g->pts.push_back (control2->x - control1->x);
+ g->pts.push_back (control2->y - control1->y);
+ g->pts.push_back (to->x - control2->x);
+ g->pts.push_back (to->y - control2->y);
g->x = to->x;
g->y = to->y;
diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx
index 3a2b1c3ba..a40e002d1 100644
--- a/tools/CommandLineTools.hx
+++ b/tools/CommandLineTools.hx
@@ -1719,6 +1719,11 @@ class CommandLineTools {
targetFlags.set ("uwp", "");
targetFlags.set ("winjs", "");
+ case "winrt":
+
+ target = Platform.WINDOWS;
+ targetFlags.set ("winrt", "");
+
default:
target = cast targetName.toLowerCase ();
diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx
index 9b2976df4..549e5cd48 100644
--- a/tools/utils/PlatformSetup.hx
+++ b/tools/utils/PlatformSetup.hx
@@ -519,7 +519,7 @@ class PlatformSetup {
setupElectron ();
- case "windows":
+ case "windows", "winrt":
if (PlatformHelper.hostPlatform == Platform.WINDOWS) {