如何解决错误+ D3DERR_NOTAVAILABLE + directX + c#。我使用的是Windows XP [英] how to resolve error+D3DERR_NOTAVAILABLE+directX+c#. I am using Windows XP
问题描述
我想在C#中使用DirectX。它无法创建设备,并且提供错误为"D3DERR_NOTAVAILABLE"。任何人都可以帮助我。
private void InitDirectX()
{
试试
{
PresentParameters presentParamaters = new PresentParameters();
if(presentParamaters == null)
{
                    MessageBox.Show("创建演示参数时出错!");
$
;      Application.Exit();&
}
this.Width = 800;
this.Height = 600;
                presentParamaters.Windowed = true;
presentParamaters.SwapEffect = SwapEffect.Discard;
                presentParamaters.BackBufferWidth = 640;
                presentParamaters.BackBufferHeight = 480;
               的  设备=新的设备(0,DeviceType.Hardware,为此, 强>
的        &NBSP ;            CreateFlags.SoftwareVertexProcessing, 强>
的 &NBSP ;                   presentParamaters); 的 ---------------------> 此部分投入
错误 强>
              &NBSP ; if(device == null)
{
                    MessageBox.Show(QUOT;错误创建的Direct3D设备");
              &NBSP ;     Application.Exit();&
}
string信息; // =新的字符串();
                msg =" Width =" + this.Width.ToString()+",Height =" + this.Height.ToString();
                MessageBox.Show(msg);
}
catch(DirectXException e)
{
MessageBox.Show(e.ToString()," Error"); //处理所有例外情况
}
}
您有更好的机会得到答案的一个直接X论坛:的
http://xboxforums.create.msdn.com/forums/
虽然看起来像你'重新使用古老的Managed DirectX库,这个库已经过时了,这对答案没有帮助......
I want to use DirectX with C#. it is not able to create Device and it is giving error as "D3DERR_NOTAVAILABLE". Can anyone please help me on this.
private void InitDirectX()
{
try
{
PresentParameters presentParamaters = new PresentParameters();
if (presentParamaters == null)
{
MessageBox.Show("Error creating Presentation Parameters!");
Application.Exit();
}
this.Width = 800;
this.Height = 600;
presentParamaters.Windowed = true;
presentParamaters.SwapEffect = SwapEffect.Discard;
presentParamaters.BackBufferWidth = 640;
presentParamaters.BackBufferHeight = 480;
device = new Device(0, DeviceType.Hardware, this,
CreateFlags.SoftwareVertexProcessing,
presentParamaters);---------------------> This portion is throwing
error
if (device == null)
{
MessageBox.Show("Error creating Direct3D Device");
Application.Exit();
}
string msg;// = new string();
msg = "Width = " + this.Width.ToString() + ", Height = " + this.Height.ToString();
MessageBox.Show(msg);
}
catch (DirectXException e)
{
MessageBox.Show(e.ToString(), "Error"); // Handle all the exceptions
}
}
You have a better chance to get an answer in a Direct X forum: http://xboxforums.create.msdn.com/forums/
Though it seems that you're using the ancient Managed DirectX library which is obsolete, that doesn't exactly help with answers...
这篇关于如何解决错误+ D3DERR_NOTAVAILABLE + directX + c#。我使用的是Windows XP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!