// // DirectXPage.xaml.cpp // Implementation of the DirectXPage class. // #include "pch.h" #include "DirectXPage.xaml.h" using namespace Cocos2dShaderCompiler; using namespace Platform; using namespace Windows::Foundation; using namespace Windows::Foundation::Collections; using namespace Windows::Graphics::Display; using namespace Windows::System::Threading; using namespace Windows::UI::Core; using namespace Windows::UI::Input; using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Controls::Primitives; using namespace Windows::UI::Xaml::Data; using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace concurrency; DirectXPage::DirectXPage(): m_windowVisible(true), m_coreInput(nullptr) { InitializeComponent(); // Register event handlers for page lifecycle. CoreWindow^ window = Window::Current->CoreWindow; window->VisibilityChanged += ref new TypedEventHandler(this, &DirectXPage::OnVisibilityChanged); DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); currentDisplayInformation->DpiChanged += ref new TypedEventHandler(this, &DirectXPage::OnDpiChanged); currentDisplayInformation->OrientationChanged += ref new TypedEventHandler(this, &DirectXPage::OnOrientationChanged); DisplayInformation::DisplayContentsInvalidated += ref new TypedEventHandler(this, &DirectXPage::OnDisplayContentsInvalidated); // Disable all pointer visual feedback for better performance when touching. auto pointerVisualizationSettings = PointerVisualizationSettings::GetForCurrentView(); pointerVisualizationSettings->IsContactFeedbackEnabled = false; pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false; } DirectXPage::~DirectXPage() { } void DirectXPage::OnCompile(Object^ sender, RoutedEventArgs^ args) { compiler.Compile(ResultText); } // Saves the current state of the app for suspend and terminate events. void DirectXPage::SaveInternalState(IPropertySet^ state) { //m_deviceResources->Trim(); } // Loads the current state of the app for resume events. void DirectXPage::LoadInternalState(IPropertySet^ state) { // Put code to load app state here. } // Window event handlers. void DirectXPage::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) { m_windowVisible = args->Visible; } // DisplayInformation event handlers. void DirectXPage::OnDpiChanged(DisplayInformation^ sender, Object^ args) { } void DirectXPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args) { } void DirectXPage::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args) { } void DirectXPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e) { } void DirectXPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e) { } void DirectXPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e) { } void DirectXPage::OnCompositionScaleChanged(SwapChainPanel^ sender, Object^ args) { }