MS-Accelerator V2无法创建DirectX 9设备 [英] MS-Accelerator V2 Failure to create a DirectX 9 device
本文介绍了MS-Accelerator V2无法创建DirectX 9设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨〜我在我的电脑上运行了一个Microsoft Accelerator V2示例。当我在visual studio 2012中使用 DX9Targets 运行应用程序时,出现错误:无法创建DirectX 9设备。我的电脑有两块显卡,一块是Intel HD显卡4600,另外一块是NVIDIA GeForce GTX 765M。非常感谢!
Hi~I run a sample of Microsoft Accelerator V2 on my computer. when I run an applications using DX9Targets in visual studio 2012, a error shown up: Failure to create a DirectX 9 device. There are two graphics card in my computer,one is Intel HD graphics 4600, other one is NVIDIA GeForce GTX 765M. Thanks a lot!
using System;
using Microsoft.ParallelArrays;
using FPA = Microsoft.ParallelArrays.FloatParallelArray;
using PA = Microsoft.ParallelArrays.ParallelArrays;
namespace AddArrays
{
class Program
{
static void Main(string[] args)
{
int arrayLength = 100;
Random ranf = new Random();
float[] inputArray1 = new float[arrayLength];
float[] inputArray2 = new float[arrayLength];
float[] stackedArray = new float[arrayLength];
// [1]
DX9Target evalTarget = new DX9Target();
// [2]
for (int i = 0; i < arrayLength; i++)
{
inputArray1[i] = (float)(Math.Sin((double)i / 10.0)
+ ranf.NextDouble() / 5.0);
inputArray2[i] = (float)(Math.Sin((double)i / 10.0)
+ ranf.NextDouble() / 5.0);
}
// [3]
FPA fpInput1 = new FPA(inputArray1);
FPA fpInput2 = new FPA(inputArray2);
// [4]
FPA fpStacked = PA.Add(fpInput1, fpInput2);
FPA fpOutput = PA.Divide(fpStacked, 2);
// [5]
stackedArray = evalTarget.ToArray1D(fpOutput);
// [6]
for (int i = 0; i < arrayLength; i++)
{
Console.WriteLine(stackedArray[i].ToString());
}
}
}
}
推荐答案
这篇关于MS-Accelerator V2无法创建DirectX 9设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文