diff --git a/build/winrt/angle.bat b/build/winrt/angle.bat new file mode 100644 index 0000000000..13bbf9f607 --- /dev/null +++ b/build/winrt/angle.bat @@ -0,0 +1,63 @@ +set IN_DIR=.\..\..\..\angle\src\WP8\redist\vs2012\ARM\Release + +set OUT_DIR=.\..\..\external\wp8-specific\angle\prebuilt\ARM\ +xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\esUtil_phone\esUtil_phone.lib" "%OUT_DIR%" /iycq + + + +set IN_DIR=.\..\..\..\angle\src\WP8\redist\vs2012\Win32\Release + +set OUT_DIR=.\..\..\external\wp8-specific\angle\prebuilt\Win32\ + + +xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\esUtil_phone\esUtil_phone.lib" "%OUT_DIR%" /iycq + + + +set IN_DIR=.\..\..\..\angle\src\WinRT\redist\vs2013\ARM\Release\ +set OUT_DIR=.\..\..\external\winrt-specific\angle\prebuilt\ARM\ +xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\esUtil_winrt_2013\esUtil.lib" "%OUT_DIR%" /iycq + + +set IN_DIR=.\..\..\..\angle\src\WinRT\redist\vs2013\Win32\Release\ +set OUT_DIR=.\..\..\external\winrt-specific\angle\prebuilt\Win32\ +xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.dll" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.lib" "%OUT_DIR%" /iycq + +xcopy "%IN_DIR%\esUtil_winrt_2013\esUtil.lib" "%OUT_DIR%" /iycq + + +set OUT_DIR=.\..\..\external\winrt-specific\angle\include +xcopy ".\..\..\..\angle\include" "%OUT_DIR%" /eiycq +xcopy ".\..\..\..\angle\src\common\winrtangle.h" "%OUT_DIR%" /iycq +xcopy ".\..\..\..\angle\samples\gles2_book\Common\esUtil.h" "%OUT_DIR%" /iycq + diff --git a/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj b/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj index 96dcb41aeb..e5cfb0f55d 100644 --- a/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj +++ b/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj @@ -68,12 +68,12 @@ echo "Copying WP8-XAML CPP template files" -xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq +xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq @@ -89,12 +89,12 @@ xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-x echo "Copying WP8-XAML CPP template files" -xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq +xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq @@ -110,12 +110,12 @@ xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-x echo "Copying WP8-XAML CPP template files" -xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq +xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq @@ -131,12 +131,12 @@ xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-x echo "Copying WP8-XAML CPP template files" -xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq -xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq +xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq +xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp index 24090e043b..608a524861 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp @@ -64,29 +64,29 @@ void Cocos2dRenderer::CreateGLResources() else { cocos2d::GL::invalidateStateCache(); - cocos2d::ShaderCache::getInstance()->reloadDefaultShaders(); + cocos2d::ShaderCache::getInstance()->reloadDefaultGLPrograms(); cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - director->setGLDefaultValues(); director->getEventDispatcher()->dispatchEvent(&foregroundEvent); cocos2d::Application::getInstance()->applicationWillEnterForeground(); - } + director->setGLDefaultValues(); + } m_loadingComplete = true; } void Cocos2dRenderer::Connect() { + } // purge Cocos2d-x gl GL resourses since the DirectX/Angle Context has been lost void Cocos2dRenderer::Disconnect() { Application::getInstance()->applicationDidEnterBackground(); - EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent); - Director::getInstance()->purgeCachedData(); + cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent); CloseAngle(); m_loadingComplete = false; } diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp index b2af8676b8..4322e0deee 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp @@ -56,14 +56,12 @@ IDrawingSurfaceBackgroundContentProvider^ Direct3DInterop::CreateContentProvider // Interface With Direct3DContentProvider HRESULT Direct3DInterop::Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device) { - //m_renderer->SetDevice(device); return S_OK; } void Direct3DInterop::Disconnect() { - std::lock_guard guard(mRenderingMutex); - m_renderer->Disconnect(); + m_renderer->Disconnect(); } // IDrawingSurfaceManipulationHandler @@ -143,8 +141,6 @@ HRESULT Direct3DInterop::PrepareResources(_In_ const LARGE_INTEGER* presentTarge HRESULT Direct3DInterop::Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView) { - std::lock_guard guard(mRenderingMutex); - m_renderer->UpdateDevice(device, context, renderTargetView); #if 0 if(mCurrentOrientation != WindowOrientation) diff --git a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h index 8c6bbad3ba..acda488448 100644 --- a/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h +++ b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h @@ -87,8 +87,6 @@ private: Windows::Graphics::Display::DisplayOrientations mCurrentOrientation; - std::mutex mRenderingMutex; - Cocos2dEventDelegate^ m_delegate; Cocos2dMessageBoxDelegate^ m_messageBoxDelegate; Cocos2dEditBoxDelegate^ m_editBoxDelegate; diff --git a/cocos/platform/wp8-xaml/cpp/DirectXBase.cpp b/cocos/platform/wp8-xaml/cpp/DirectXBase.cpp index 3b66c14f5b..d14bb0b4b3 100644 --- a/cocos/platform/wp8-xaml/cpp/DirectXBase.cpp +++ b/cocos/platform/wp8-xaml/cpp/DirectXBase.cpp @@ -24,6 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "DirectXBase.h" +#include "DirectXHelper.h" using namespace DirectX; using namespace Microsoft::WRL; @@ -167,12 +168,12 @@ void DirectXBase::Render() void DirectXBase::CloseAngle() { + eglMakeCurrent(NULL, NULL, NULL, NULL); - if(m_eglDisplay && m_eglSurface) + if(m_eglPhoneWindow != nullptr) { - eglDestroySurface(m_eglDisplay, m_eglSurface); - m_eglSurface = nullptr; - } + m_eglPhoneWindow->Update(nullptr, nullptr, nullptr); + } if(m_eglDisplay && m_eglContext) { @@ -180,18 +181,17 @@ void DirectXBase::CloseAngle() m_eglContext = nullptr; } - if(m_eglDisplay) + if(m_eglDisplay && m_eglSurface) + { + eglDestroySurface(m_eglDisplay, m_eglSurface); + m_eglSurface = nullptr; + } + + if(m_eglDisplay) { eglTerminate(m_eglDisplay); m_eglDisplay = nullptr; - } - - if(m_eglPhoneWindow != nullptr) - { - m_eglPhoneWindow->Update(nullptr, nullptr, nullptr); - } - - eglMakeCurrent(NULL, NULL, NULL, NULL); + } if(m_device) { @@ -199,11 +199,8 @@ void DirectXBase::CloseAngle() m_device = nullptr; } -#if 0 m_eglPhoneWindow = nullptr; m_eglWindow = nullptr; -#endif // 0 - m_bAngleInitialized = false; } @@ -262,10 +259,12 @@ bool DirectXBase::InitializeAngle(ID3D11Device1* d3dDevice, ID3D11DeviceContext1 m_eglPhoneWindow->Update(d3dDevice, d3dContext, d3dRenderTargetView); + ComPtr u; + HRESULT r = m_eglPhoneWindow.As(&u); if(m_eglWindow == nullptr) { DX::ThrowIfFailed( - CreateWinrtEglWindow(m_eglPhoneWindow.Get(), featureLevel, m_eglWindow.GetAddressOf()) + CreateWinrtEglWindow(u.Get(), featureLevel, m_eglWindow.GetAddressOf()) ); } diff --git a/cocos/platform/wp8-xaml/cpp/DirectXBase.h b/cocos/platform/wp8-xaml/cpp/DirectXBase.h index 1440ad6a1f..69e8daecb5 100644 --- a/cocos/platform/wp8-xaml/cpp/DirectXBase.h +++ b/cocos/platform/wp8-xaml/cpp/DirectXBase.h @@ -27,8 +27,12 @@ THE SOFTWARE. #include #include -#include "DirectXHelper.h" -#include "CCGL.h" +#include "EGL/egl.h" +#include "EGL/eglext.h" +#include "EGL/eglplatform.h" +#include "GLES2/gl2.h" +#include "GLES2/gl2ext.h" +#include "winrtangle.h" // Helper class that initializes DirectX APIs for 3D rendering. ref class DirectXBase abstract diff --git a/cocos/platform/wp8-xaml/xaml/App.xaml.cs b/cocos/platform/wp8-xaml/xaml/App.xaml.cs index 1269fb1137..c97119aec5 100644 --- a/cocos/platform/wp8-xaml/xaml/App.xaml.cs +++ b/cocos/platform/wp8-xaml/xaml/App.xaml.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; +using System.Diagnostics; +using System.Resources; using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; +using System.Windows.Markup; using System.Windows.Navigation; -using System.Windows.Shapes; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; +using System.IO.IsolatedStorage; +using PhoneDirect3DXamlAppInterop.Resources; namespace PhoneDirect3DXamlAppInterop { @@ -21,7 +17,28 @@ namespace PhoneDirect3DXamlAppInterop /// Provides easy access to the root frame of the Phone Application. /// /// The root frame of the Phone Application. - public PhoneApplicationFrame RootFrame { get; private set; } + public static PhoneApplicationFrame RootFrame { get; private set; } + + + enum SessionType + { + None, + Home, + DeepLink + } + + // Set to Home when the app is launched from Primary tile. + // Set to DeepLink when the app is launched from Deep Link. + private SessionType sessionType = SessionType.None; + + // Set to true when the page navigation is being reset + bool wasRelaunched = false; + + // set to true when 5 min passed since the app was relaunched + bool mustClearPagestack = false; + + IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; + /// /// Constructor for the Application object. @@ -31,14 +48,14 @@ namespace PhoneDirect3DXamlAppInterop // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; - // Standard Silverlight initialization + // Standard XAML initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); - // Show graphics profiling information while debugging. - if (System.Diagnostics.Debugger.IsAttached) + // Show graphics profiling information while debugging. + if (Debugger.IsAttached) { // Display the current frame rate counters. Application.Current.Host.Settings.EnableFrameRateCounter = false; @@ -50,8 +67,8 @@ namespace PhoneDirect3DXamlAppInterop // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; - // Disable the application idle detection by setting the UserIdleDetectionMode property of the - // application's PhoneApplicationService object to Disabled. + // Prevent the screen from turning off while under the debugger by disabling + // the application's idle detection. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; @@ -63,43 +80,63 @@ namespace PhoneDirect3DXamlAppInterop // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { + + // When a new instance of the app is launched, clear all deactivation settings + RemoveCurrentDeactivationSettings(); } // Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { + // If some interval has passed since the app was deactivated (30 seconds in this example), + // then remember to clear the back stack of pages + mustClearPagestack = CheckDeactivationTimeStamp(); + + + // If IsApplicationInstancePreserved is not true, then set the session type to the value + // saved in isolated storage. This will make sure the session type is correct for an + // app that is being resumed after being tombstoned. + if (!e.IsApplicationInstancePreserved) + { + RestoreSessionType(); + } + } // Code to execute when the application is deactivated (sent to background) // This code will not execute when the application is closing private void Application_Deactivated(object sender, DeactivatedEventArgs e) { + // When the applicaiton is deactivated, save the current deactivation settings to isolated storage + SaveCurrentDeactivationSettings(); } // Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { + // When the application closes, delete any deactivation settings from isolated storage + RemoveCurrentDeactivationSettings(); } // Code to execute if a navigation fails private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) + if (Debugger.IsAttached) { // A navigation has failed; break into the debugger - System.Diagnostics.Debugger.Break(); + Debugger.Break(); } } // Code to execute on Unhandled Exceptions private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) + if (Debugger.IsAttached) { // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); + Debugger.Break(); } } @@ -125,10 +162,80 @@ namespace PhoneDirect3DXamlAppInterop // Handle reset requests for clearing the backstack RootFrame.Navigated += CheckForResetNavigation; + // Monitor deep link launching + RootFrame.Navigating += RootFrame_Navigating; + // Ensure we don't initialize again phoneApplicationInitialized = true; } + // Event handler for the Navigating event of the root frame. Use this handler to modify + // the default navigation behavior. + void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e) + { + + // If the session type is None or New, check the navigation Uri to determine if the + // navigation is a deep link or if it points to the app's main page. + if (sessionType == SessionType.None && e.NavigationMode == NavigationMode.New) + { + // This block will run if the current navigation is part of the app's intial launch + + + // Keep track of Session Type + if (e.Uri.ToString().Contains("DeepLink=true")) + { + sessionType = SessionType.DeepLink; + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + sessionType = SessionType.Home; + } + } + + + if (e.NavigationMode == NavigationMode.Reset) + { + // This block will execute if the current navigation is a relaunch. + // If so, another navigation will be coming, so this records that a relaunch just happened + // so that the next navigation can use this info. + wasRelaunched = true; + } + else if (e.NavigationMode == NavigationMode.New && wasRelaunched) + { + // This block will run if the previous navigation was a relaunch + wasRelaunched = false; + + if (e.Uri.ToString().Contains("DeepLink=true")) + { + // This block will run if the launch Uri contains "DeepLink=true" which + // was specified when the secondary tile was created in MainPage.xaml.cs + + sessionType = SessionType.DeepLink; + // The app was relaunched via a Deep Link. + // The page stack will be cleared. + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + // This block will run if the navigation Uri is the main page + if (sessionType == SessionType.DeepLink) + { + // When the app was previously launched via Deep Link and relaunched via Main Tile, we need to clear the page stack. + sessionType = SessionType.Home; + } + else + { + if (!mustClearPagestack) + { + //The app was previously launched via Main Tile and relaunched via Main Tile. Cancel the navigation to resume. + e.Cancel = true; + RootFrame.Navigated -= ClearBackStackAfterReset; + } + } + } + + mustClearPagestack = false; + } + } // Do not add any additional code to this method private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) { @@ -153,7 +260,7 @@ namespace PhoneDirect3DXamlAppInterop // Unregister the event so it doesn't get called again RootFrame.Navigated -= ClearBackStackAfterReset; - // Only clear the stack for 'new' (forward) navigations + // Only clear the stack for 'new' (forward) and 'refresh' navigations if (e.NavigationMode != NavigationMode.New) return; @@ -165,5 +272,92 @@ namespace PhoneDirect3DXamlAppInterop } #endregion + + // Helper method for adding or updating a key/value pair in isolated storage + public bool AddOrUpdateValue(string Key, Object value) + { + bool valueChanged = false; + + // If the key exists + if (settings.Contains(Key)) + { + // If the value has changed + if (settings[Key] != value) + { + // Store the new value + settings[Key] = value; + valueChanged = true; + } + } + // Otherwise create the key. + else + { + settings.Add(Key, value); + valueChanged = true; + } + return valueChanged; + } + + // Helper method for removing a key/value pair from isolated storage + public void RemoveValue(string Key) + { + // If the key exists + if (settings.Contains(Key)) + { + settings.Remove(Key); + } + } + + // Called when the app is deactivating. Saves the time of the deactivation and the + // session type of the app instance to isolated storage. + public void SaveCurrentDeactivationSettings() + { + if (AddOrUpdateValue("DeactivateTime", DateTimeOffset.Now)) + { + settings.Save(); + } + + if (AddOrUpdateValue("SessionType", sessionType)) + { + settings.Save(); + } + + } + + // Called when the app is launched or closed. Removes all deactivation settings from + // isolated storage + public void RemoveCurrentDeactivationSettings() + { + RemoveValue("DeactivateTime"); + RemoveValue("SessionType"); + settings.Save(); + } + + // Helper method to determine if the interval since the app was deactivated is + // greater than 30 seconds + bool CheckDeactivationTimeStamp() + { + DateTimeOffset lastDeactivated; + + if (settings.Contains("DeactivateTime")) + { + lastDeactivated = (DateTimeOffset)settings["DeactivateTime"]; + } + + var currentDuration = DateTimeOffset.Now.Subtract(lastDeactivated); + + return TimeSpan.FromSeconds(currentDuration.TotalSeconds) > TimeSpan.FromSeconds(30); + } + + // Helper method to restore the session type from isolated storage. + void RestoreSessionType() + { + if (settings.Contains("SessionType")) + { + sessionType = (SessionType)settings["SessionType"]; + } + } + + } -} \ No newline at end of file +} diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index dfc548899b..9e2e8f36db 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -455,6 +455,16 @@ Texture2D::~Texture2D() } } +void Texture2D::releaseGLTexture() +{ + if(_name) + { + GL::deleteTexture(_name); + } + _name = 0; +} + + Texture2D::PixelFormat Texture2D::getPixelFormat() const { return _pixelFormat; @@ -539,14 +549,7 @@ bool Texture2D::initWithData(const void *data, ssize_t dataLen, Texture2D::Pixel bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat pixelFormat, int pixelsWide, int pixelsHigh) { - // cocos2d-x is currently calling this multiple times on the same Texture2D - // if the GL texture has already been created,it will be leaked in OpenGL - // For now, call deleteTexture if the texture already exists - if(_name) - { - GL::deleteTexture(_name); - _name = 0; - } + //the pixelFormat must be a certain value CCASSERT(pixelFormat != PixelFormat::NONE && pixelFormat != PixelFormat::AUTO, "the \"pixelFormat\" param must be a certain value!"); @@ -601,8 +604,12 @@ bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); } - + if(_name != 0) + { + GL::deleteTexture(_name); + _name = 0; + } glGenTextures(1, &_name); GL::bindTexture2D(_name); diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index 744ae29786..97b515dc7e 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -203,6 +203,12 @@ public: */ virtual std::string getDescription() const; + /** release only the gl texture. + * @js NA + * @lua NA + */ + void releaseGLTexture(); + /** Initializes with a texture2d with data * @js NA * @lua NA diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index d7db2feaa8..582b913172 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -706,6 +706,12 @@ void VolatileTextureMgr::reloadAllTextures() { _isReloading = true; + // we need to release all of the glTextures to avoid collisions of texture id's when reloading the textures onto the GPU + for(auto iter = _textures.begin(); iter != _textures.end(); ++iter) + { + (*iter)->_texture->releaseGLTexture(); + } + CCLOG("reload all texture"); auto iter = _textures.begin(); diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs index ce05496656..c97119aec5 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/App.xaml.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; +using System.Diagnostics; +using System.Resources; using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; +using System.Windows.Markup; using System.Windows.Navigation; -using System.Windows.Shapes; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; +using System.IO.IsolatedStorage; +using PhoneDirect3DXamlAppInterop.Resources; namespace PhoneDirect3DXamlAppInterop { @@ -21,7 +17,28 @@ namespace PhoneDirect3DXamlAppInterop /// Provides easy access to the root frame of the Phone Application. /// /// The root frame of the Phone Application. - public PhoneApplicationFrame RootFrame { get; private set; } + public static PhoneApplicationFrame RootFrame { get; private set; } + + + enum SessionType + { + None, + Home, + DeepLink + } + + // Set to Home when the app is launched from Primary tile. + // Set to DeepLink when the app is launched from Deep Link. + private SessionType sessionType = SessionType.None; + + // Set to true when the page navigation is being reset + bool wasRelaunched = false; + + // set to true when 5 min passed since the app was relaunched + bool mustClearPagestack = false; + + IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; + /// /// Constructor for the Application object. @@ -31,14 +48,14 @@ namespace PhoneDirect3DXamlAppInterop // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; - // Standard Silverlight initialization + // Standard XAML initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); - // Show graphics profiling information while debugging. - if (System.Diagnostics.Debugger.IsAttached) + // Show graphics profiling information while debugging. + if (Debugger.IsAttached) { // Display the current frame rate counters. Application.Current.Host.Settings.EnableFrameRateCounter = false; @@ -50,8 +67,8 @@ namespace PhoneDirect3DXamlAppInterop // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; - // Disable the application idle detection by setting the UserIdleDetectionMode property of the - // application's PhoneApplicationService object to Disabled. + // Prevent the screen from turning off while under the debugger by disabling + // the application's idle detection. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; @@ -63,43 +80,63 @@ namespace PhoneDirect3DXamlAppInterop // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { + + // When a new instance of the app is launched, clear all deactivation settings + RemoveCurrentDeactivationSettings(); } // Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { + // If some interval has passed since the app was deactivated (30 seconds in this example), + // then remember to clear the back stack of pages + mustClearPagestack = CheckDeactivationTimeStamp(); + + + // If IsApplicationInstancePreserved is not true, then set the session type to the value + // saved in isolated storage. This will make sure the session type is correct for an + // app that is being resumed after being tombstoned. + if (!e.IsApplicationInstancePreserved) + { + RestoreSessionType(); + } + } // Code to execute when the application is deactivated (sent to background) // This code will not execute when the application is closing private void Application_Deactivated(object sender, DeactivatedEventArgs e) { + // When the applicaiton is deactivated, save the current deactivation settings to isolated storage + SaveCurrentDeactivationSettings(); } // Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { + // When the application closes, delete any deactivation settings from isolated storage + RemoveCurrentDeactivationSettings(); } // Code to execute if a navigation fails private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) + if (Debugger.IsAttached) { // A navigation has failed; break into the debugger - System.Diagnostics.Debugger.Break(); + Debugger.Break(); } } // Code to execute on Unhandled Exceptions private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { - if (System.Diagnostics.Debugger.IsAttached) + if (Debugger.IsAttached) { // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); + Debugger.Break(); } } @@ -125,10 +162,80 @@ namespace PhoneDirect3DXamlAppInterop // Handle reset requests for clearing the backstack RootFrame.Navigated += CheckForResetNavigation; + // Monitor deep link launching + RootFrame.Navigating += RootFrame_Navigating; + // Ensure we don't initialize again phoneApplicationInitialized = true; } + // Event handler for the Navigating event of the root frame. Use this handler to modify + // the default navigation behavior. + void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e) + { + + // If the session type is None or New, check the navigation Uri to determine if the + // navigation is a deep link or if it points to the app's main page. + if (sessionType == SessionType.None && e.NavigationMode == NavigationMode.New) + { + // This block will run if the current navigation is part of the app's intial launch + + + // Keep track of Session Type + if (e.Uri.ToString().Contains("DeepLink=true")) + { + sessionType = SessionType.DeepLink; + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + sessionType = SessionType.Home; + } + } + + + if (e.NavigationMode == NavigationMode.Reset) + { + // This block will execute if the current navigation is a relaunch. + // If so, another navigation will be coming, so this records that a relaunch just happened + // so that the next navigation can use this info. + wasRelaunched = true; + } + else if (e.NavigationMode == NavigationMode.New && wasRelaunched) + { + // This block will run if the previous navigation was a relaunch + wasRelaunched = false; + + if (e.Uri.ToString().Contains("DeepLink=true")) + { + // This block will run if the launch Uri contains "DeepLink=true" which + // was specified when the secondary tile was created in MainPage.xaml.cs + + sessionType = SessionType.DeepLink; + // The app was relaunched via a Deep Link. + // The page stack will be cleared. + } + else if (e.Uri.ToString().Contains("/MainPage.xaml")) + { + // This block will run if the navigation Uri is the main page + if (sessionType == SessionType.DeepLink) + { + // When the app was previously launched via Deep Link and relaunched via Main Tile, we need to clear the page stack. + sessionType = SessionType.Home; + } + else + { + if (!mustClearPagestack) + { + //The app was previously launched via Main Tile and relaunched via Main Tile. Cancel the navigation to resume. + e.Cancel = true; + RootFrame.Navigated -= ClearBackStackAfterReset; + } + } + } + + mustClearPagestack = false; + } + } // Do not add any additional code to this method private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) { @@ -140,36 +247,12 @@ namespace PhoneDirect3DXamlAppInterop RootFrame.Navigated -= CompleteInitializePhoneApplication; } - private bool _isResume = false; private void CheckForResetNavigation(object sender, NavigationEventArgs e) { + // If the app has received a 'reset' navigation, then we need to check + // on the next navigation to see if the page stack should be reset if (e.NavigationMode == NavigationMode.Reset) - { - RootFrame.Navigating += HandlerFotResetNavigating; - _isResume = true; - } - else - { - if (_isResume && e.NavigationMode == NavigationMode.Refresh) - { - RootFrame.Navigating -= HandlerFotResetNavigating; - _isResume = false; - } - } - } - - private void HandlerFotResetNavigating(object sender, NavigatingCancelEventArgs e) - { - RootFrame.Navigating -= HandlerFotResetNavigating; - if (e.Uri.OriginalString.Contains("MainPage.xaml")) - { - e.Cancel = true; - } - else - { RootFrame.Navigated += ClearBackStackAfterReset; - } - _isResume = false; } private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) @@ -177,7 +260,7 @@ namespace PhoneDirect3DXamlAppInterop // Unregister the event so it doesn't get called again RootFrame.Navigated -= ClearBackStackAfterReset; - // Only clear the stack for 'new' (forward) navigations + // Only clear the stack for 'new' (forward) and 'refresh' navigations if (e.NavigationMode != NavigationMode.New) return; @@ -189,5 +272,92 @@ namespace PhoneDirect3DXamlAppInterop } #endregion + + // Helper method for adding or updating a key/value pair in isolated storage + public bool AddOrUpdateValue(string Key, Object value) + { + bool valueChanged = false; + + // If the key exists + if (settings.Contains(Key)) + { + // If the value has changed + if (settings[Key] != value) + { + // Store the new value + settings[Key] = value; + valueChanged = true; + } + } + // Otherwise create the key. + else + { + settings.Add(Key, value); + valueChanged = true; + } + return valueChanged; + } + + // Helper method for removing a key/value pair from isolated storage + public void RemoveValue(string Key) + { + // If the key exists + if (settings.Contains(Key)) + { + settings.Remove(Key); + } + } + + // Called when the app is deactivating. Saves the time of the deactivation and the + // session type of the app instance to isolated storage. + public void SaveCurrentDeactivationSettings() + { + if (AddOrUpdateValue("DeactivateTime", DateTimeOffset.Now)) + { + settings.Save(); + } + + if (AddOrUpdateValue("SessionType", sessionType)) + { + settings.Save(); + } + + } + + // Called when the app is launched or closed. Removes all deactivation settings from + // isolated storage + public void RemoveCurrentDeactivationSettings() + { + RemoveValue("DeactivateTime"); + RemoveValue("SessionType"); + settings.Save(); + } + + // Helper method to determine if the interval since the app was deactivated is + // greater than 30 seconds + bool CheckDeactivationTimeStamp() + { + DateTimeOffset lastDeactivated; + + if (settings.Contains("DeactivateTime")) + { + lastDeactivated = (DateTimeOffset)settings["DeactivateTime"]; + } + + var currentDuration = DateTimeOffset.Now.Subtract(lastDeactivated); + + return TimeSpan.FromSeconds(currentDuration.TotalSeconds) > TimeSpan.FromSeconds(30); + } + + // Helper method to restore the session type from isolated storage. + void RestoreSessionType() + { + if (settings.Contains("SessionType")) + { + sessionType = (SessionType)settings["SessionType"]; + } + } + + } -} \ No newline at end of file +} diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs index 0b373abeef..bf26a41d6e 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs +++ b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.Designer.cs @@ -1,18 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources -{ +namespace PhoneDirect3DXamlAppInterop.Resources { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,61 +22,69 @@ namespace PhoneDirect3DXamlAppInterop.Resources [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AppResources - { - + public class AppResources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AppResources() - { + internal AppResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { + public static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// /// Looks up a localized string similar to MY APPLICATION. /// - public static string ApplicationTitle - { - get - { + public static string ApplicationTitle { + get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } + + /// + /// Looks up a localized string similar to LeftToRight. + /// + public static string ResourceFlowDirection { + get { + return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to en-US. + /// + public static string ResourceLanguage { + get { + return ResourceManager.GetString("ResourceLanguage", resourceCulture); + } + } } } diff --git a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.resx b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.resx index a87513f531..6786b12575 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.resx +++ b/templates/cpp-template-default/proj.wp8-xaml/App/Resources/AppResources.resx @@ -1,17 +1,17 @@  - @@ -120,4 +120,12 @@ MY APPLICATION + + LeftToRight + Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language + + + en-US + Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language. + \ No newline at end of file diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs index 0b373abeef..daa745fe09 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.Designer.cs @@ -1,18 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources -{ +namespace PhoneDirect3DXamlAppInterop.Resources { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,59 +22,49 @@ namespace PhoneDirect3DXamlAppInterop.Resources [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AppResources - { - + public class AppResources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AppResources() - { + internal AppResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { + public static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// /// Looks up a localized string similar to MY APPLICATION. /// - public static string ApplicationTitle - { - get - { + public static string ApplicationTitle { + get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.resx b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.resx index a87513f531..13e5fdc678 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.resx +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/Resources/AppResources.resx @@ -1,17 +1,17 @@  - diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs index 0b373abeef..daa745fe09 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.Designer.cs @@ -1,18 +1,17 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.34014 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace PhoneDirect3DXamlAppInterop.Resources -{ +namespace PhoneDirect3DXamlAppInterop.Resources { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,59 +22,49 @@ namespace PhoneDirect3DXamlAppInterop.Resources [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AppResources - { - + public class AppResources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AppResources() - { + internal AppResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { + public static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } - + /// /// Looks up a localized string similar to MY APPLICATION. /// - public static string ApplicationTitle - { - get - { + public static string ApplicationTitle { + get { return ResourceManager.GetString("ApplicationTitle", resourceCulture); } } diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.resx b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.resx index a87513f531..13e5fdc678 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.resx +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-tests/Resources/AppResources.resx @@ -1,17 +1,17 @@  -