1)
c++输出日志:
std::wstringstream wStringstream1;
wStringstream1 << L"An error occurred. " << e->ErrorCode.ToString()->Data() << L": " << e->ErrorMessage->Data() << L"\n";
OutputDebugString(wStringstream1.str().c_str());
2)
包括cocos2d-x的项目,以及VS2015 创建的"DirectX 11 和 XAML 项目"在内,使用Low Latency Input时都不能触发touch事件:
菜单->工具->选项->调试 将"启用 XAML 的 UI 调试工具" 关掉~~~
3)
工作线程跳转到主线程:
auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
{
if (_swapChainPanel)
{
_swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([this]()
{
if (_adControl)
{
unsigned int index;
if (_swapChainPanel->Children->IndexOf(_adControl, &index))
{
_swapChainPanel->Children->RemoveAt(index);
}
}
}));
}
});
mInputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);