本文介绍了最小化的DirectX metro-app无法进入暂停状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Direct3D创建一个地铁风格的游戏。我的代码基于示例"Simple Direct3D 11.1 Game Sample"。
我添加了以下暂停事件处理程序:
ref class D3DView
{
...
void OnSuspending(Platform :: Object ^ sender,Windows :: ApplicationModel :: SuspendingEventArgs ^ args){
//一些代码
}
...
};
D3DView :: D3DView(...)
{
...
Windows :: ApplicationModel :: Core :: CoreApplication :: Suspending + =
ref new EventHandler< Windows :: ApplicationModel :: SuspendingEventArgs ^>( this ,& ; D3DView :: OnSuspending);
...
}
解决方案
I'm creating a metro style game using Direct3D. My code is based on the example "Simple Direct3D 11.1 Game Sample".I added the following suspending event handler:
ref class D3DView { ... void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args) { // some code } ... }; D3DView::D3DView(...) { ... Windows::ApplicationModel::Core::CoreApplication::Suspending += ref new EventHandler<Windows::ApplicationModel::SuspendingEventArgs^>(this, &D3DView::OnSuspending); ... }
解决方案
这篇关于最小化的DirectX metro-app无法进入暂停状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-30 02:59